Page 200 - MATLAB an introduction with applications
P. 200
Control Systems ——— 185
1
B
0
BB = =
0
0
0
CC = [025 5 0 ] [C= ] 0
>> % MATLAB Program
>> A =[–5 –30 –5; 1 0 0; 0 1 0];
>> B =[1; 0; 0];
>> C =[0 25 5];
>> D =[0];
>> AA =[A zeros (3, 1); C 0];
>> BB =[B; 0];
>> CC =[C 0];
>> DD =[0];
>> t=0:0.01:5;
>> [z, x, t] =step (AA, BB, CC, DD, 1, t);
>> P =[0 0 0 1]*x’;
>> plot (t, P, t, t)
>> grid
>> title (‘Unit-ramp response’)
>> xlabel (‘t Sec’)
>> ylabel (‘Input and output’)
Unit-ramp Response
5
4.5
4
3.5
Output 3
and 2.5
Input 2
1.5
1
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
t Sec
Fig. E3.30 (b) Unit-ramp response
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09