scipy.signal.StateSpace¶
- class scipy.signal.StateSpace(*system, **kwargs)[源代码]¶
状态空间形式的线性时不变系统。
将系统表示为连续时间的一阶微分方程 \(\dot{{x}} = A x + B u\) 或者离散时间差分方程 \(x[k+1] = A x[k] + B u[k]\) 。
StateSpace
系统从lti
,分别在dlti
类,具体取决于使用的系统表示形式。- 参数
- *system: arguments
这个
StateSpace
类可以用1个或4个参数实例化。下面给出了输入参数的数量及其解释:1:
lti
或dlti
系统: (StateSpace
,TransferFunction
或ZerosPolesGain
)4:ARRAY_LIKE:(A,B,C,D)
- DT:浮点,可选
采样时间 [s] 离散时间系统。默认为 None (连续时间)。必须指定为关键字参数,例如,
dt=0.1
。
参见
注意事项
更改不属于
StateSpace
系统表示(如 zeros 或 poles )效率非常低,并且可能导致数值不准确。最好先转换为特定的系统表示。例如,调用sys = sys.to_zpk()
在访问/改变零点、极点或增益之前。示例
>>> from scipy import signal
>>> a = np.array([[0, 1], [0, 0]]) >>> b = np.array([[0], [1]]) >>> c = np.array([[1, 0]]) >>> d = np.array([[0]])
>>> sys = signal.StateSpace(a, b, c, d) >>> print(sys) StateSpaceContinuous( array([[0, 1], [0, 0]]), array([[0], [1]]), array([[1, 0]]), array([[0]]), dt: None )
>>> sys.to_discrete(0.1) StateSpaceDiscrete( array([[1. , 0.1], [0. , 1. ]]), array([[0.005], [0.1 ]]), array([[1, 0]]), array([[0]]), dt: 0.1 )
>>> a = np.array([[1, 0.1], [0, 1]]) >>> b = np.array([[0.005], [0.1]])
>>> signal.StateSpace(a, b, c, d, dt=0.1) StateSpaceDiscrete( array([[1. , 0.1], [0. , 1. ]]), array([[0.005], [0.1 ]]), array([[1, 0]]), array([[0]]), dt: 0.1 )
- 属性
A
的状态矩阵
StateSpace
系统。B
的输入矩阵
StateSpace
系统。C
的输出矩阵
StateSpace
系统。D
的馈通矩阵
StateSpace
系统。dt
返回系统的采样时间, None 为
lti
系统。poles
系统的两极。
zeros
系统的零。
方法:
__mul__
\(其他)后乘另一个系统或标量
to_ss
\()返回当前
StateSpace
系统。将系统表示形式转换为
TransferFunction
。将系统表示形式转换为
ZerosPolesGain
。