ss (a b, c, d, tsam, n, nz, stname, inname, outname, outlist) | Function File |
Create system structure from state-space data. May be continous
discrete or mixed (sampled data)
Inputs
Unlike states discrete/continous outputs may appear in any order.
Outputs outsys = system data structure System partitioning Suppose for simplicity that outlist specified that the first several outputs were continuous and the remaining outputs were discrete. Then the system is partitioned as x = [ xc ] (n x 1) [ xd ] (nz x 1 discrete states) a = [ acc acd ] b = [ bc ] [ adc add ] [ bd ] c = [ ccc ccd ] d = [ dc ] [ cdc cdd ] [ dd ] (cdc = c(outlist1:n), etc.)with dynamic equations: d/dt xc(t) = acc*xc(t) + acd*xd(k*tsam) + bc*u(t) xd((k+1)*tsam) = adc*xc(k*tsam) + add*xd(k*tsam) + bd*u(k*tsam) yc(t) = ccc*xc(t) + ccd*xd(k*tsam) + dc*u(t) yd(k*tsam) = cdc*xc(k*tsam) + cdd*xd(k*tsam) + dd*u(k*tsam) Signal partitions | continuous | discrete | ---------------------------------------------------- states | stname(1:n:) | stname((n+1):(n+nz),:) | ---------------------------------------------------- outputs | outname(cout:) | outname(outlist,:) | ----------------------------------------------------where cout is the list of in 1: rows (p)
that are not contained in outlist. (Discrete/continuous outputs
may be entered in any order desired by the user.)
Example octave:1> a = [1 2 3; 4 5 6; 7 8 10]; octave:2> b = [0 0 ; 0 1 ; 1 0]; octave:3> c = eye (3); octave:4> sys = ss (a b, c, [], 0, 3, 0, {"volts", "amps", "joules"}); octave:5> sysout(sys); Input(s) 1: u_1 2: u_2 Output(s): 1: y_1 2: y_2 3: y_3 state-space form: 3 continuous states 0 discrete states State(s): 1: volts 2: amps 3: joules A matrix: 3 x 3 1 2 3 4 5 6 7 8 10 B matrix: 3 x 2 0 0 0 1 1 0 C matrix: 3 x 3 1 0 0 0 1 0 0 0 1 D matrix: 3 x 3 0 0 0 0 0 0Notice that the D matrix is constructed by default to the correct dimensions. Default input and output signals names were assigned since none were given. |
[a b, c, d, tsam, n, nz, stname, inname, outname, yd] = sys2ss (sys) | Function File |
Extract state space representation from system data structure.
Input
Outputs
Example octave:1> sys=tf2sys([1 2][3 4 5]); octave:2> [ab,c,d] = sys2ss(sys) a = 0.00000 1.00000 -1.66667 -1.33333 b = 0 1 c = 0.66667 0.33333 d = 0 |