aa
Section 5–5 / Transient-Response Analysis with MATLAB 191
MATLAB Program 5–5
% ------------- Unit-step response -------------
num = [25];
den = [1 4 25];
t = 0:0.01:3;
[y,x,t] = step(num,den,t);
plot(t,y)
grid
title('Unit-Step Response of G(s)=25/(sˆ2+4s+25)')
xlabel('t Sec')
ylabel('Output')
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3
t Sec
Unit-Step Response of G(s)= 25/(s^2 + 4 s+25)
Output
Figure 5–21
Unit-step response
curve.
Obtaining Three-Dimensional Plot of Unit-Step Response Curves with
MATLAB. MATLAB enables us to plot three-dimensional plots easily. The commands
to obtain three-dimensional plots are “mesh” and “surf.” The difference between the
“mesh” plot and “surf” plot is that in the former only the lines are drawn and in the lat-
ter the spaces between the lines are filled in by colors. In this book we use only the
“mesh” command.
EXAMPLE 5–4 Consider the closed-loop system defined by
(The undamped natural frequency vnis normalized to 1.) Plot unit-step response curves c(t)when
zassumes the following values:
z=0, 0.2, 0.4, 0.6. 0.8, 1.0
Also plot a three-dimensional plot.
C(s)
R(s)
=
1
s^2 + 2 zs+ 1