scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
tf2ss(num, den)

Parameters

num, den : array_like

Sequences representing the coefficients of the numerator and denominator polynomials, in order of descending degree. The denominator needs to be at least as long as the numerator.

Returns

A, B, C, D : ndarray

State space representation of the system, in controller canonical form.

Transfer function to state-space representation.

Examples

Convert the transfer function:

$$H(s) = \frac{s^2 + 3s + 3}{s^2 + 2s + 1}$$
>>> num = [1, 3, 3]
... den = [1, 2, 1]

to the state-space representation:

$$$$

\dot{\textbf{x}}(t) = \begin{bmatrix} -2 & -1 \\ 1 & 0 \end{bmatrix} \textbf{x}(t) + \begin{bmatrix} 1 \\ 0 \end{bmatrix} \textbf{u}(t) \\

\textbf{y}(t) = \begin{bmatrix} 1 & 2 \end{bmatrix} \textbf{x}(t) + \begin{bmatrix} 1 \end{bmatrix} \textbf{u}(t)

>>> from scipy.signal import tf2ss
... A, B, C, D = tf2ss(num, den)
... A array([[-2., -1.], [ 1., 0.]])
>>> B
array([[ 1.],
       [ 0.]])
>>> C
array([[ 1.,  2.]])
>>> D
array([[ 1.]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.signal._ltisys.TransferFunctionContinuous scipy.signal._ltisys.TransferFunction scipy.signal._lti_conversion.tf2ss scipy.signal._ltisys.TransferFunctionDiscrete

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/signal/_lti_conversion.py#18
type: <class 'function'>
Commit: