Section 9–3 / Transformation of System Models with MATLAB 657
Another possible state-space representation (among infinitely many alternatives) is
(9–23)
(9–24)
MATLAB transforms the transfer function given by Equation (9–22) into the state-space
representation given by Equations (9–23) and (9–24). For the example system considered
here, MATLAB Program 9–1 will produce matrices A,B,C, and D.
y =[0 10 10]C
x 1
x 2
x 3
S +[0] u
C
x
1
x
2
x
3
S = C
- 6
1
0
- 5
0
1
- 10
0
0
SC
x 1
x 2
x 3
S + C
1
0
0
Su
MATLAB Program 9–1
num = [10 10];
den = [1 6 5 10];
[A,B,C,D] = tf2ss(num,den)
A=
-6 -5 -10
1 - 0 - 0
0 - 1 - 0
B =
1
0
0
C =
01010
D =
0
Transformation from State Space to Transfer Function. To obtain the transfer
function from state-space equations, use the following command:
[num,den] = ss2tf(A,B,C,D,iu)
iumust be specified for systems with more than one input. For example, if the system
has three inputs (u1, u2, u3),theniumust be either 1, 2, or 3, where 1 implies u1, 2
impliesu2,and 3 implies u3.
If the system has only one input, then either
[num,den] = ss2tf(A,B,C,D)
or
[num,den] = ss2tf(A,B,C,D,1)
may be used. (See Example 9–3 and MATLAB Program 9–2.)