Create a state space system.
The function accepts either 1, 4 or 5 positional parameters:
ss(sys)
Convert a linear system into space system form. Always creates a new system, even if
sys
is already a state space system.
ss(A, B, C, D)
Create a state space system from the matrices of its state and output equations:
ss(A, B, C, D, dt)
Create a discrete-time state space system from the matrices of its state and output equations:
The matrices can be given as 2D array_like data types. For SISO systems,
B
andC
can be given as 1D arrays and D can be given as a scalar.
ss(*args, inputs=['u1', ..., 'up'], outputs=['y1', ..., 'yq'], states=['x1', ..., 'xn'])
Create a system with named input, output, and state signals.
StateSpace
or TransferFunction
A linear system.
System, control, output, and feed forward matrices.
System timebase. 0 (default) indicates continuous time, True indicates discrete time with unspecified sampling time, positive number is discrete time with specified sampling time, None indicates unspecified timebase (either continuous or discrete time).
If True, remove states that have no effect on the input/output dynamics. If not specified, the value is read from config.defaults['statesp.remove_useless_states']
(default = False).
Set the method used for converting a transfer function to a state space system. Current methods are ‘slycot’ and ‘scipy’. If set to None (default), try ‘slycot’ first and then ‘scipy’ (SISO only).
StateSpace
Linear input/output system.
List of strings that name the individual signals. If this parameter is not given or given as None, the signal names will be of the form ‘s[i]’ (where ‘s’ is one of ‘u’, ‘y’, or ‘x’). See InputOutputSystem
for more information.
Set the prefix for input, output, and state signals. Defaults = ‘u’, ‘y’, ‘x’.
System name (used for specifying signals). If unspecified, a generic name ‘sys[id]’ is generated with a unique integer id.
If matrix sizes are not self-consistent.
Notes
If a transfer function is passed as the sole positional argument, the system will be converted to state space form in the same way as calling tf2ss
. The method
keyword can be used to select the method for conversion.
Examples
Create a linear I/O system object from matrices:
>>> G = ct.ss([[-1, -2], [3, -4]], [[5], [7]], [[6, 8]], [[9]])
Convert a transfer function to a state space system:
>>> sys_tf = ct.tf([2.], [1., 3]) >>> sys2 = ct.ss(sys_tf)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4