@ss/ss
Function File: sys = ss (sys)
Function File: sys = ss (d, …)
Function File: sys = ss (a, b, …)
Function File: sys = ss (a, b, c, …)
Function File: sys = ss (a, b, c, d, …)
Function File: sys = ss (a, b, c, d, tsam, …)
Create or convert to state-space model.
Inputs
[] or not specified, an identity matrix is assumed.[] or not specified, a zero matrix is assumed.set (ss) for more information.Outputs
Option Keys and Values
{'x1', 'x2', ...}{'u1', 'u2', ...}{'y1', 'y2', ...}Equations $$\dot{x} = A\,x + B\,u$$$$y = C\,x + D\,u$$
Example
octave:1> a = [1 2 3; 4 5 6; 7 8 9];
octave:2> b = [10; 11; 12];
octave:3> stname = {'V', 'A', 'kJ'};
octave:4> sys = ss (a, b, 'stname', stname)
sys.a =
V A kJ
V 1 2 3
A 4 5 6
kJ 7 8 9
sys.b =
u1
V 10
A 11
kJ 12
sys.c =
V A kJ
y1 1 0 0
y2 0 1 0
y3 0 0 1
sys.d =
u1
y1 0
y2 0
y3 0
Continuous-time model.
octave:5>
|
Compatibility issue
If the state-space model sys is converted from a transfer function, the resulting state-space model can be transformed into the form computed by Matlab (a controllable canonical form with flipped state variables order) by using the following similarity transformation:
n = size (sys.a, 1) QSi = inv (ctrb (sys)) T(n,:) = QSi(n,:) for i=n-1:-1:1, T(i,:) = T(i+1,:)*sys.a, endfor sys_ml = ss2ss (sys, T) |
Source Code: @ss/ss