MATLAB - Modelling in Time Domain - Norman Nise
MATLAB - Modelling in Time Domain - Norman Nise
2 MATLAB Examples 79
[e demon- the Command Window to see a list of choices for s. Multiple plots also can be
. 10(s f 2) obtained using plot (X1, Y1,51 ,X2tY2,52,X3,Y3,S3, ). In the
following example we plot on the same graph sin(s/) in red and cos(5r) in green
for /: 0 to 10 seconds in 0.01 second increments. Time is specified as t:start:
incremenl, : flnal.
el
'or'
B:[7 B 9]' % Represent column vector B.
pause
canonical form, which will be explained in Chapter 5 in the text. To obtain the phase- A:[0 1 O;0
variable form, IAp, Bp, Cp , Dp], we perform the following operations: Ap:inv P ) B:11 ; B;9);
(
*A*p; Bp:inv (P)*B; Cp:C*P, Dp:D, whele P is a matrix with 1's along the anti- c:t2 3 4l
diagonal and 0's elsewhire. "These transformations will be explained in Chapter 5' rTtf
* ( s )'
The command inv (X) finds the inverse of a squale matrix. The symbol signifies
Inum, den]=
multiplication. For systems represented as LII objects, the command s s (F ) , where
f is an LII transfer-function object, can be used to convelt F to a state-space object'
Let us look at Example 3.4 in the text. For the numerator-denominator representa-
tion, notice that the MAILAB response associates the gain, 24, with the vector C
rather than the vector B as in the example in the text. Both representations are
equivalent. For the LTI transfer-function object, the conversion to state space does rLl
not yield the phase-variable form. The result is a balanced model that improves the Tss:ss (A,
acculacy of calculating eigenvalues, which are covered in Chapter 4. Since ss (E) 'Polynomi
does not yield familial forms of the state equations (nor is it possible to easily Trf:rf (rs
convert to familiar forms), we will have limited use for that transformation at this
time. rFactored
Tzpk=zpk
% Display fabel .
t
% (4/z*wn).