Matlab Laboratory (ELEC-323) Session III: Second-Order Systems 1. Overview
Matlab Laboratory (ELEC-323) Session III: Second-Order Systems 1. Overview
Matlab Laboratory (ELEC-323) Session III: Second-Order Systems 1. Overview
H ( s) =
K
2
s + 2 n s + n
2
where K is a constant and and n are parameters. The above transfer function represents a generic
second-order system that models many physical systems including parallel or series RLC electric
circuits or spring-dashpot mechanical systems. The above parameters can be related directly to these
circuits and systems. For example, in the case of a parallel RLC circuit, it can be shown that the
denominator of the transfer function is given by
s2 +
which yields, in this case, n =
1
LC
1
1
s+
RC
LC
and =
1
2R
L
C
In this assignment, the objective is to investigate the step response of the above second-order system
as the parameter , known as the damping ratio, and the parameter n , known as the undamped
natural frequency, are varied. Varying these parameters changes the roots of the denominator, i.e.,
complex-plane pole locations of H(s). The objective is to gain an understanding of the relationship
between the step response in the time domain and the pole locations in the s-plane. This will be
accomplished by creating a graphical tool in Matlab that will consist of a sequence of plots of the splane (real and imaginary axes) alongside a corresponding plot of the response of that second-order
system to a unit step input.
2. The Task
To do this assignment, you will again require access to Matlab, which is installed both in ILC-212 as
well as in the Bain facility in Walter Light Hall. You are to design, write, document and debug
and test two Matlab m-files that meet the following specifications:
Part I. The first m-file creates a figure consisting of a sequence of step-response and pole-location
subplots for the transfer function of the above system where K = n = 9 , and n = 3 are kept
2
fixed, while = 3 is varied from 0.1 to 2, in steps of 0.1. The axes of each plot should be labeled
1
appropriately. For an example of an output at a given time, see Figure 1. A list of suggestions and
hints for accomplishing this are provided as follows:
Use subplot to create the two plots within the same figure.
Use the function step to compute the step response of your system. As an example, to
define a system by a transfer function,
1
, you use the Matlab statement
s + 2s + 3
2
To create a plot in the complex plane, you might wish to review the command plot, which
can be called for complex-valued vector x and tic mark o via the arguments
plot( real(x), imag(x), o)
Part II: Repeat Part I, this time creating a new sequence of plots in a second m-file. Again, create a
sequence of plots in a slow animation. However, this time fix = 0.5 while varying n from 0.5 to
20 in steps of 0.5. In order to maintain the same final value for the different plots, the numerator K
must be set to K = n to achieve unity DC gain. You are to submit printouts of your two m-files as
2
well as printouts of the final sets of plots to the TAs within one week after completion of the lab.
Each team submits one report.
3. Interpretation of Results
In addition to printouts of your code and results, based on your findings in Parts I and II above,
describe qualitatively how pole locations affect step response when either or n is varied with
the other parameter fixed.
A final note: In case you are wondering how Matlab computes the step response of a linear timeinvariant system, a more powerful function called lsim is called to solve the differential equation
using a
numerical
integration technique.
Numerical
integration by sampling the time function and creating a sequence of rectangular shaped objects.
The area under a continuous curve is computed as the sum of the areas of these rectangles. For
more detailed information on lsim, type help lsim.
Figure 1: One plot in a sequence of outputs. The left graph depicts the step response for the
leftmost complex-conjugate pair of pole locations. Note that the right-hand plot also retains
previous pole locations on the same graph. The left-hand graph is a plot of the step response
corresponding to the most recently plotted pair of poles.