Section 5–5 / Transient-Response Analysis with MATLAB 197
aa
Unit-Step Response of sG(s)=s/(s^2 +0.2s+1)
Time (sec)
Amplitude
0 5 10 15 20 25 30 35 40 45 50
1
0.8
0.2
–0.6
–0.8
0.6
0.4
0
–0.2
–0.4
Figure 5–25
Unit-impulse-
response curve
obtained as the unit-
step response of
sG(s)=
s/As^2 +0.2s+1B.
MATLAB Program 5–9
num = [1 0];
den = [1 0.2 1];
step(num,den);
grid
title(‘Unit-Step Response of sG(s) = s/(s^2 + 0.2s + 1)‘)
and use the step-response command; as given in MATLAB Program 5–9, we obtain a
plot of the unit-impulse response of the system as shown in Figure 5–25.
Ramp Response. There is no ramp command in MATLAB. Therefore, we need
to use the step command or the lsim command (presented later) to obtain the ramp re-
sponse. Specifically, to obtain the ramp response of the transfer-function system G(s),
divideG(s)bysand use the step-response command. For example, consider the closed-
loop system
For a unit-ramp input,R(s)=1/ s^2. Hence
To obtain the unit-ramp response of this system, enter the following numerator and de-
nominator into the MATLAB program:
num = [2 1];
den = [1 1 1 0];
C(s)=
2 s+ 1
s^2 +s+ 1
1
s^2
=
2 s+ 1
(s^2 +s+ 1 )s
1
s
C(s)
R(s)
=
2 s+ 1
s^2 +s+ 1