Professional Documents
Culture Documents
1. Introduction
1.1 Control Systems and Mechanical Vibrations Definitions
This section presents some important definitions for linear control systems and mechanical
vibrations concepts, used throughout the ME 3012 NotesBook. You may be familiar with some these
terms if some are unfamiliar, dont panic, we will discuss them later.
linear system
control
actuator
sensor
controller
PID
PLC
SISO
Single-Input, Single-Output
MIMO
Multiple-Input, Multiple-Output
stability
open-loop
closed-loop
disturbances
model
simulation
Solving the model equations and plotting to predict and display the
dynamic motion of the system.
digital
discrete
Discontinuous values.
analog
continuous
Non-discontinuous values.
Laplace transform
input
output
initial conditions
The values of the output variable and its derivatives at t = 0. There must
be n initial conditions given where n is the system order.
transfer function
characteristic polynomial
poles
zeroes
root locus
A plot in the Re-Im plane demonstrating how the closed-loop poles move
as a controller parameter K is varied from zero to infinity.
frequency response
The plots of system amplitude and phase angle vs. independent variable
input frequency.
degrees of freedom
dynamics
free-body diagram
FBD, a diagram drawn out of context for each separate mass or inertia
with all external and internal forces and moments shown to give context.
cycle
period
cyclical frequency
circular frequency
natural frequency
spring
dashpot
mass
damping
A linear model for energy loss due to friction and other energy dissipaters,
for either translational or rotational motion. Damping is provided by a
virtual viscous dashpot (an automotive shock system is a real example).
amplitude
differential equation
initial conditions
Given values at time t = 0 for the output and its time derivatives. There
must be as many initial conditions as the order of the differential equation.
transient response
homogeneous solution
steady-state response
particular solution
forcing function
damped frequency
linear superposition
if
2)
u1 (t ) y1 (t ) and u2 (t ) y2 (t )
then
u1 (t ) u2 (t ) y1 (t ) y2 (t )
u (t ) y (t )
then
au (t ) ay (t )
homogeneity
if
y ( t ) 2 n y ( t ) n2 y ( t ) u ( t )
u (t )
y 3 (t ) 2 n
y (t ) n2 cos y (t ) ln u (t )
Almost all real-world systems are non-linear due to Coulomb friction, hysteresis, unmodeled dynamics,
non-linear stiffness, large-angle dynamics, etc.
However, many engineering systems have
linear operating ranges, or
equations may be piecewise linearized in various operating regions
Model vs. actual system we use a mathematical model to design the controller, but in the end the
controller will run with an actual system. The controller is a software program, a MATLAB/Simulink
block or blocks, taking sensor feedback from the real world and automatically generating actuator
commands to continuously improve the dynamic performance of the system.
Solve a2
x(t ) a1 x (t ) a0 x(t ) r (t )
for x(t)
Given the input forcing function r(t) and subject to the initial conditions
x(0) x0
.
x (0) v0
homogeneous solution
transient response to ICs
1. Homogeneous Solution
particular solution
steady-state response to input
This method works for ODEs of any order it is demonstrated for the second-order ODE above.
a2
xH (t ) a1 xH (t ) a0 xH (t ) 0
Assume:
x H (t ) Ae st
xH (t ) Ae st
Substitute
x H (t ) sAe st
into
a2
xH (t ) a1 xH (t ) a0 xH (t ) 0
xH (t ) s 2 Ae st
Calculate si the roots of the nth-order polynomial in s (called the system characteristic polynomial)
The general homogeneous solution form must have n terms. For the second-order case:
x H (t ) A1e s1t A2 e s2 t
Substitute the specific si roots at this stage, but leave the Ai coefficients unknown for now (there are n of
each of these, n = 2 in this example).
2. Particular Solution
Assume xP(t) according to the same form as the input forcing function r(t).
Table of Particular Solution Forms
r(t)
xP(t)
constant
different constant
B1t + B2
t2
B1t2 + B2t + B3
D cos t
B1 cos t B2 sin t
Dsin t
B1 cos t B2 sin t
etc.
etc.
xP (t ), x P (t ),
x P (t )
into
a2
xP (t ) a1 x P (t ) a0 xP (t ) r (t )
3. Total Solution
x (t ) xT (t ) xH (t ) xP (t )
Now determine the unknown homogeneous coefficients Ai using the initial conditions on xT(t).
# of characteristic polynomial roots = # of initial conditions = ODE order = n
x(t )
5
e50t 25sin 2t cos 2t
1252
0.08
0.06
0.04
x(t) (m)
0.02
-0.02
-0.04
-0.06
-0.08
-0.1
0
4
t (sec)
= 2 rad/s
= 2f
f = 1/ = 1/T
T = sec
10
Sum-of-angles formulae
sin 2t 25 C cos
cos 2t 1 C sin
C 626 25.02
sin 1
cos 25
1
0.04 rad
25
tan 1
In general:
C B12 B22
B2
B1
tan 1
when
xP (t ) B1 sin 2t B2 cos 2t
C sin 2t
11
A Final First-Order ODE example R, C series electrical circuit (voltage v(t) input, current i(t) output)
R
v(t)
Rq (t )
i (t ) q (t )
Ri(t )
+
-
i(t)
1
i(t )dt v(t )
C
1
q(t ) v(t )
C
Given R = 50 and C = 0.2 mF, solve 50q(t) 5000q(t) 1 subject to q(0) 0 and a unit step voltage
input v(t). Solution
1
1
1 e100t
q (t )
i (t ) q (t ) e100t
5000
50
x 10
-4
q(t)
1.5
1
0.5
0
0
0.01
0.02
0.03
0.04
0.05
0.06
0.01
0.02
0.03
t (sec)
0.04
0.05
0.06
0.02
i(t)
0.015
0.01
0.005
0
0
As expected from the circuit dynamics, the charge q(t) in the capacitor builds up to a constant
given a constant voltage input.
Also as expected, the capacitor current i(t) goes to zero at steady-state.
The steady state charge value is qSS = 1/5000.
The time constant is = RC = 0.01, so at 3 time constants (t = 0.03 sec) both the q(t) and i(t)
values have approached 95% of their respective final values.
12
f(t)
c R ( t ) k R ( t ) ( t )
J, cR
(t)
(t)
J (t ) c R (t ) J (t ) c R (t ) (t )
L, R
(t)
(t)
di(t )
L
Ri(t ) v(t )
dt
R, C
+
v(t)
-
i(t)
1
1
Ri(t ) i(t )dt Rq (t ) q(t ) v(t )
C
C
+
v(t)
-
i(t)
c m cR J L RC
k c k R cR R
1
All first-order ODEs are solved in the same way as Example 1 (assuming a unit step input), all
have the same type of time response graph, all share the same time constant behavior (after three time
constants 3 the output response is within 95% of its final value).
Some first-order system models are given in:
www.ohio.edu/people/williar4/html/PDF/ModelTFAtlas.pdf.
13
s1,2 a bi .
For this example assume s1,2 1 3i as in the Section 2.1.2 ME 3012 NotesBook example.
ei cos i sin
x H (t ) e t A1 A2 cos 3t A1 A2 i sin 3t
Let
B1 A1 A2
B2 A1 A2 i
We can only have real solutions when starting with real ODE coefficients, so A1 A2* (these constants
must be complex conjugates of each other).
Therefore
A1 ARE AIM i
B1 2 ARE
A2 ARE AIM i
B2 2 AIM
x H (t ) e t B1 cos 3t B2 sin 3t
Bi are the real constant unknown homogeneous solution coefficients
And the general underdamped homogeneous solution form given s1,2 a bi is:
x H (t ) e at B1 cos bt B2 sin bt
That is, the real part of the poles is placed in the exponential and the imaginary part of the poles is
placed as the circular frequency of the cos and sin functions.
14
The solution
from the ME 3012 NotesBook may be expressed in an equivalent form, using a single sinusoid (e.g. sin
here; cos is also possible) with phase angle. Clearly the steady-state response 0.30 will not change so
now we will work only on the transient response.
Though this underdamped x(t) solution is unique, there are alternate solution forms that are all
mathematically-equivalent. A second-order system has two-dof, expressed in this solution by a cosine
term and a sine term (two modes), both with the same damped natural frequency d = 3, but of different
amplitudes. An alternate solution form which is mathematically equivalent is found by applying the
following trigonometric identity for sine (the sum-of-angles formula):
A cos 0.05
Asin 0.20
atan2(0.20,0.05) 1.326
where we further used the trigonometric identity cos 2 1 sin 2 1 1 . atan2 is the MATLAB
quadrant-specific inverse tangent function and the result is given in radians. The input to atan2 must
be (num,den) rather than a single ratio as in the atan case.
So the alternate solution form is:
15
subject to
x (0) 0.10m
x (0) 0.05m / s
16
Subject to
1. Homogeneous Solution
x (0) 0.10m
x (0) 0.05m / s
xH (t ) 6 x H (t ) 9 xH (t ) 0
(s2 6s 9) Aest 0
x H (t ) Ae st
Assume
s2 6s 9 (s 3)2 0
Characteristic polynomial
xP (t ) 6 x P (t ) 9 xP (t ) 3
2. Particular Solution
xP (t ) B
0 6(0) 9B 3
so xP (t ) B 1/ 3
3. Total Solution
Plot check transient and steady state solutions, plus total solution.
17
Model
s2 6s 9 (s 3)2 0
Solution
1
3
0.4
0.3
0.2
x(t)
0.1
0
-0.1
-0.2
0
2
t (sec)
The total solution x(t) starts at 0.1 m, x (t ) is non-zero, as specified by the initial conditions.
Transient approaches zero after t = 2.5 sec
Critically damped; 3 root goes to zero slightly faster alone than with t
Steady-state value is xSS = 1/3 m.
18
Model
(no damping)
x(0) 0.10m
x (0) 0.05m / s
s 2 9 ( s 3i)( s 3i ) 0
Solution
19
After we get into Laplace Transforms, we will learn other useful MATLAB functions for ODE solution.
ODE solution via symbolic MATLAB function dsolve
The MATLAB code below shows how to analytically solve first- and second-order ODEs (firstorder ODE Example 1 and second-order ODE Example 3), using MATLAB function dsolve, display
the analytical solution results to the screen, and then plot results using MATLAB function ezplot
(which reverses the input data compared to most MATLAB plot commands).
%---------------------------------------------------% Analytical solution for ODEs using symbolic MATLAB
%
Dr. Bob, ME 3012
%---------------------------------------------------clc; clear;
x1 = dsolve('Dx+50*x=5','x(0)=0');
pretty(x1)
figure;
t1 = [0:0.001:0.16];
ezplot(x1,t1); grid; axis([0 0.16 0 0.105]);
x2 = dsolve('D2x+2*Dx+10*x=3','Dx(0)=0.05','x(0)=0.10');
pretty(x2)
figure;
t2 = [0:0.01:6];
ezplot(x2,t2); grid; axis([0 6 0 0.4]);
20
f (t)
F(s)
tn
e at
1 eat
1
e at
e bt
ab a ( a b) b(b a )
t neat
sin t
s2 2
10
cost
s
s 2
11
e at sin t
12
e at cost
1
s
1
s2
n!
s n 1
1
(s a)
a
s( s a)
1
ab
s ( s a )( s b)
n!
(s a)n1
( s a)2 2
sa
( s a)2 2
21
13
14
16
F(s)
ba
e at cos t
sin t
sb
( s a)2 2
(b a ) 2 2
n
15
f (t)
1 2
e at sin( t )
tan 1
ba
ent sin d t ; d n 1 2 ; 0 1
e nt
1 2
sin(d t ) ; cos 1 ; 0 1
sb
( s a)2 2
n2
s2 2n s n2
n2
s(s 2 2n s n2 )
17
1
eat
sin(t ) ; tan 1
2
2
2
2
a a
a
1
s[( s a)2 2 ]
18
b
1 (b a)2 2 at
e sin(t )
a2 2
a2 2
1
tan 1
tan
sb
s[( s a)2 2 ]
ba
22
We did this ODE solution via the slow ME way and the Laplace Transform method with partial fraction
expansion.
Take the Laplace transform of both sides (dont forget the initial condition but it is given as zero).
5
sX ( s ) x (0) 50 X ( s )
s
5
sX ( s ) 50 X ( s )
s
Solve for the variable of interest, X(s), which is the Laplace transform of the answer x(t).
5
( s 50) X ( s )
s
5
X (s)
s ( s 50)
Up to this point the solution is identical to that in the ME 3012 NotesBook. But now we can skip the
partial fraction expansion if we use the following Laplace Transform table entry.
a
f (t ) 1 e at
F ( s)
s( s a)
We must algebraically modify X(s) so that the same constant a appears in the numerator and
denominator, by multiplying by 1 (10/10).
X ( s)
1 50
10
5
Taking the inverse Laplace transform of X(s) yields the solution x(t).
1 50 1 1 50
x(t ) 1 X ( s) 1
10 s( s 50) 10
s(s 50)
1
x(t ) (1 e50t )
10
This is the same solution obtained twice previously.
23
iL(t)
i(t)
v(t)
-
dv(t ) 1
1
v(t ) v(t )dt i(t )
dt
R
L
Model:
input:
current i(t)
1
dv(t ) 1
C
v(t ) v(t )dt i(t )
R
L
dt
1
1 V ( s)
CsV (s) V (s)
I ( s)
R
L s
1 1
Cs
V ( s) I ( s)
R Ls
G( s)
1
V ( s)
s
I (s) Cs 1 1 Cs 2 1 s 1
R Ls
R
L
24
Define polynomials via an array using square brackets with the numerical polynomial
coefficients given in descending power of s. See denG below.
Define the numerator and denominator polynomials num and den for your transfer function;
then use:
SysName = tf(num,den);
to define the transfer function in MATLAB. You then use the name SysName in various MATLAB
functions that require a transfer function as one of its inputs.
Examples
numG
denG
sysG
G( s)
1
s 2s 8
2
= [1];
= [1 2 8];
= tf(numG,denG);
numGc = [1 1];
denGc = [1 2];
sysGc = tf(numGc,denGc);
numH
denH
sysH
= [1];
= [1 3];
= tf(numH,denH);
GC (s)
s 1
s2
H (s)
1
s 3
25
or
[sysT]=feedback(sys1,sys2,sign)
% close the feedback loop determine T(s)
sys1 = tf(num1,den1);
% transfer function for GC(s) G(s)
sys2 = tf(num2,den2);
% transfer function H(s)
sign: +1 for positive feedback, 1 for negative (the default)
Make sure you can do each of these by hand!
Methods to solve ODEs
Slow ME way, Laplace Transforms
MATLAB dsolve analytical
MATLAB numerical solutions: impulse, step, lsim, ode45
MATLAB functions to numerically solve ODEs
impulse
impulse response of continuous-time linear systems
1. impulse(SysName);
% plots to screen
2. impulse(SysName,T);
% plots to screen, user controls time T
3. [Y,X] = impulse(SysName);
% saves to [Y,X] for plotting later
4. [Y,T,X] = impulse(SysName,T);
% same as 3, user controls time T
where:
SysName=tf(num,den) name for transfer function-based system
num,den
transfer function numerator and denominator
T = [t0:dt:tf];
evenly-spaced, user-supplied time array
Y
output
X
system state ( Y , Y stored column-wise)
step
lsim
26
Y Open
s2 +2s+8
Step U
G Open
Step
Responses
Ydes
s+1
Step Ydes
U Closed
Yact
s+2
s2 +2s+8
Gc
Ysens
Yact
Yact
s+3
H
Open-loop
Closed-loop
See Dr. Bobs on-line MATLAB Primer for a Simulink tutorial to get you started:
www.ohio.edu/people/williar4/html/PDF/MATLABPrimer.pdf
27
3.4 Feedback
Four reasons for using feedback
1. To modify the transient response of the system. We can change open-loop poles to closed-loop
poles with more desirable behavior to ensure stability and modify the system transient
performance.
3. To decrease the sensitivity of the closed-loop system to variations in the open-loop plant transfer
T ( s )
function. Sensitivity is like a derivative
.
G ( s )
Feedback is not free. A closed-loop feedback system is more expensive and complex, and thus
less reliable, than an open-loop system. Therefore, the engineer must determine if closed-loop feedback
control is justified or if the open-loop system can perform adequately.
There are a host of real-world dynamic systems which demand closed-loop feedback control.
28
4. Transient Response
4.1 Second-Order System Damping Conditions
Here is the MATLAB program to create the figure for the example of Section 4.1, comparing the
overdamped, critically-damped, underdamped, and undamped second-order system responses to a unit
step input.
%-------------------------------------------------------------------%
Over-, Critically, Under-, and Undamped cases using step function
%
Dr. Bob, ME 3012
%-------------------------------------------------------------------clear; clc;
num = [1];
denOVER = [1
denCRIT = [1
denUNDR = [1
denUN
= [1
polesOVER
polesCRIT
polesUNDR
polesUN
OVER
CRIT
UNDR
UN
=
=
=
=
=
=
=
=
6
4
2
0
4];
4];
4];
4];
roots(denOVER);
roots(denCRIT);
roots(denUNDR);
roots(denUN);
%
%
%
%
Overdamped
Critically-damped
Underdamped
Undamped
tf(num,denOVER);
tf(num,denCRIT);
tf(num,denUNDR);
tf(num,denUN);
t = [0:0.01:8];
[yOVER,xOVER] =
[yCRIT,xCRIT] =
[yUNDR,xUNDR] =
[yUN,xUN]
=
29
y (t ) 6 y (t ) 4 y (t ) (t )
y (t ) 4 y (t ) 4 y (t ) (t )
Solve
y (t ) 2 y (t ) 4 y (t ) (t )
y (t ) 0 y (t ) 4 y (t ) (t )
y(0) 0
and an impulse input.
y (0) 0
For the impulse responses, solve the same ODEs as the step examples in the ME 3012
NotesBook, subject to zero initial conditions and impulse input (t). Note that though we specified zero
initial conditions y(0) 0 and y(0) 0 , for the impulse responses only the y(0) initial condition can be
satisfied, i.e. all y(0) initial velocities take their own value, different from zero as seen below.
0.4
0.3
Over
Crit
Under
Un
0.2
y(t)
0.1
-0.1
-0.2
-0.3
-0.4
-0.5
0
4
t (sec)
The impulse input final value is 0. Why are the slopes non-zero at t = 0? See Section 4.4 in this
Supplement.
The above figure was generated using the same MATLAB program as given above, but
substituting MATLAB function impulse for step.
30
MATLAB Simulink
MATLAB has a powerful graphical user interface (GUI) called Simulink. From the MATLAB
command window type simulink and you can create and simulate any control system described by
block diagrams and transfer functions. Look around to find the transfer function, step input, and scope
(plot) output blocks. Simply drag and drop the desired block to the Simulink workspace. Double-click
on any block to change its parameters. Connect blocks with lines using the mouse/cursor. Simply press
the play button to run your model. Its fast, fun, and addicting! Make sure you can do the steps by
hand, but you are free to use this tool for homework.
For example, the Simulink diagram below recreates the unit step responses for the overdamped,
critically-damped, underdamped, and undamped second-order system example of Section 4.1. All
transfer functions are fed by the same Step input. The mux, or multiplexer, block is used to compare 4
results in one plot, in this case combining 4 scalar signals to one vector signal, to send to the Plots
scope. The resulting plot is identical in form to that shown in the ME 3012 NotesBook, though the
Simulink graphics do not look as nice.
31
One can simulate the impulse responses in Simulink also. Since there is no Impulse input
block, we must create our own impulse input. There are three possible methods.
1. The Dirac Delta impulse input (t) should have infinite magnitude but infinitesimal duration. It is
normalized in the sense that (t ) 1 , i.e. the area under the curve is 1. One way to approximate the
impulse input (t) is to turn on a step input at t = 0 with a large magnitude M and then subtract from this
step input another of equal magnitude M, starting at time t = 1/M sec, as shown in the figure below. I
have had success with M = 1000 and 10000, among others. Be sure to scope the resulting impulse input
to ensure it is what you intended.
Scope
10
impulse input
s2 +s+10
Step
G(s)
Step dt
du (t )
, where u(t) is the unit step input and (t) is the impulse input. This
dt
concept is implemented in the figure below. It appears that this approach may not work when starting at
t = 0 (it does not generate (t) but gives zero instead). If you start the Simulink simulation at t = 1, it
should work fine. Again, be sure to scope the resulting impulse input to ensure it is what you intended.
2. We know that (t )
Scope
du/dt
Step @ t=1
derivative
10
impulse input
s2 +s+10
G(s)
32
3. Either of the previous two methods work fine. Here is a third method instead of using a discrete
step input as in Method 1 on the previous page, use a steep ramp for a very short time, followed by a
symmetric steep ramp with negative slope to send the input signal back to zero. Again the area under
this steep triangular input must be 1.
Let the final input value be a, the time to rise from 0 to a be called t1, and the final time when the
input signal reaches back to zero be called t2 (by symmetry t2 = 2t1. This type of approximated Dirac
delta input is constructed in Simulink as follows. Add three ramp inputs, the first starting at t = 0 with a
steep positive slope of c = a / t1, the second starting at t = t1 with a negative slope of 2c, and the third
starting at t = t2 with a positive slope of c (see the Simulink model shown below). For example, use a =
1000, t1 = 0.001 sec, c = 1,000,000, and t2 = 0.002 sec. Again, be sure to scope the resulting rampedunramped Dirac delta approximation to ensure it is what you expected. The general equations for this
case are summarized below:
a ct
1
2 at 1
2
1
t
a
t
1
c
33
This
Ramped-step input
The unit step input is very popular and common in the controls field. Actually it is a poor input
signal in the real world because no dynamic system can change its value instantaneously to match what
the unit step input is demanding. Instead, a ramped-step input may be better for real-world systems to
follow. The ramped-step input signal starts at zero (not instantaneously starting at a constant value) and
linearly changes, with constant slope, to a final constant value, which is held as long as the simulation
proceeds. Let the final input value be a, and the time to rise from 0 to a be called t1. This general
ramped-step input may be constructed in Simulink as follows. Add two ramp inputs, the first starting at
t = 0 with a positive slope of c = a / t1, and the second starting at t = t1 with a negative slope of c (or,
equivalently, subtract the second ramp with a positive slope as shown in the Simulink model below).
The example shown assumes a = 3 and t1 = 2 sec. be sure to scope the resulting ramped-step to ensure it
is what you expected.
Scope
ramped-step input
Ramp
Ramp @ t1
34
Step and ramped-step inputs work well for controlling position variables (either translational or
rotational). They also work for controlling velocity when that is the output of interest. However, many
projects may need to move positions based on velocity control. In these cases consider using a
trapezoidal step input, which is similar to the ramped-step, but turns off rather than holding a constant
value indefinitely.
Trapezoidal-step input
The trapezoidal-step input signal starts at zero, linearly changes with constant slope to a final
constant value, which is held for a specified time. Then the input signal linearly decreases in a
symmetric manner back to zero, which is held as long as the simulation proceeds. Let the final input
value be a, the time to rise from 0 to a be called t1, the time to start the linear decrease back to 0 be
called t2, and the final time when the input signal reaches back to zero be called t3 (by symmetry t3 t2 =
t1. This general trapezoidal-step input is constructed in Simulink as follows. Add four ramp inputs, the
first starting at t = 0 with a positive slope of c = a / t1, the second starting at t = t1 with a negative slope
of c, the third starting at t = t2 with a negative slope of c, and finally the fourth starting at t = t3 with a
positive slope of c (see the Simulink model shown below). The example shown assumes a = 1, t1 = 2, t2
= 6, and t3 = 8 sec. Again, be sure to scope the resulting ramped-step to ensure it is what you expected.
35
The example trapezoidal-step velocity input is shown in magenta in the plot above. Integrating
this desired signal yields the associated position command. Since the controlled velocity returns to zero,
the associated position can be controlled to move from one displacement to another. This applies
equally to translational or rotational velocity/position.
Assuming the example trapezoid-step represents angular velocity (t), the associated final
angular displacement F is:
1
2
2
F 0 ct1 2at1
1
2
where in the example above, initial angle 0 = 0 and by symmetry t1 = t3 t2. Further we chose
t2 t1 2t1 (this can be changed by the user). Since the slope is c = a / t1, the above equation simplifies
to:
t1
F 0
3a
Using the above equation, one can specify the initial and final angles (or translational positions), plus the
constant velocity term a, and solve for t1 and construct any desired trapezoidal-step velocity input like
the example above.
36
n = 0.1
25
tR (sec)
20
15
10
5
0
0.1
0.2
0.3
0.4
0.5
(unitless)
0.6
0.7
0.8
0.9
2.5
tR (sec)
n = 1
n = 10
1.5
n = 100
1
0.5
0
0
0.1
0.2
0.3
0.4
0.5
(unitless)
0.6
0.7
0.8
0.9
37
38
39
The ME 3012 NotesBook presented a fast and easy method for MATLAB to display the rise time
tR, peak time tP, percent overshoot PO, and settling time tS for any given step response. This rightclicking in a step window is accurate for any order and type of system since MATLAB applies the
rules to calculate these results numerically, rather than applying the generic-second-order-system-only
equations.
This section presents an alternative MATLAB function to obtain the same information. The
drawback is there is no graphical output in this case, but then more information is given. We now
demonstrate this approach for the same example from the NotesBook.
num = [10];
den = [1 0.5 10];
Sys = tf(num,den);
stepinfo(Sys);
The result of this piece of m-code is a structure with the following data:
RiseTime:
SettlingTime:
SettlingMin:
SettlingMax:
Overshoot:
Undershoot:
Peak:
PeakTime:
0.3505
15.1295
0.3924
1.7795
77.9467
0
1.7795
0.9966
These answers agree well with the results presented earlier in the ME 3012 NotesBook. The
familiar rise time tR, peak time tP, percent overshoot PO, and settling time tS are given on lines 1, 8, 5,
and 2 above, respectively.
The additional information given is as follows (from help stepinfo in MATLAB):
SettlingMin:
SettlingMax:
Undershoot:
Peak:
This extra information is rather redundant in this example; the SettlingMax value is identical to the
Peak value, both of which were already known from percent overshoot PO.
Two items are new and potentially interesting: SettlingMin gives the value of the lowest
valley, which is directly following the maximum peak, and the Undershoot value gives the percent
undershoot (negative from zero) relative to the final value. Refer to the ME 3012 NotesBook to see that
these values of 0.3924 and 0, respectively, are correct for this example.
See also: lsiminfo.
40
In the ME 3012 NotesBook, to specify good behavior for the closed-loop controller, all we have
are underdamped performance specification equations. Many real-world controllers can benefit from
critically-damped or overdamped performance specifications. This original work is presented below.
For the critically-damped and overdamped cases, percent overshoot is zero and peak time is
infinite. Generally settling time is more important than rise time so this work will focus only on settling
time. We cannot use the underdamped equation for calculating 2% settling time for the criticallydamped and overdamped specifications. However, the definition for settling time is identical (the time
at which the critically-damped or overdamped response crosses the 98% line of the final value for a
unit step response. Using MATLAB step and right-clicking on the resulting plot can easily calculate the
settling time numerically this is the approach followed here.
For the critically-damped case, s1 = s2 (both poles are negative, real, and identical). There are
infinite overdamped cases; here we use s2 = 2s1 (both poles are negative and real). All poles must be
negative for stability, but the plots below show positive s1 for convenience of viewing the data
represents only negative poles.
For various pole values in the critically-damped case the settling time is found numerically using
MATLAB step and right-clicking in the plot (Characteristics Settling Time). The settling time tS vs.
pole s1 plot is shown below. The same data was entered in Excel and the best exponential curve fits
were found to be:
Critically-Damped
t S ( s1 )
5.83
s1
Overdamped
R2 1
t S ( s1 )
4.6
s1
R2 1
It was found that including s1 values less than 1 made for worse curve fitting; therefore the curve
fits reported above are only for 1 s1 10 and the table below reports discrete settling time results for
s1 1 , for completeness. Again the overdamped case uses s2 = 2s1. The two R2 values indicate that
these are perfect curve fits.
s1
0.25
0.50
0.75
tS (critically-damped)
23.30
11.70
7.78
tS (overdamped)
18.40
9.20
6.14
The two plots below present settling time results for the critically-damped and overdamped
cases, respectively. To use these results for specifying good behavior in controller design, one can
specify the desired settling time, choose critically-damped or overdamped, and solve for s1 from the
appropriate best curve fit equation above (or try to read the s1 value from the appropriate plot). Once s1
is known, use s2 = s1 for the critically-damped case and s2 = 2s1 for the overdamped case. If you desire a
different type of overdamping, you can use trial-and-error.
41
For all design cases, be sure to evaluate the expected dynamic response over time for your
desired behavior to ensure it agrees with what you specified (in terms of settling time and 0%
overshoot).
6
5
critically-damped
overdamped
tS (sec)
0
1
s1
10
42
y (t ) 2 y (t ) 4 y (t ) 4u (t )
subject to y (0) 0, y (0) 0 and a unit step input.
Open-Loop Behavior
n2
4
G(s) 2
2
2
s 2n s n s 2s 4
Open-loop characteristic polynomial OL(s), natural frequency n, dimensionless damping ratio ,
damped frequency d, and poles s1,2 (complex conjugate poles with negative real part, therefore this
system is underdamped):
0.5
n 2
OL ( s ) s 2 2 s 4
d 3
s1,2 1 i 3
yo(t)
0.8
0.6
0.4
0.2
0
0
3
t (sec)
1
ySSOL lim y (t ) lim sY ( s ) lim sG ( s )U ( s ) lim s 2
lim 2
1
t
s 0
s 0
s 0
s 2 s 4 s s 0 s 2 s 4 4
43
4K
40
2
s 2 s 4 4 K s 2 s 44
2
n 6.63
CL ( s ) s 2 2 s 44
0.15
d 6.56
s1,2 1 6.56 i
Open-loop
Closed-loop
y(t)
0.5
0
0
3
t (sec)
The MATLAB m-file to generate this plot is given later in this section.
Closed-loop ySS use the final value theorem (FVT)
40
40
40
1
ySSCL lim y (t ) lim sY ( s ) lim sT ( s) R ( s) lim s 2
0.909
lim
2
t
s 0
s 0
s 0
s
0
s 2s 44 44
s 2s 44 s
44
Steady-state error
Let us assume that the steady-state value ySS of the open-loop system is the desired output value.
We calculate the steady-state error of the closed-loop system relative to the desired open-loop value.
ySS ySSCL
eSS OL
100%
ySSOL
40
44 100% 9.1%
1
Summary
Choosing a random simple controller made the step response worse than the original open-loop
case! Controller design must be done properly or things can easily get worse.
For G C ( s ) K 10 , the closed-loop system is more underdamped than the open-loop
system: the rise and peak times are much faster (not necessarily good for the dynamics of the system),
the percent overshoot is much worse, the settling time turned out to be about the same, and a steadystate error was introduced. The steady-state error arose because the controller introduced a virtual
spring, in addition to the existing spring in the open-loop system, making the closed-loop system stiffer,
resulting with a smaller displacement given the same unit step input force.
Simulink Simulation
The MATLAB Simulink diagram below recreates the previous plot comparing the open- and
closed-loop systems for the current example.
Two new blocks are used, the circular summing junction and the triangular gain (representing the
simple proportional controller). More complex controllers can be represented by transfer functions as
we will see later. The feedback loop takes the closed-loop system output back to the summing junction.
The mux block (two signals into one above) allows us to compare both results on one scope (Plots).
Both open- and closed-loop simulations use the same Step input for a fair comparison (pickoff point).
If we choose a final simulation time of 6 sec (entered via the time box on the simulation window
menu), the Simulink plots are identical to that shown earlier.
45
Here is the MATLAB program to create the figure for the example of this section, comparing the
open- and closed-loop system responses to a unit step input.
%--------------------------------------------%
Open-loop/Closed-loop Example
%
Dr. Bob, ME 3012
%--------------------------------------------clear; clc;
%
Open-loop unit step response
numo = [4]; deno = [1 2 4];
SysO = tf(numo,deno);
zeroso = roots(numo); poleso = roots(deno);
[wno,zetao] = damp(deno);
t = [0:0.01:6];
yo = step(SysO,t); % Open-loop unit step response
%
Closed-loop
K = 10;
% Simple proportional controller
numc = [4*K]; denc = [1 2 4+4*K];
SysC = tf(numc,denc);
zerosc = roots(numc); polesc = roots(denc);
[wnc,zetac] = damp(denc);
yc = step(SysC,t); % Closed-loop unit step response
%
Check hand-derivation of T(s)=[numc/denc] via MATLAB
numgc = [K];
dengc = [1];
[numa,dena]
= series(numgc,dengc,numo,deno);
[numc2,denc2] = feedback(numa,dena,[1],[1]);
TCheck = tf(numc2,denc2)
% Display T(s) check results
%
Plot open- and closed-loop step responses
figure;
plot(t,yo,'r',t,yc,'g');
set(gca,'FontSize',18); legend('Open-loop','Closed-loop');
axis([0 6 0 1.5]);
grid; ylabel('\ity(t)'); xlabel('\itt (\itsec)');
%
wdo
tro
tpo
poo
tso
%
%
%
%
%
%
wdc
trc
tpc
poc
tsc
%
%
%
%
%
%
Right-click for performance specs: open- and closed-loop
figure; step(SysO); grid;
figure; step(SysC); grid;
46
c1
c2
Im
c4
c3
Re
c3
x
c4
c1
x
c2
Recall for underdamped poles the polar representation is r = n and sin 1 ; thus the two symmetric
angles in the examples above are 5.7 and 30 .
Also, remember all complex conjugates occur in pairs, as shown above (two poles generate one
time response plot in all second-order cases, including the non-complex-conjugate cases).
47
We can also perform the example of Section 4.4 using the impulse function in place of the
step function; this is shown below.
Transient Response Characteristics vs. Re-Im-plane pole locations
(impulse responses, generic second-order system, zero initial conditions)
Figure key
0 .5 n 2
s1,2 1 173
. i
01
. n 2
0 n 2
01
. n 2
c1. underdamped
0.5 n 1
s1,2 0.5 0.866i
c2. underdamped
01
. n 1
s1,2 01
. 0.995i
d1. undamped
0 n 1
s1,2 i
e1 .
c3. underdamped
2 n 1
s1,2 373
. ,0.27
c4. underdamped
1 n 1
s1,2 1
d2. undamped
0 n 0
s1,2 0
a. overdamped
b. criticallydamped
d3. special
undamped
s1,2 2i
1.5
1.5
1.5
0.5
0.5
0.5
-0.5
-0.5
-0.5
-1
-1
-1
-1.5
-1.5
-1.5
-2
10
15
20
-2
10
15
20
-2
1.5
1.5
1.5
0.5
0.5
0.5
-0.5
-0.5
-0.5
-1
-1
-1
-1.5
-1.5
-1.5
-2
10
15
20
-2
10
15
20
-2
01
. n 1
s1,2 01
. 0.995i
e2 .
1(-1.005)
n 1 ( n 0.99 )
s1,2 1 (0.9,1.1)
f. (g.)
100
50
-50
10
15
20
-100
10
15
20
10
15
20
10
-5
10
15
20
-10
1.5
1.5
0.5
0.5
-0.5
-0.5
-1
-1
-1.5
-1.5
-2
-2
10
15
20
20
16
x 10
14
15
f
g
12
10
10
8
6
4
2
10
15
20
10
15
20
10
15
20
Note While cases f and g may look identical between the step (ME 3012 NotesBook) and impulse (this
page) responses, they are different the impulse responses go to infinity faster than the step cases.
48
Here is the MATLAB program to create the figure for the example of Section 4.4, comparing the
various second-order system transient responses to a unit step input, based on pole locations. To find
the impulse responses of the previous page, simply substitute MATLAB function impulse for step.
%--------------------------------------------------------------------%
%
%
y = step(num,den,t);
subplot(3,4,12);
zeta = -1;
wn = 1; num = [wn^2]; den = [1 2*zeta*wn wn^2]; yf = step(num,den,t);
zeta = -1.005; wn
= sqrt(0.99); num = [wn^2];
den = [1 2*zeta*wn wn^2]; yg = step(num,den,t);
plot(t,yf,'b',t,yg,'g'); legend('f','g'); axis([Xmin Xmax 0 16e09]);
49
For the impulse response transient characteristics plots presented two pages back, no initial
conditions were specified in the MATLAB program, which means that MATLAB assumes zero initial
conditions. We can see zero initial condition on position are achieved in all of the plots. However, none
of these impulse response plots has a zero slope at t = 0, which means that the impulse response cannot
allow zero velocity initial condition. Why? Let us address this issue via an example.
Example analytical impulse response solution for the generic second-order system
y(0) y0 0
y (0) v0 0
Here the Laplace Transform method will be used. The first step is to take the Laplace Transform
of both sides of the ODE, including the zero initial conditions, and solving algebraically for the
unknown in the Laplace domain, Y(s) {y(t)}.
y(t ) 2n y (t ) n2 y(t ) n2 (t )
( s 2Y (s) sy(0) y (0)) 2n ( sY ( s) y(0)) n2Y (s) n2 (1)
( s 2 2n s n2 )Y (s) n2
Y ( s)
n2
s 2 2n s n2
Note that the system characteristic polynomial s2 2n s n2 appears when using the Laplace
Transform method.
For simplicity in solution, let us assume this system is overdamped, i.e. there are two negative,
real, distinct poles (our impulse response conclusion will apply to all damping cases).
Y ( s)
n2
n2
s 2 2n s n2 (s s1 )(s s2 )
Y ( s)
(s s1 )(s s2 ) (s s1 ) (s s2 )
Solving for the residues C1 and C2:
n2
0s n2
C1
C2
C (s s2 ) C2 (s s1 )
(s s1 ) (s s2 )
(s s1 )(s s2 )
(s s1 )(s s2 ) (s s1 )(s s2 )
50
C1
s1 C1 C2 0
s C1s2 C2 s1
0
2
n
C2
n2
s2 s1
n2
s1 s2
y(t ) 1 Y ( s)
n2
y(t )
( s s1 )( s s2 )
1
C1
C2
y(t ) 1
( s s1 ) ( s s2 )
y(t ) C1e s1t C2e s2t
Checking the zero initial conditions from this solution, it is seen that the initial position is zero,
but the initial velocity is NOT zero:
n2
s2 s1
n2
s1 s2
n2
s2 s1
n2
s2 s1
0
y (t ) s1C1e s1t s2C2e s2t
y (0) s1C1e s1 (0) s2C2e s2 (0) s1C1 (1) s2C2 (1)
s1
n2
s2 s1
s2
n2
s1 s2
s1
n2
s2 s1
s2
n2
s2 s1
( s2 s1 )n2
s2 s1
n2 0
The impulse responses for all other damping cases similarly result in non-zero initial velocities
(slopes of y(t) at t = 0).
51
s ( s p1 )( s p 2 ) ( s p n ) U ( s )
r is the System Type, i.e. r is the number of poles at s = 0. The System Type is the number of system
integrators. This section presents transient response characteristics for example Type 0, I, and II
systems.
Example Transfer Functions G(s) for different System Types
Type 0
1
( s 1)
10
G( s) 2
( s s 10)
G ( s)
Type I
1
G( s )
s
1
G (s)
s ( s 1)
10
G( s)
2
s( s s 10)
Type II
1
G( s) 2
s
1
G( s) 2
s ( s 1)
10
G( s) 2 2
s ( s s 10)
Example Unit Step Responses (output y(t) vs. time, 0 ICs) for different System Types
Type 0
Type I
Type II
52
Type I, II, and higher systems have no effective spring, so their transient responses go to infinity.
The steady-state results are constant, linear, and parabolic for Types 0, I, II, respectively.
Analytical Unit Step Response Solutions for the System Types examples above
Type 0
y (t ) 1 e t
Type I
Type II
y (t ) t
t2
y (t )
2
y (t ) e t t 1
t2
y (t ) e t 1
2
t
y (t ) t
1 1 0.5t
e (cos 3.12t 3.04sin 3.12t )
10 10
y (t )
t2 t
9
9 0.5t
For the y(t) solutions summarized in the above table, what is the transient solution in each case?
The steady-state solutions?
System Order, Poles, and Stability Conditions for the System Types examples above
Type 0
first
s1 1
stable
second
s1,2 0.5 3.12i
stable
Type I
first
s1 0
marginally-stable
second
s1 0 s2 1
marginally-stable
third
s1 0 s2,3 0.5 3.12i
marginally-stable
Type II
second
s1 s2 0
marginally-stable
third
s1 s2 0 s3 1
marginally-stable
fourth
s1 s2 0 s3,4 0.5 3.12i
marginally-stable
Note that the natural frequency n and the dimensionless damping ratio , defined for the generic second
order system, have no meaning for Type I or II systems (other than as modes in the third line above).
The first Type 0 example is typical of a stable first-order system step response. The second Type
0 example is typical of a stable underdamped second-order system step response. The top Type II
example was previously identified in the ME 3012 NotesBook as case d3, the special undamped case
with s1 s2 0 .
53
The middle Type I example is typical of an electric motor model with input torque (t), output
1
, where J is the motor shaft/load mass moment of
angle (t), and transfer function G ( s )
s ( Js cR )
inertia and cR is the rotational viscous damping coefficient. A distributed block diagram explicitly
shows the angular-velocity-to-angle integrator in this system:
Since only two of these ODEs are familiar in our previous analytical ODE solutions in ME 3012
(the stable first- and stable underdamped second-order systems), let us perform an analytical solution for
one example: the second-order Type I system from above. Solve
Assume:
y H ( t ) Ae
st
so that
y H (t ) sAest
yH (t ) s 2 Aest
54
2. Particular Solution
yP (t) yP (t) u(t) 1
Our standard particular solution assumption of yP (t) B will not work in this case so we immediately
try:
yP (t) B
where B is an unknown constant, which must be determined in this step. Clearly yP (t) 0 and so:
yP (t) yP (t) 0 B 1
And so the particular solution for velocity is yP (t) B 1. However, we need the particular solution for
y(t), not its first derivative, and so we must integrate:
t
yP (t) yP (t)dt dt t c
where c is a constant of integration, in this case left unknown until Step 3.
3. Total Solution
y (t ) y H (t ) y P (t ) A1 A2 e t t c
An alert student may ask, how can we solve for three constants A1, A2, and c with only two initial
conditions? The solution to this little dilemma is quite easy, recognizing that A1 c is simply a single
constant, call it A3 A1 c . Then the total solution is expressed by:
y (t ) A3 A2 e t t
to which we apply the two given initial conditions y(0) 0 and y(0) 0 in order to solve for the
unknown constants A1 and A3.
y (0) 0
y(0) 0
0 A3 A2e (0)
(0)
y (t ) A2 e t 1
A2 A3 0
0 A2e(0) 1
1 A2 0
A2 1
55
Detailed Plot for Center Type I System Example Unit Step Response
Transient, Steady-State, and Total Responses
56
In order to check this solution, we can first check the resulting initial conditions. From the
solution y (t ) e t t 1 we clearly see that y (0) e0 0 1 1 0 1 0 as required. Also, for the
first derivative of the solution y (t ) e t 1 , we have y (0) e0 1 1 1 0 as required.
A more complete solution check involves substituting the solution y(t) and its two time
derivatives into the original ODE and prove than an equality results.
y (t ) e t t 1
y (t ) et 1
y (t ) e t
et et 1 1
Since an equality results, 1 = 1, this proves that the solution is the correct one.
57
A clever alternate solution method arises (either the Slow ME Way or using Laplace Transforms)
when we use the equivalence v(t) y(t) in the original ODE to be solved. Solve
1. Homogeneous Solution
vH (t) vH (t) 0
Assume:
v H ( t ) Ae st
so that
vH (t ) sAe st
The system characteristic polynomial is s1, leading to a system characteristic equation s1 0, whose
one root is s1 1 . The homogeneous solution form is then:
v H ( t ) A1e s1t A1e t
2. Particular Solution
3. Total Solution
v (t ) v H (t ) v P (t ) A1e t 1
Applying the given initial condition v(0) y(0) 0 in order to solve for the unknown constant A1:
58
v(0) 0
(0)
0 Ae
1
1
A1 1
59
1
s 2Y ( s) s(0) (0) sY (s) (0)
s
Combine Y(s) terms on the left.
( s 2 s )Y ( s ) s ( s 1)Y ( s )
1
s
Solve for the variable of interest, Y(s) the Laplace transform of the answer, y(t).
1
Y (s) 2
s ( s 1)
The partial fraction expansion for this Y(s) is given below, where the constants C1,2,3 are the residues.
C
1
C sC
1 2 2 3
Y (s) 2
s ( s 1)
s
s 1
Express the partial fraction form over a common denominator.
(C s C2 )( s 1) C3 s 2 (C1 C3 ) s 2 (C1 C2 ) s C 2
C
C sC
1
1 2 2 3 1
Y (s) 2
s ( s 1)
s
s 1
s 2 ( s 1)
s 2 ( s 1)
Equate like powers of s in the numerator to get 3 equations to solve for the residues C1,2,3.
C1 1
s 2 0 C1 C3
s1 0 C1 C2
C2 1
C3 1
s 0 1 C2
s 1
s
s
s 1
s
y (t ) 1 t e t
which agrees with the solutions we previously derived, but as expected is a more-direct one-stage
process and faster to obtain.
60
V to ThetaL
V to OmegaL
t0 = 0; dt = 0.005; tf = 0.8;
t = [t0:dt:tf];
figure;
subplot(321);
[y,x] = impulse(Syst,t);
%
plot(t,y); grid; axis([0 0.8 0 0.008]);
impulse
subplot(322);
[y,x] = impulse(Sysw,t);
plot(t,y); grid; axis([0 0.8 -0.1 0.15]);
subplot(323);
%
[y,x] = step(Syst,t);
plot(t,y); grid; axis([0 0.8 0 0.004]);
step
subplot(324);
[y,x] = step(Sysw,t);
plot(t,y); grid; axis([0 0.8 0 0.008]);
subplot(325);
[y,x] = lsim(Syst,t,t);
% unit ramp input u(t) = t
plot(t,y); grid; axis([0 0.8 0 0.0016]);
subplot(326);
[y,x] = lsim(Sysw,t,t);
plot(t,y); grid; axis([0 0.8 0 0.004]);
61
We can extend the Term Example transient responses example from ME 3012 NotesBook
Section 4.7 for one more input (the unit parabola, p(t ) t 2 2 ) and one more output (L(t), the angular
acceleration of the load shaft).
Figure key
L(t) impulse
L(t) impulse
L(t) impulse
-3
x 10
5
0.1
6
4
2
0
4
0x 10-30.2
0.4
0.6
0.8
-0.1
8
0x 10-30.2
0.4
0.6
0.8
0.2
0.4
0.6
0.8
0x 10-30.2
0.4
0.6
0.8
0x 10-30.2
0.4
0.6
0.8
0.4
0.6
0.8
0.1
6
2
-5
2
0
0x 10-30.2
0.4
0.6
0.8
0
4
1.5
0x 10-30.2
0.4
0.6
0.8
8
6
0.5
0
-0.1
2
0x 10-40.2
0.4
0.6
0.8
0x 10-30.2
0.4
0.6
0.8
1.5
1
0.5
0
0.2
0.4
0.6
0.8
0.2
0.4
0.6
0.8
0.2
62
Usually the electrical system time constant L/R is small relative to the mechanical system time
constant JE/cE. This means that when voltage vA(t) is applied to the armature circuit, the armature
current iA(t) rises much faster than the motor shaft angular velocity M(t) does (see the figure below)
when iA(t) is applied to generate motor torque M(t) . Here are the component first-order transfer
functions and time constants for the armature circuit and rotational mechanical system dynamics.
G1 ( s )
L
0.1
R
I A (s)
1
VA ( s ) VB ( s ) Ls R
G3 ( s )
M (s)
1
M ( s ) J E s cE
JE
1
cE
Output
0.8
0.6
0.4
0.2
0
0
t (sec)
armature current
Therefore, the electromechanical system open-loop block diagram transfer function could be
simplified as follows. For VA(s) input, L(s) output, the open-loop transfer function is:
KT
KT
R
G ( s)
( Ls R)( J E s cE ) KT K B sn L s 1 ( J s c ) KT K B sn
E
E
R
R
L
J
to zero relative to the mechanical system time constant E
R
cE
G ( s )
KT
R
KT K B
( J E s cE ) R sn
63
The simplified VA(s) input, L(s) output transfer function is second-order and the simplified VA(s) input,
L(s) output transfer function is first-order.
KT
n
G ( s )
J E Rs ( RcE K T K B ) s
KT
n
G ( s )
J E Rs ( RcE K T K B )
64
5. Controller Design
5.1 Controller Design Introduction
Controller Types
1. Proportional
GC ( s ) K
Root locus method
This is the simplest controller, but it only has one-dof (one gain).
2. Lead controller
GC (s) K
(s a)
(s b)
3. Lag controller
GC (s) K
(s c)
(s d)
4. Lead/Lag controller
GC (s) K
(s a)(s c)
(s b)(s d)
This controller improves the steady-state error without reducing the desired n much. Also does
not affect the desired .
5. PID controller
GC ( s) K P
KI
KDs
s
According to some controls references, the D term is not implementable because we cannot build
physical systems with more zeroes than poles (MATLAB tfchk generates an error when you enter the
65
PID transfer function over its common denominator). Also, when the system is subjected to a unit step
input from rest, the D term differentiates the step and creates an impulse. However, Simulink and
industrial controllers implement full PID controllers successfully.
Again, our controller design is in the s domain. Digital controller implementation, an important
real-world issue so that a computer can perform the control given the controller design from the s
domain, is beyond the scope of ME 3012. The above control law must be implemented at every control
time step, so the actuator input u(t) is constantly calculated by the controller to achieve the goals.
When the number of controller unknowns equals the order of the closed-loop system we will use
denominator parameter matching to design the controller (solve the unknown controller gains). If this
condition is not met, we can use rules of thumb, trial and error, and the root-locus method to design the
controller.
feedback
rlocus
draw the root-locus plot for the system with a proportional controller
rlocfind
rltool
roots
series
sgrid
tf2zp
zp2tf
66
For controller design, how should we choose good behavior? One must specify good poles as an
input to the controller design process. Thus far we have specified an exact desired percent overshoot
(yielding an exact ) and an exact settling time (yielding an exact n knowing from PO), from which
the desired behavior characteristic polynomial is s 2 2 n s n2 , from which the desired closed-loop
poles can be found.
A much more general and powerful method for specifying good controller behavior (desired
closed-loop poles) is to specify inequalities for performance specifications rather than exact values. In
this example we require t P 2 sec, PO 5% , and t S 4 , and the problem is to determine and show on
the Re-Im plane acceptable regions for the closed-loop controller poles given these three simultaneous
inequality constraints.
a. From tP
n 1 2
2
d
we have d 2 rad/sec (by symmetry, also d 2 rad/sec).
b. From PO 100e
1 2
5%
c. From tS
we have n 1 , that is n 1
Let us plot all three constraints on the Re-Im plane; we get three straight-line constraints, two of
them symmetric about the Re axis. Then we shade the acceptable side of each constraint line.
67
Im
Re
To satisfy the inequality requirements on the performance specifications, one may choose two
symmetric underdamped complex-conjugate poles anywhere in the shaded regions. The peak time and
percent overshoot specifications dominate and the settling time constraint is not active.
68
These are competing requirements. How should we choose the desired poles for the closed-loop
system controller design? Try performance indices many cases have been solved to tell you the
optimal poles given various performance measures (indices). Here we will only consider one, the
integral of time multiplied by the absolute error (ITAE).
ITAE t e(t ) dt
0
Minimize ITAE to simultaneously optimize competing requirements. Minimum ITAE means less
time and smaller error in balance. For first- through sixth-order systems, the following characteristic
polynomials minimize ITAE. If we design the feedback controller to meet one of these specifications,
the shaping of the dynamic transient response will be optimized according to ITAE. The engineer must
set the value for n to suit the time nature of the desired closed-loop system. Note for all cases (except
the first order system) some overshoot is required to optimize ITAE. We simulate with MATLAB to see
this (using n = 3 rad/s for all plots below).
Order
1
2
3
4
5
6
s 2 1 .4 n s n2
s 3 1 .7 5 n s 2 2 .1 5 n2 s n3
s 4 2 .1 n s 3 3 .4 n2 s 2 2 .7 n3 s n4
s 5 2 .8 n s 4 5 .0 n2 s 3 5.5 n3 s 2 3 .4 n4 s n5
s 6 3 .2 5 n s 5 6 .6 n2 s 4 8 .6 n3 s 3 7 .4 5 n4 s 2 3 .9 5 n5 s n6
1.4
1.2
1
y(t)
0.8
0.6
1st
2nd
3rd
4th
5th
6th
0.4
0.2
0
0
2
t (sec)
69
2a.
G(s)
s2
s ( s 4)
2b.
G ( s)
s 1
s 1
2
3
s( s 2)( s 4)
s( s 10s 2 32s 32)
2c.
G (s)
s 1
s 1
2
s ( s 2)( s 3) s ( s 5s 6)
2d.
G(s)
1
s ( s 12 s 64 s 128)
2e.
G (s)
s 2 14 s 96
s 2 ( s 14)
2f.
G(s)
( s 2 4s 10004)( s 2 12 s 90036)
( s 10)( s 2 2 s 2501)( s 2 6 s 22509)
70
Example 3
The unit step responses for Root-Locus Example 3 from the ME 3012 NotesBook are shown
below, as K increases. Clearly we need a method for determining K to yield a desirable closed-loop
system.
Step Response
Step Response
Step Response
20
15
0.5
10
Amplitude
Amplitude
Amplitude
5
0
-0.5
0
-5
-10
-15
-1
-5
Time (sec)
-20
1.5
1.5
0.5
Amplitude
1.5
0.5
Step Response
1.5
Amplitude
1.5
Amplitude
1.5
0.5
Time (sec)
Step Response
2
Step Response
2
Time (sec)
Time (sec)
0.5
0.5
Time (sec)
Step Response
2
Step Response
2
Time (sec)
Amplitude
Amplitude
Time (sec)
Step Response
Amplitude
0.5
Time (sec)
Time (sec)
0
0.40
2.73
0.01
1.03
3.20
0.07
1.96
6420
71
s1,2 n n 1 2 i n d i
( 0 1)
Further recall the graphical representation of these underdamped s1,2 pole locations (derived earlier in
the ME 3012 NotesBook, this is symmetric as shown below). We measure with the right hand from
the positive vertical (by symmetry, measure with the left hand from the negative vertical).
Im
-5
-5
0
Re
The radial distance is n and sin 1 . We can use MATLAB to create n, grids on the root-locus
plot. This sgrid result is shown above and is symmetric about the Re axis.
dmp = [0:0.1:1];
om
= [1:1:5];
sgrid(dmp,om);
Also, we can add vertical lines to the left of zero for lines of constant settling time (i.e. constant
n) and symmetric horizontal lines for lines of constant peak time (i.e. constant d n 1 2 ).
Put your root-locus plot on the same figure.
hold on;
rlocus(Sys);
[K,poles] = rlocfind(Sys)
Be sure the root-locus figure is active (if there are other MATLAB graphics figures on the
screen). The MATLAB window gives you a cross-hair cursor with which to select a point on the rootlocus plot. Choose a point where the root-locus plot intersects a desirable n, or other desirable pole
specification. MATLAB responds with the K value and associated poles.
For controller design, check out rltool, very powerful and cool! rltool has built-in grid
tools for two of the generic second-order system performance specifications (settling time and percent
overshoot), plus and n: right-click design requirements new.
72
tP = 1.01 s
PO = 165.4%
tS = 8 s
These transient characteristics are all BOGUS since they are calculated based on the underdamped,
positive damping, performance specification equations. The open-loop unit step response is:
100
50
y(t)
-50
-100
-150
0
5
t (sec)
10
When we use MATLAB function step for this problem and right-click for the performance
specifications, no useful results are generated.
PID Controller
GC ( s) K P
KI
KD s
s
73
Given G( s)
10
K
, H(s) = 1, CLDES ( s ) s 3 32 s 2 157.2 s 398.2 , GC ( s) K P I K D s
s s 10
s
2
Solve for the PID controller gains KP, KI, and KD. Then evaluate the PID controller performance.
Step 5. Solve for the unknown gains to achieve the desired behavior for the closed-loop system.
Derive the closed-loop transfer function as a function of the PID controller gains.
10( K D s 2 K P s K I )
10( K D s 2 K P s K I )
GC ( s )G ( s )
s ( s 2 s 10)
s ( s 2 s 10)
T ( s)
10( K D s 2 K P s K I ) s ( s 2 s 10) 10( K D s 2 K P s K I )
1 GC ( s )G ( s ) H ( s )
1
s ( s 2 s 10)
s ( s 2 s 10)
T ( s)
10( K D s 2 K P s K I )
s ( s 2 s 10) 10( K D s 2 K P s K I )
T ( s)
10( K D s 2 K P s K I )
s 3 (1 10 K D ) s 2 (10 10 K P ) s (10 K I )
Match the symbolic form (function of KP, KI, KD) with the numerical desired characteristic
polynomial use the same third-order desired characteristic polynomial from Controller Design
Example 1, which is an augmented version of the second-order behavior with 5% overshoot and 1.5 sec
settling time.
K D 3.3
K P 14.72
K I 39.82
There is only one small change, compared to the stable underdamped system PID controller from
Controller Design Example 1. Only KD changed slightly (it was 3.1 before; now it is 3.3 for the unstable
system), but KP and KI are identical.
74
y(t)
1
0.8
0.6
0.4
0.2
0
0
Open-Loop
tR
= N/A sec
= sec
tP
PO
= NaN
tS
= sec
=
eSS
5
t (sec)
10
Closed-Loop PID
tR
= 0.05 sec
tP
= 0.16 sec
PO
= 10.7%
tS
= 1.03 sec
eSS
= 0%
Again, no output attenuation correction factor is required thanks to the KI term the effective
closed-loop stiffness is the same as the open-loop stiffness. The KI term ensures zero steady-state error.
Closed-loop transfer function:
T ( s)
We stabilized the unstable system but did not achieve the desired transient characteristics. The
above PID closed-loop system response is again too fast and too sharp. The desired poles are matched,
but the settling time is approximately 1.0 sec, faster than the specified the 1.5 sec. The percent
overshoot is approximately 10.9%, violating the 5% overshoot specification. Therefore, we need a prefilter.
75
Two unwanted zeroes were introduced by the PID controller; these can be cancelled by a pre-filter.
GP ( s)
398.2
33s 147.2s 398.2
2
Note the 398.2 numerator is included since the pre-filter shouldnt attenuate the output. Again plotting
the unit step responses, we now see that the performance specifications are met.
Example 2 PID Controller Open-, Closed-, and Closed-Loop with Pre-Filter unit step responses
1.6
1.4
1.2
y(t)
1
0.8
0.6
0.4
0.2
0
0
Open-Loop
tR
= N/A sec
= sec
tP
PO
= NaN
tS
= sec
=
eSS
5
t (sec)
Closed-Loop PID
tR
= 0.05 sec
tP
= 0.16 sec
PO
= 10.7%
tS
= 1.03 sec
eSS
= 0%
10
The pre-filtered closed-loop unit step response is theoretically identical to that of the Lead and
PID Controller Design Example 1 cases.
76
Given G( s)
5( s 2)
K
, H(s) = 1, CLDES ( s ) s 3 32 s 2 157.2 s 398.2 , GC ( s) K P I K D s
2
s s 10
s
Solve for the PID controller gains KP, KI, and KD. Then evaluate the PID controller performance.
Step 5. Solve for the unknown gains to achieve the desired behavior for the closed-loop system.
Derive the closed-loop transfer function as a function of the PID controller gains.
5( K D s 2 K P s K I )( s 2)
5( K D s 2 K P s K I )( s 2)
GC ( s )G ( s )
s ( s 2 s 10)
s ( s 2 s 10)
T (s)
5( K D s 2 K P s K I )( s 2) s ( s 2 s 10) 5( K D s 2 K P s K I )( s 2)
1 GC ( s )G ( s ) H ( s )
1
s ( s 2 s 10)
s ( s 2 s 10)
T (s)
5( K D s 2 K P s K I )( s 2)
s ( s 2 s 10) 5( K D s 2 K P s K I )( s 2)
T (s)
5[ K D s 3 ( K P 2 K D ) s 2 ( K I 2 K P ) s 2 K I ]
(1 5 K D ) s 3 (1 5 K P 10 K D ) s 2 (10 5 K I 10 K P ) s 10 K I
Match the symbolic form (function of KP, KI, KD) with the numerical desired characteristic
polynomial use the same third-order desired characteristic polynomial from Controller Design
Example 1, which is an augmented version of the second-order behavior with 5% overshoot and 1.5 sec
settling time.
Denominator parameter matching (fully-decoupled solution)
s3 1 5K D 1
s 2 1 5 K P 10 K D 32
s1 10 5K I 10 K P 157.2
s 0 10 K I 398.2
Due to the open-loop zero in G(s), this set of equations is overconstrained, i.e. 4 equations in
only three unknowns. In general there is no solution. What to do?
77
The solution to this dilemma is quite simple. In order to neutralize the effect of the open-loop
zero (or zeroes in other examples) of G(s), simply introduce a new block into our standard closed-loop
feedback diagram, the internal pre-filter GPi(s), as highlighted in red in the Simulink diagram below.
For this example this internal pre-filter GPi(s) should be designed as follows:
GPi ( s )
10
5( s 2)
That is, put the numerator of G(s) into the denominator of GPi(s); also the numerator of GPi(s) should be
the appropriate constant to avoid output attenuation. Then the controller design proceeds exactly as
done earlier for the PID controller in Example 1 without the troublesome zero included. This has been
done in class in the 3012 NotesBook and hence is not repeated here.
The Simulink output for this example is shown in the plot below.
78
In the above Simulink output response plots, we see that the open-loop unit step response with
the zero in magenta is changed significantly from the original open-loop response without the zero in
yellow. The unit step response of the PID feedback controller in red demonstrates that the internal prefilter is effective to cancel the effect of the open-loop zero and proceed with controller design in the
standard denominator parameter matching method. Interestingly, the same PID controller (whose
response is in sky blue) works almost as well without the new internal pre-filter GPi(s). This may not be
a general result, but in this example it again shows the power of feedback control. The Simulink
diagram that generated these plots is given below.
10
s2 +s+10
Plant
5*[1 2]
s2 +s+10
Plant1
398.2
Step
Pre-filter
5*[1 2]
PID
31s2 +147.2s+398.2
s2 +s+10
Same
PID Controller
398.2
PID
31s2 +147.2s+398.2
PID Controller
Pre-filter
Plant
10
5*[1 2]
5*[1 2]
s2 +s+10
Internal
Pre-filter
Plant
Scope
Note now there are two possible input efforts (see Section 5.12) to look at, the output of the
controller GC(s) and the output of the internal pre-filter GPi(s). Both can be important in ME 3012
controls projects.
The internal pre-filter GPi(s) can also be used to simplify higher-order systems (see Section
5.11) to second-order by including the higher-order factors in the numerator of the internal pre-filter. As
a combined example, consider the Robot Force Control open-loop transfer function given in Dr. Bobs
on-line Atlas of Models and Transfer Functions:
G ( s)
F (s)
K ( s 2.5)
2
( s ) ( s 2 s 2)( s 2 4s 5)
where (t) is the torque input and f(t) is the robot force output. This is a fourth-order system with a zero.
The combined internal pre-filter to cancel the effect of the zero and to simplify to a second-order system
is:
79
GPi ( s )
( s 2 4 s 5)
( s 2.5)
We chose the second quadratic factor for the numerator of the internal pre-filter since that leaves the
more dominant mode first quadratic factor for controller design (it is slower, the second quadratic factor
is faster and hence less dominant).
This above internal pre-filter cannot be implemented in MATLAB or Simulink since the order of
the numerator is greater than the order of the denominator (it is non-causal). But the human can do the
cancelling and use the results in lower-order (second) system controller design.
80
G(s)
10
10
poles
s3 1
Step 2. Specify and evaluate the desired behavior for the closed-loop system.
Using a dominant second-order desired characteristic polynomial for 5% overshoot and 1.5 sec
settling time, and adding two non-dominant negative real poles at least 10x higher (do not use 100x).
s1,2 2.67 2.80i
s3 26.7
s4 27.7
PID Controller
GC ( s ) K P
KI
KDs
s
81
10
, H(s) = 1, DES
s 2s 11s 10
K
GC ( s) K P I K D s .
s
Given G ( s)
AUG
Solve for the PID controller gains KP, KI, and KD. Then evaluate the PID controller performance.
Step 5. Solve for the unknown gains to achieve the desired behavior for the closed-loop system.
The closed-loop transfer function as a function of the PID controller gains result is
GC (s)G(s)
10( KD s2 KP s KI )
T ( s)
This denominator parameter matching fails! There are not enough dof in a PID controller. If we were to
ignore this problem and solve anyway, we get KP = 474.3, KI = 1103, and KD = 103.3. Substituting
these values into T(s), the result is UNSTABLE due to two closed-loop poles with positive real parts.
This case is overconstrained, i.e. 4 equations but only 3 unknowns. In general, no solution
exists. What to do?
1. Simplify original open-loop system, if possible, to second-order and use parameter matching.
2. Do controller design by trial-and-error. This can be frustrating for the PID and Lead
3
controller because there are possible solutions in each case! For the lead controller this can
2
be reduced to possible solutions if you use the rule of thumb b = 10a.
Try MATLABs rltool a beautiful tool for trial-and-error controller design.
Prior to resorting to trial-and-error, first try to simplify your higher-order system in one of two ways:
82
Demonstrate with MATLAB for the overconstrained third-order open-loop plant example.
num = [10];
den = [1 2 11 10];
bob = tf(num,den);
rltool(bob);
Just like MATLAB function rlocus, give rltool the open-loop transfer function G(s) only,
then rltool will close the loop for you.
This m-code draws an interactive root-locus plot. Above the plot the current closed-loop
controller architecture is displayed with the following equivalences to ME 3012 standard notation.
name
ME 3012 notation
rltool notation
plant
G(s)
G(s)
sensor
H(s)
H(s)
controller (compensator)
GC(s)
C(s)
pre-filter
GP(s)
F(s)
On the root locus plot you can grab the square handle and slide it to change the gain K; the plot
displays in real-time where the closed-loop poles move. Choose some K value and use tools loop
responses to see the unit step response (among other options). How to choose K intelligently? Rightclick and choose Design Requirements to show grid lines for your performance specification choices.
To build the compensator piece-by-piece you can add real poles, add real zeroes, add complex
poles, and/or add complex zeroes. Remember open-loop poles migrate to open-loop zeroes, so you may
wish to add some strategic zeroes to attract those pesky poles that are causing trouble in your system
response.
Another good strategy: pole/zero cancellation place zeroes right on top of any bad poles to
neutralize their effect. Caution This does not work for unstable poles (why?).
As you will see, this leads to endless hours of fun it can be frustrating too, so the suggestion to
simplify the open-loop system, if possible, is a good one.
To simplify your open-loop system, look at the poles if one or more pole are significantly
larger than the others, these larger ones can be ignored in favor of the lower, dominant poles. Modes
associated with the larger (negative real part) poles rise much faster in time, as we have seen. Divide
your original characteristic polynomial by the non-dominant factor(s) to simplify.
Step 6. Evaluate the PID controller performance in simulation.
Simulate, then re-design and re-evaluate your controller if necessary, repeating Steps 1 6.
83
For a first-order system, if you want to design a Lead or PID controller, T(s) will be of secondorder, but there are three unknown controller parameters in each case. This case is underconstrained,
i.e. only 2 equations but 3 unknowns. In general there are infinite solutions. You could set one gain
randomly and solve for the remaining two by denominator parameter matching. However, there are
better methods.
Use a PI controller (PD will not work since the I term introduces an s in the denominator).
Use a Lead controller, with the rule-of-thumb b = 10a and thus eliminate an unknown.
T (s)
10K(s a)
s (10 b 10K)s (10b 10Ka)
2
Use a dominant second-order desired characteristic polynomial for 5% overshoot and 1.5 sec settling
time:
DES ( s ) s 2 5.33 s 14.93
84
We now return to the Controller Design Examples 1, with the Lead controller (without and with
pre-filter) and the PID controller (without and with pre-filter).
Simulink Model for open-loop, Lead, and PID Input Effort Simulation
85
Lead Controller
86
87
88
PID Controller
89
90
All open-loop input efforts are simply unit step inputs, shown for comparison purposes. Without
pre-filtering, the input effort required for the Lead and PID controllers is huge (peaks of greater than 50
and greater than 300, respectively), so large we cannot see the details for the other curves on those plots.
The pre-filtered Lead and PID controllers require maximum input efforts of just over 1 and nearly 1.2,
respectively, a dramatic difference!
Similarly, the non-pre-filtered Lead and PID controllers require very fast changing of the input
actuator values, which may exceed physical capabilities of the real-world actuator. The pre-filtered
Lead and PID controllers do not require these radical rates of change for the actuator input efforts.
91
U(s)
Y(s)
G(s)
D(s)
UD (s)
U(s)
E(s)
R(s)
GC (s)
Y(s)
G(s)
YSENS (s)
Y(s)
H(s)
UD (s)
U(s)
GC (s)
Y(s)
G(s)
-1
YSENS (s)
H(s)
Y(s)
Change this into a diagram that looks more similar to the standard closed-loop feedback diagram.
D(s)
Y(s)
UD (s)
G(s)
+
U(s)
E(s)
GC (s)
-1
YSENS (s)
H(s)
Y(s)
The closed loop transfer function between the disturbance input D(s) and Y(s) output is:
Y (s)
G (s)
TD ( s )
D ( s ) 1 GC ( s )G ( s ) H ( s )
This is for MATLAB implementation, to simulate the effects of the disturbance input separately.
Then use linear superposition in MATLAB to find the total solution as the sum of the reference input
response (with zero disturbance) plus the disturbance input (with zero reference input).
92
Controller Design with Disturbances (one possible strategy for use in ME 3012)
1. Design the controller as before with no disturbances then evaluate in simulation.
2. For the same controller(s), now apply a disturbance and evaluate how well the controller
rejects the disturbance vs. the open-loop system, both with zero reference input.
3. Repeat 2, apply a disturbance and evaluate how well the controller rejects the disturbance vs.
the open-loop system, now with non-zero reference input.
One can test open- vs. closed-loop disturbance rejection behavior with various disturbances of
different functions (impulse, step, ramp, sine wave, random, etc.), magnitudes, and times of application.
Choose whatever makes the best sense for your real-world application.
10
s2 +s+10
OL no dist
Dist
10
s2 +s+10
OL dist
398.2
31s2 +147.2s+398.2
Step
PID
PID Controller
Pre-filter
398.2
31s2 +147.2s+398.2
PID
PID Controller
Pre-filter
10
s2 +s+10
CL no dist
Scope
10
s2 +s+10
CL dist
For this simulation we specify a unit step disturbance that adds to the actuator input, turned on at
t = 1 sec, whereas the basic open- and closed-loop step input turned on a t = 0 sec.
93
This Simulink simulation shows that the open-loop system cannot deal with the disturbance at t =
1 sec since the open-loop transient response phase shifts and the steady state error is 100%. In contrast,
the closed-loop PID controller is also disturbed at t = 1 sec, but the closed-loop output relatively quickly
returns to the designed trajectory. Thus, the PID controller disturbance rejection is much better than that
of the open-loop system.
94
Here the output responses of the pre-filtered closed-loop Lead and PID controllers are identical.
Since they are designed based on the augmented third-order system, there is only a little error,
essentially achieving the desired 5% overshoot and 1.5 sec settling time.
After the unit step disturbance is turned on at t = 1 sec, we see that only the PID controller can
handle it well. The Lead controller (magenta) has good transient dynamics under the disturbance but
nearly 80% steady-state error.
Thus, the PID controller disturbance rejection is much better than that of the Lead controller in
this example. The PID controller was not designed for disturbance rejection, it just handles the
disturbances better.
95
Simulink Model for corrected pre-filtered Lead and pre-filtered PID Controllers,
without and with Disturbances
96
E(s)
R(s)
Y(s)
G(s)
GC (s)
YSENS (s)
H(s)
Y(s)
There are possible drawbacks with this method, the biggest being: the order of the closed-loop system
must match the number of controller unknowns. If the number of unknowns is less, there is no solution
(overconstrained) and if the number of unknowns is greater, there are infinite solutions
(underconstrained). In either of the mismatch cases we can use trial-and-error controller design. This
n
can be frustrating and ineffective since there are solutions, where n is the number of controller
unknowns. See Section 5.10 in this Supplement.
Further drawbacks include the need for most standard controllers to add a correction factor for
output attenuation and a pre-filter transfer function GP(s) to cancel the unwanted introduced zero(s).
There is a potentially better method, here called the whole T(s) Matching Controller Design, or
simply the J-Method. This is named after ME student Jason Denhart who, in Spring 2008, posed the
question Why cant we just specify the entire numerical T(s) and solve for the exact GC(s) necessary to
provide that T(s)?
97
The J-Method
Step 1. Analyze the as-given open-loop system behavior.
Step 2. Specify and evaluate the desired behavior for the closed-loop system. This step
yields a numerical desired characteristic polynomial for the T(s) denominator (see Note 1 below),
plus the desired T(s) numerator.
Step 3. State the controller design problem to be solved. The former Step 3 is skipped, i.e.
the J-Method determines the controller form in the solution procedure so there is no need to
assume a standard controller form for GC(s).
Given
Find
The plant and sensor transfer functions G(s) and H(s) in the context of our
standard closed-loop negative feedback diagram.
The desired closed-loop behavior, expressed by a whole numerical T(s) (as
opposed to the desired closed-loop characteristic polynomial only as before).
The form and the unknowns (gains) of the controller transfer function GC(s).
Step 4. Solve for the unknown controller form including the unknown gains. Use the
standard equation
GC ( s )G ( s )
T (s)
1 GC ( s )G ( s ) H ( s )
Substitute your whole numerical desired T(s), plus the known numerical plant and sensor transfer
functions G(s) and H(s), and solve for the unknown controller transfer function GC(s), without
the need to assume a certain controller form.
T (s)
GC ( s )
G ( s )(1 H ( s )T ( s ))
Notes
1. The order of the denominator of your desired T(s) must be equal or greater than the order of the
denominator of G(s). If the G(s) denominator is of higher order than the T(s) denominator, your
resulting GC(s) will have a higher order in the numerator than the denominator, which is impossible to
implement in MATLAB or Simulink, unless it happens to boil down to a PID form.
2. You do not need a correction factor this is loaded into your desired T(s).
3. You do not need a pre-filter transfer function GP(s) since we are matching the entire desired T(s).
4. The resulting controller GC(s) will not necessarily be of any recognizable classical controller form.
5. MATLAB was used to help with the algebra (either symbolically or numerically). This should work;
however, problems were encountered with large integers and excessive controller numerator and
denominator orders.
6. If you follow the requirement for T(s) denominator order and make no algebra mistakes, the
performance you obtain will be theoretically identical to a good classical controller with appropriate prefilter and correction factor.
7. There are three major drawbacks of the J-Method
The J-Method does not handle disturbances well, as most other controllers do (presented later).
The J-Method requires perfect knowledge of the open-loop plant, which is impossible. Thus, it
is less robust to modeling uncertainties than other controllers.
The J-Method cannot handle unstable open-loop plants (this is no problem for other controllers).
98
10
.
s s 10
2
Step 2. Specify and evaluate the desired behavior for the closed-loop system, to achieve 5%
overshoot and 1.5 sec settling time. We have used these performance specifications before; the
associated desired whole closed-loop transfer function is (assuming a final value of 1 is desired from a
unit step input):
14.93
T ( s) 2
s 5.33s 14.93
Step 3. State the controller design problem to be solved.
10
14.93
Given G( s) 2
, H(s) = 1, and T (s) 2
s s 10
s 5.33s 14.93
Solve for GC(s) via whole T(s) matching.
Step 4. Solve for the unknown controller form including the unknown gains.
The result is
GC ( s )
1.493( s 2 s 10)
s ( s 5.33)
99
Plant1
Step1
1.493*[1 1 10]
s2 +5.33s
10
s2 +s+10
Gc
Plant2
Scope
Open-Loop
Closed-Loop J-Method
There is no need for a correction factor or pre-filter.
100
Examples
To rigorously test the J-Method, the following three open-loop transfer functions G(s) and the
following three desired whole closed-loop transfer functions T(s) were chosen, to be mixed-and-matched
for a total of 9 examples.
G(s)
T(s)
1
2
1.
a.
s 1
s2
10
15
2. 2
b. 2
s s 10
s 6 s 15
10
450
3.
c. 3
2
2
( s 1)( s s 10)
s 36s 195s 450
The whole desired T(s) in c. started from b., augmenting the denominator with a third pole
s3 30 , so approximately the same dominant second-order behavior will result (2.13%
overshoot and 1.38 sec settling time).
All whole desired T(s) in a., b., and c. artificially obtain a steady state value of 1 give a unit step
input function, with selection of the numerator constant to match the denominator spring.
Lets do a few of these examples now. Assume unity negative feedback for all examples.
Example 1a
T ( s)
1
, ideal sensor transfer function H(s) = 1, and desired whole
s 1
2
, determine GC(s) via whole T(s) matching:
s2
Answer
GC ( s )
2( s 1)
s
101
Open-Loop
Closed-Loop J-Method
The open-loop time constant of = 1 sec is halved to the closed-loop time constant of = 0.5 sec, which
doubles the speed of the closed-loop system to reach 95% of the final value of 1.
102
Example 1b
T ( s)
1
, ideal sensor transfer function H(s) = 1, and desired whole
s 1
15
, determine GC(s) via whole T(s) matching:
s 6s 15
Answer
GC ( s)
15( s 1)
s( s 6)
103
Open-Loop
Closed-Loop J-Method
The open-loop time constant was = 1 sec and the desired closed-loop performance specs of 2.13%
overshoot and 1.38 sec settling time are met in simulation.
104
Example 2a
T ( s)
10
, ideal sensor transfer function H(s) = 1, and desired whole
s s 10
2
2
, determine GC(s) via whole T(s) matching.
s2
s 2 s 10
(what kind of controller is this?)
Answer
5s
This is an exception to the rule that the T(s) denominator must of order equal or greater than the order of
the G(s) denominator, since it is a PID controller.
GC ( s)
105
Open-Loop
Closed-Loop J-Method
The open-loop behavior is the familiar stable underdamped system and the closed-loop time constant is
= 0.5 sec which allows closed-loop system to reach 95% of the final value of 1 in 1.5 sec, thus meeting
the design goals in simulation.
106
For the combinations of examples considered, the table below summarizes the numerator and
denominator orders using the J-Method. Also given is the resulting form of the controller transfer
function GC(s) (n.r.f. stands for no recognizable form).
1st
G(s)
2nd
3rd
T(s)
b. 2nd-order
1st
, Lead/I
2nd
2nd
, n.r.f.
2nd
3rd
, n.r.f. 2
nd
2
a. 1st-order
1st
, PI
1st
2nd
, PID 1
1st
3rd
, n.r.f. 2
st
1
c. 3rd-order
1st
, n.r.f.
3rd
2nd
, n.r.f.
3rd
3rd
, n.r.f.
3rd
For the nine example combinations considered, the table below summarizes the resulting
controller transfer functions GC(s) using the J-Method.
st
G(s)
a. 1st-order
T(s)
b. 2nd-order
c. 3rd-order
2( s 1)
s
15( s 1)
s ( s 6)
450( s 1)
s( s 36s 195)
1.5( s 2 s 10)
s ( s 6)
45( s 2 s 10)
s( s 2 36s 195)
nd
s 2 s 10
5s
rd
s 3 2s 2 11s 10
5s
Exception to the rule that the order of the denominator of your desired T(s) must be equal or greater
than the order of the denominator of G(s).
2
Impossible to implement.
107
In addition to this set of nine examples, the J-Method has been successfully tested with the following
(where the a-c cases represent the same desired closed-loop transfer functions as above).
Integrating open-loop transfer function G(s) (an s can be factored out in the denominator, i.e.
there is no spring). This is called a Type I system since there is one integrator in the
denominator of G(s), as explained in Section 4.5 of the 3012 NotesBook.
10
10
G ( s) 2
s s s ( s 1)
a. GC ( s)
PD
b. GC ( s )
1.5( s 1)
( s 6)
Lead
a. GC ( s )
s 1
5
c. GC ( s)
for G ( s )
45( s 1)
s 36s 195
n.r.f.
2
1
s 1
2( s 2 5s 4)
15( s 2 5s 4)
450( s 2 5s 4)
G
(
s
)
G
(
s
)
b.
c.
C
C
s 2 6s 6
s3 10s 2 39s 45
s 4 40 s 3 339 s 2 1230 s 1350
s 2 s 10
45( s 2 s 10)
1.5( s 2 s 10)
b. GC ( s )
c. GC ( s )
5s
s ( s 2 36 s 195)
s ( s 6)
108
Note that the full-T(s)-matching J-Method does not experience any problems with handling
open-loop G(s) models with zeroes or higher-order systems. The J-Method controller includes its own
internal pre-filter, identical to the one presented in Section 5.9.
Also, problems of denominator parameter matching with higher-order and lower-order systems
as exposed in Section 5.10 are not a problem for the J-Method.
J-Method Controller Input Effort
For Controller Design Example 1, we first present the output unit step response, followed by the
input effort plot, both in comparison to the open-loop case.
109
The J-Method requires no pre-filter its maximum input effort requirement is 1.5 actuator input
units. The J-Method controller does not require a steep rate of change for the actuator input effort.
110
Again for Controller Design Example 1, we now present how well the J-Method rejects
disturbances.
A unit step disturbance was turned on at t = 1 sec. Clearly the J-Method controller is very poor
at rejecting the disturbance in this example. The disturbed J-Method controller overshoots relatively
high, with poor transient dynamics. This disturbed response is heading towards zero steady-state error,
however, given enough time.
The PID controller disturbance rejection presented in Section 5.12 is much better than that of the
Lead or J-Method controllers in this example. The PID controller was not designed for disturbance
rejection, it just handles the disturbances better.
111
cL
v A (t)
+
v B (t)
-
J L (t)
cM
L (t)
L (t)
L (t)
JM
M (t)
M (t)
M (t)
i A (t)
We will design a controller to control the load angular velocity L(t). Assume a perfect
tachometer sensor, H(s) = Kt = 1, so there is negative unity feedback. Note that G2(s) = KT, the motor
torque constant, is different from H(s) = Kt, the feedback sensor (tachometer) constant. Here are the
open- and closed-loop feedback control system diagrams.
VA (s)
G1 (s)
I A(s)
TM (s)
G2 (s)
M (s)
G3 (s)
L (s)
1/n
KB
VA (s)
G1 (s)
I A(s)
G2 (s)
TM (s)
M (s)
G3 (s)
L (s)
1/n
KB
Kt
where
G1 ( s )
1
Ls R
G2 ( s ) K T
G3 ( s )
1
J E s cE
H(s) = Kt = 1
112
Earlier the open-loop transfer function was derived and the real-world parameters for the NASA
ARMII robot shoulder joint were substituted.
KT
L (s)
5
n
2
G ( s )
V A ( s ) Ls R J E s cE K T K B s 11s 1010
OL s s 2 2 n s n2 s 2 11s 1010
tR = 0.04 sec
11
11
0.173
2 n 2 1010
tP = 0.10 sec
PO = 57.6%
tS = 0.71 sec
This open-loop system has a different time scale than Controller Design Example 1; its output
L(t) rises much faster in response to a unit step input vA(t). Also, the steady-state value is 5/1010,
whereas it was 1.0 for Controller Design Example 1.
113
First, take a look at the root-locus plots and unit step responses, for the proportional controller GC(s) =
K, first for angular velocity output.
Root Locus
50
40
30
20
Im
10
0
-10
-20
-30
-40
-50
-50
0
Re
Step Response
1.6
1.6
1.4
1.4
1.4
1.2
1.2
1.2
1
Amplitude
0.8
0.8
0.8
0.6
0.6
0.6
0.4
0.4
0.4
0.2
0.2
0.2
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0.1
0.2
0.3
0.4
Time (sec)
0.5
0.6
0.7
0.8
0.9
1.4
1.4
1.2
1.2
1.2
0.8
0.8
0.6
0.6
0.4
0.4
0.4
0.2
0.2
0.2
0.5
0.6
0.7
0.8
0.9
Time (sec)
0.5
0.6
0.7
0.8
0.9
0.7
0.8
0.9
0.8
0.6
0.4
0.4
1
Amplitude
Amplitude
1.4
0.3
0.3
Step Response
1.6
0.2
0.2
Step Response
1.6
0.1
0.1
Time (sec)
1.6
Time (sec)
Step Response
Amplitude
Step Response
1.6
Amplitude
Amplitude
Step Response
50
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0.1
Time (sec)
0.2
0.3
0.4
0.5
Time (sec)
52
96
179
334
622
0.6
114
Here are the root-locus plot and unit step responses, for the proportional controller GC(s) = K, for angle.
Root Locus
50
40
30
20
Im
10
0
-10
-20
-30
-40
-50
-50
0
Re
Step Response
Step Response
Amplitude
0.5
Step Response
0.1
0.5
0.08
0.4
0.06
0.3
Amplitude
Amplitude
50
0.04
0.2
-0.5
0.02
-1
0.2
0.4
0.6
0.8
0.1
0.2
Time (sec)
0.4
0.6
0.8
0.2
Time (sec)
Step Response
0.6
0.8
0.8
0.8
Time (sec)
Step Response
0.4
Step Response
10
1.5
0.4
0.5
0.2
Amplitude
0.6
Amplitude
Amplitude
0.8
0.2
0.4
0.6
0.8
-5
0.2
Time (sec)
0.4
0.6
0.8
-10
0.2
Time (sec)
11
Step Response
x 10
0.6
Time (sec)
Step Response
x 10
0.4
x 10
20
Step Response
1.5
0.5
0.5
-0.5
Amplitude
Amplitude
Amplitude
0.5
0
-0.5
-1
-0.5
-1.5
-1
0.2
0.4
0.6
Time (sec)
0.8
-2
0.2
0.4
0.6
Time (sec)
0.8
-1
0.2
0.4
0.6
Time (sec)
2220
3955
9529
55309
220190
The closed-loop system becomes unstable for K 2222 ! Clearly the simple proportional controller will
not work, since the angular velocity root-locus plot shows that the closed-loop dimensionless damping
ratio must decrease as K increases.
115
Step 2. Specify and evaluate the desired behavior for the closed-loop system.
To determine the numerical desired characteristic polynomial, lets try something different:
ITAE third-order. Arbitrarily let n = 5.
DES ( s ) s 3 1.75 n s 2 2.15 n2 s n3 s 3 8.75 s 2 53.75 s 125
The associated desired closed-loop poles from third-order ITAE are 2.60 5.34i , 3.54 .
Step 3. Specify the form for the controller transfer function.
K
K s2 KP s KI
PID Controller
GC ( s ) K P I K D s D
s
s
Step 4. State the controller design problem to be solved.
5
CLDES ( s ) s 3 8.75 s 2 53.75 s 125 , and
Given
G ( s) 2
, H(s) = 1,
s 11s 1010
KI
GC ( s ) K P
K D s , Solve for the PID controller gains KP, KI, and KD. Then evaluate the PID
s
controller performance.
Step 5. Solve for the unknown gains to achieve the desired behavior for the closed-loop system.
Derive the closed-loop transfer function as a function of the PID controller gains.
5 KD s2 KP s KI
5 KD s2 KP s KI
GC ( s )G ( s )
T (s)
1 GC ( s )G ( s )
T (s)
T (s)
s s 2 11s 1010
5 KD s2 KP s KI
s s 2 11s 1010
s s 2 11s 1010
s s 2 11s 1010 5 K D s 2 K P s K I
s s 2 11s 1010
5 KD s2 KP s KI
s s 2 11s 1010 5 K D s 2 K P s K I
5 KD s2 KP s KI
s 3 11 5 K D s 2 1010 5 K P s 5 K I
Match the symbolic form (function of KP, KI, KD) with the numerical ITAE desired characteristic
polynomial.
Denominator parameter matching (fully-decoupled solution)
s3 1 1
K D 0.45
s 2 11 5 K D 8.75
K P 191.25
s1 1010 5 K P 53.75
K I 25
s 0 5 K I 125
116
0.02
0.01
-2
-0.01
-4
-0.02
L(t)
L(t)
-0.03
-6
-8
-0.04
-10
-0.05
-12
-0.06
-14
-0.07
-16
0
0.5
1.5
t (sec)
2.5
-0.08
0
Open-Loop
Closed-Loop PID
0.5
1.5
t (sec)
2.5
Open-Loop
Closed-Loop PID, corrected
T (s)
Again: Controller design can easily make matters worse, if not done properly! With negative KP,
the closed-loop step response initially goes down while open-loop goes up. The is a huge (negative)
overshoot, and the transient response is slower than the open-loop case.
Step 9. Re-design and re-evaluate the controller.
Perform design iteration until the closed-loop performance specifications are met in simulation.
We have no pre-filter yet (Step 8), but we have a bigger problem in the negative KP and KD.
Step 2. Specify and evaluate the desired behavior for the closed-loop system.
So lets choose a higher n in the third-order ITAE desired closed-loop numerical characteristic
polynomial for faster response and positive KP, KD. KP is the limiting case, i.e. if we force it to be
positive, KD will be positive also.
11 5 K D 1.75n
@ KD = 0, n = 6.29, but then KP will still be negative (KP = 185); therefore let us instead set n so
that KP will be positive.
@ KP = 0, n = 21.7
1010 5 K P 2.15 n2
3
2
So try n = 30
DES ( s ) s 52.5 s 1935 s 27000
117
The new associated desired closed-loop poles from third-order ITAE are 15.63 32.04i , 21.24
Step 5. Solve for the unknown gains to achieve the desired behavior for the closed-loop system.
Denominator parameter matching (fully-decoupled)
3
s 11
K D 8.3
s 2 11 5 K D 52.5
K P 185
KP and KD are both positive as planned!
s1 1010 5K P 1935
K I 5400
s 0 5 K I 27000
Step 6. Evaluate the PID controller performance in simulation.
Open- vs. Closed-Loop unit step responses
Open- vs. PID Closed-Loop
-3
x 10
Response, Corrected
7
6
L(t)
5
4
3
2
1
0
0
0.1
0.2
0.3
0.4
0.5
t (sec)
0.6
0.7
0.8
0.9
Open-Loop
Closed-Loop PID
5
42 s 2 925 s 27000
3
2
1010 s 52.5 s 1935 s 27000
The controller response is much better with the positive KP and KD, but the third-order bend in
the closed-loop response is not as desired. The desired ITAE response is different, i.e. it doesnt look
like this closed-loop response. Therefore, we need a pre-filter.
118
Two unwanted zeroes were introduced by the PID controller; these can be cancelled by a prefilter.
GP ( s )
27000
42 s 925s 27000
2
Note we specify the 27000 pre-filter transfer function numerator since the pre-filter shouldnt attenuate
the output. When we plot the resulting unit step responses we see in the left plot below that the
controller design is now successful.
Open-, PID Closed-, and Pre-filtered
-3
x 10
Response
-3
x 10
Response
4.5
4
3.5
L(t)
L(t)
2.5
2
1.5
1
0
0
0.5
0.1
0.2
0.3
0.4
0.5
t (sec)
0.6
0.7
0.8
0.9
0
0
0.1
0.2
0.3
0.4
0.5
t (sec)
0.6
0.7
0.8
0.9
Open-Loop
Closed-Loop PID
Closed-Loop PID with Pre-Filter
The pre-filtered closed-loop transfer function is:
T (s)
5
27000
2
1010 s 52.5s 1935s 27000
The final closed-loop unit step response is now theoretically identical to the specified third-order
ITAE behavior. Note with the ITAE specification we didnt need to specify percent overshoot, settling
time, or peak time.
For this controller, the angle L(t) unit step response in time is given in the right plot above (note
the steady-state error since the closed-loop PID lags the open-loop and the closed-loop PID with prefilter lags even further). We just integrated the L(t) response to get these results, i.e. we included
another s factor in the closed-loop system denominator.
119
1
s
V
Integrator2
Plant
OmegaL
-KReference
OmegaL
Corr
27000
PID Controller
Pre-filter
ThetaL
1
s
PID
42s2 +925s+27000
Integrator
Plant
The Plant blocks above are Simulink masks for the (identical) open-loop plant shown below.
tau dist
100
s+10
in_1
RL Circuit
-K-
0.1s+0.1
Km
1/n
Jc rotational dynamics
1
Kb
out_1
120
J-Method Controller
Alternate design method for Term Example L(t) controller design.
Step 2. Specify the desired behavior for the closed-loop system We specify the entire desired closedloop T(s), not just the denominator. To determine the numerical desired entire closed-loop T(s) transfer
function, lets try something different: ITAE second-order.
DES ( s) s 2 1.4n s n2
with
G ( s)
T (s)
G ( s ) 1 H ( s )T ( s )
5
s 11s 1010
2
and
H(s) = 1
5(900)
1010
2
42 s 900
s
GC ( s)
5(900)
1010
2
1 (1) 2
s 42 s 900
s 11s 1010
450
s 2 11s 1010
101
2
s 42 s 900
GC ( s)
450
2
s 42 s 900 101
2
s 42 s 900
90 2
s 11s 1010
101
GC ( s)
1
s 2 42 s 450 2
101
J-Method
121
Step
Open-Loop
90/101*[1 11 1010]
s2 +42s+450*(2-1/101)
s2 +11s+1010
Gc
Plant
Closed-Loop J-Method
Scope
122
Open-Loop
Closed-Loop J-Method
123
cL
v A (t)
+
v B (t)
-
J L (t)
cM
JM
M (t)
M (t)
M (t)
i A (t)
L (t)
L (t)
L (t)
Though we have not presented it, it is possible to design controllers specifically to reject
disturbances. This last example, the conclusion of the Term Example, discusses controller design to
reject disturbances, specifically for achieving lower steady-state error.
Term Example open-loop diagram with disturbance
D(s)
VA (s)
G1 (s)
I A(s)
G2 (s)
M (s)
TM (s)
G3 (s)
L (s)
1/n
KB
where VA(s) is the armature voltage input, L(s) is the load shaft angular velocity output, and D(s) is the
disturbance modeled at the actuator input level (disturbance in torque, Nm).
where G1 ( s )
1
Ls R
G2 (s) KT
G3 ( s )
1
J E s cE
Let VA(s) = 0 and monitor changes in L(s) given a disturbance input. Since VA(s) = 0, any L(s)
is the steady-state error, that is, we wish as low an output as possible for the open-loop system.
Derive the open-loop disturbance transfer function GD ( s )
L ( s)
.
D( s )
M ( s)
1
TM ( s ) D( s ) J E s cE
124
TM ( s )
KT
K B M ( s ) Ls R
Since V(s) = 0
nL (s)
1
KT KB nL (s)
D(s) J E s cE
Ls R
M ( s ) n L ( s )
n L ( s) J E s cE
KT K B n L ( s) Ls R D( s)
Ls R
GD ( s )
Ls R
L (s)
D( s ) n J E s cE Ls R KT K B
EOL ( s ) LDES ( s ) L ( s ) L ( s)
D
s
Ls R
D( s )
n J E s cE Ls R KT K B
Ls R
D
essOL lim eOL (t ) lim sEOL ( s) lim s
t
s0
s0 n J E s cE Ls R KT K B s
essOL
RD
n RCE KT K B
LDES (s)
VA (s)
G1 (s)
I A(s)
G2 (s)
TM (s)
M (s)
G3 (s)
L (s)
1/n
KB
Kt
where LDES(s) is the desired load shaft angular velocity output, and the other terms have been
previously defined.
125
Let LDES(s) = 0 and check changes in L(s) given a disturbance input. Since LDES(s) = 0, any
L(s) is the steady-state error, that is, we wish as low an output as possible for the closed-loop system.
Derive the closed-loop disturbance transfer function TD ( s)
M (s)
1
TM ( s ) TD ( s ) J E s cE
L ( s)
.
LDES ( s)
TM ( s)
KT
A( s) Ls R
M ( s ) n L ( s )
A( s) VA ( s) K B M ( s)
KT KKt nK B L (s)
Ls R
n L ( s )
1
K T KK t nK B L ( s )
J E s cE
D(s)
Ls R
n L ( s) J E s cE
KT KKt nK B L ( s) Ls R D( s)
Ls R
Ls R
L (s)
LDES ( s) n J E s cE Ls R KT KKt nK B
ECL ( s)
Ls R
D( s )
n J E s cE Ls R KT KKt nK B
essCL lim eCL (t ) lim sECL ( s)
t
s0
Ls R
D
essCL lim s
s0 n J E s cE Ls R KT KKt nK B s
D
s
126
essCL
RD
nRcE K T KK t nK B
For disturbance-rejecting controller design, ensure the closed-loop steady-state error is less than the
open-loop steady-state error.
n RcE KT K B
essCL
RD
essCL
1
essOL
127
RD
n RcE KT K B
essCL
10 D
200 1 100
10 D
200 100 KK t 200
10 D
20200
10 D
20200 100 KK t
essCL
10 D
20200
RD
nRcE KT KK t nK B
essCL
20200
1
essOL 20200 100 KK t
20200
20200 100 KK t
Kt
K
tachometer selection
proportional controller gain
Assume the tachometer gain is fixed. Then the only way to reduce the closed-loop steady-state
error is to increase proportional controller gain K as much as possible.
Now, this proportional controller for disturbance rejection is not very satisfying we know from
the root-locus plot that the higher we make K, the worse the transient response will be (stable but more
highly underdamped as K increases). So this demonstrates another tradeoff in controller design to
ensure lower steady-state errors due to unknown, unwanted disturbances, we must accept worse
transient response performance.
128
6. Vibrational Responses
6.1 Free Vibrational Responses
6.1.1 Undamped Second-Order System Free Responses: Simple Harmonic Motion
6.1.1.1 Analytical Undamped Second-Order System Free ODE Solutions
Unforced Second-Order System Solution Validation
After one obtains the solution to an ODE, the next important step is to check the solution x(t) to
ensure it is correct. We now present two ways to validate the solution, the first partial and the second
complete.
First, we can check the initial conditions of the resulting solution to ensure they are correct. For
the initial position we substitute t = 0 into the function x(t), and for the initial velocity we substitute t = 0
into the function x(t ) .
x (t ) x0 cos n t
v0
v0
x (t ) n x0 sin n t n
sin n t
v0
v0
cos n t
sin[n (0)]
(0)
x (0) x0
So we see both required initial conditions x0 and v0 are achieved by our solution x(t). This is a
weak check, since it only looks at t = 0. A second, stronger solution check is to substitute x(t) and its
second derivative into the original ODE and ensure that an equality results. This is a complete check.
First, here are the displacement solution x(t) and its two time derivatives.
x (t ) x0 cos n t
v0
sin n t
k
.
m
129
mx(t ) kx(t ) 0
v
m[ x0n2 cos nt v0n sin nt ] k[ x0 cos nt 0 sin nt ] 0
v0
) (mx0
v0
)0
v0
) (mv0n2 kv0 ) 0
n
n
n
v
k
kx0 ) cos nt (mv0n k 0 ) 0
m
n
k
kv0 ) (kv0 kv0 ) 0
m
00
Since a valid equation results, i.e. 0 = 0, this means the unique ODE solution is correct.
(mv0
130
Let us solve the same general unforced Harmonic Oscillator second-order IVP ODE using an
alternative method: Laplace Transforms. Since we are solving a linear ODE, there is a unique solution,
which we have found using the Slow ME Way and validated by direct substitution.
The Problem Statement is the same:
Solve a2
x(t ) a0 x(t ) 0 for x(t) given a2, a0, and values for the initial conditions:
x(0) x0
x(0) v0
In contrast to the Slow ME Way, ODE solution via Laplace Transforms is accomplished
algebraically in the Laplace frequency domain, in a single step, including the initial conditions.
The first step is to take the Laplace Transform of both sides of the ODE, including the initial
conditions, and solving algebraically for the unknown in the Laplace domain, X(s) L{x(t)}.
L a2
x(t ) a0 x(t ) 0
a2 ( s 2 X ( s) sx(0) x (0)) a0 X ( s) 0
(a2 s 2 a0 ) X ( s) a2 ( x0 s v0 )
X (s)
a2 ( x0 s v0 )
a2 s 2 a0
Note that the system characteristic polynomial a2 s2 a0 appears when using the Laplace
Transform method. To find the solution in the time domain, x(t), we must take the inverse Laplace
Transform of X(s).
x(t ) L1 X ( s)
a ( x s v0 ) 1 x0 s v0
x(t ) L1 2 02
L
a2 s a0
s 2 a0
a2
x s
v
s
1
1
x(t ) L1 0 L1 0 x0 L1
v0 L
a
a
a
s2 0
s2 0
s2 0
s 2 a0
a2
a2
a2
a2
Consulting a table of Laplace Transforms, such as in Appendix B, we find two applicable entries.
s
sin t
cos t 2
2
2
s
s 2
131
The left term in x(t) above is ready to go and will yield a cosine term; the right term must be
a
a0
) and rearranging.
manipulated algebraically, multiplying by a 1 ( 0
a2 a2
s
x(t ) x0 L1
s 2 a0
a2
a0
v
a
1
0
2
L
a
s 2 a0
a2
a2
a0
a2
to yield
s v0 1 n2
2L 2
x(t ) x0 L1 2
2
2
s n n
s n
With one more algebraic manipulation (distributing the product n2 nn )
s v0n 1 n
2 L 2
x(t ) x0 L1 2
2
2
s n n
s n
s v0 1 n
L 2
x(t ) x0 L1 2
2
2
s n n
s n
We can finally take the two inverse Laplace Transforms to yield the solution x(t)
x (t ) x0 cos n t
v0
sin n t
As predicted, this solution agrees with the solution derived via the Slow ME Way we have validated
this solution, presented some equivalent alternative solution forms, and presented a numerical example
so we neednt repeat this work since it is the same.
132
Let us solve the same general unforced Harmonic Oscillator second-order IVP ODE using
another alternative method: the MATLAB function dsolve. The Problem Statement is again the same:
Solve a2
x(t ) a0 x(t ) 0 for x(t) given a2, a0, and values for the initial conditions
x(0) x0
x(0) v0
The MATLAB code below, contained in VibesDsolve.m, shows how to analytically solve
this second-order IVP ODE using MATLAB function dsolve and display the analytical solution
results to the screen.
%---------------------------------------------------------------% Analytical solution for the second-order Harmonic Oscillator
%
ODE using symbolic MATLAB function dsolve.
%
Dr. Bob, ME 3012
%---------------------------------------------------------------clc;
clear;
syms a0 a2 x0 v0;
x = dsolve(a2*D2x+a0*x=0,Dx(0)=v0,x(0)=x0); % solve
pretty(x)
% display
v0
sin n t
a0
a2
Note MATLAB dsolve can also solve ODEs analytically given numerical parameter and initial
condition values.
133
Given a translational mechanical Harmonic Oscillator, assuming frictionless motion and zero
applied input force, determine and plot the time response to the initial conditions.
Solve
Given
x(0) x0 0.01 m
x(0) v0 0.03 m/s
Solution
This example is solved in MATLAB file SHM.m. From our earlier general second-order
solution, the natural frequency n and SHM response x(t) are:
a0
a2
k
10 2
m
10
rad
sec
Also from earlier derivations, here are the two alternate SHM solutions:
0.5 Hz
2 2
1
1
2 sec
f 0.5
134
From the above time response we clearly see that the vibrational time period is 2 sec, as
calculated. This periodic response oscillates theoretically forever, neither damping down to zero, nor
increasing in magnitude. The sinusoidal wave oscillates symmetrically about the neutral spring location
x = 0. At t = 0, the initial value is 0.01 m as required; further, the slope is non-zero, it is +0.03 m/s as
specified in the problem input (one can zoom in and measure this on the plot). The amplitude of this
oscillatory vibration is A = 0.0138 m, as calculated.
Physically this problem can be viewed as stretching the spring by 0.01 m to the right, and further
imparting an initial velocity of 0.03 m/s, also to the right. The ensuing motion plotted above is the SHM
response to these initial conditions. This homogeneous, or transient response, theoretically vibrates
forever since there is no friction (damping) in the model. In the real world we know that an input force
would be required to maintain such a SHM motion.
135
For a more complete graphical result in this numerical example, we next plot the same
displacement x(t) as above, along with its two derivatives.
v
x(t ) x0 cos nt 0 sin nt
n
x (t ) 0.0100 cos t 0.0095sin t
x (t ) x0n sin nt v0 cos nt
x (t ) 0.0314sin t 0.0300 cos t
2
The amplitudes of the position, velocity, and acceleration curves in this example (Ax, Av, Aa,
respectively) are given below. If n is greater than 1, these amplitudes will increase with differentiation.
v2
0.0138 m
Ax x02 02
n
Av ( x0 n ) 2 v02
0.0434
Aa ( x0 n2 ) 2 ( v0 n ) 2 0.1365
m/s
m/s 2
136
The shaking force for this SHM is plotted below. In shape it is identical to x(t) since
Fshake (t ) kx(t ) ; since k = 102 N/m, the magnitude appears to be about 100x greater than that of x(t)
(k = 98.7 N/m).
137
For this same numerical example, the potential, kinetic, and total mechanical energies are plotted
below, again by MATLAB file SHM.m. .
In this energy plot, the initial potential, kinetic, and total energies are:
1
1
2
V (0) k x(0) 10 2 (0.01)2 0.0049 Nm
2
2
1
1
2
T (0) m v(0) 10(0.03)2 0.0045 Nm
2
2
E (0) V (0) T (0) 0.0049 0.0045 0.0094 Nm
As seen in this plot and as derived earlier, this initial energy E(0) is the value of the total constant
energy throughout this SHM simulation.
1 2
1
kA
10 2 (0.0138) 2 0.0094 Nm
2
2
1
1
E mn2 A2 10 2 (0.0138) 2 0.0094 Nm
2
2
E
Note that the minimum potential and kinetic energies are zero so the energies are never negative.
Both curves are periodically-varying symmetrically about the half-energy value of 0.0047 Nm. Due to
the squaring (position in potential energy and velocity in kinetic energy), the sinusoidal curves for
potential and kinetic energies occur twice as fast. That is, the time period for the energy components is
138
half that of the position, velocity, and acceleration responses, 1 sec instead of 2. The energy
components circular and cyclical frequencies and f are double the circular and cyclical frequencies
and f of the displacement terms.
In the plot above we also see that when the kinetic energy is minimum (zero), the potential
energy is maximum (E) and vice versa. This makes sense because when the spring is fully stretched to
the maximum displacement A, the velocity is instantaneously zero. Conversely, when the potential
energy is zero (at the spring neutral length), the velocity is maximum.
In between the potential and kinetic energies are periodically equal to each other at the halfenergy value. This regularly occurs when:
E 1 2 1 2
kA kxmid
2 4
2
1 2
2
A xmid
2
xmid A
E 1
1 2
mn2 A2 mvmid
2 4
2
1 2 2
2
n A vmid
2
1
0.0098 m
2
vmid An
1
0.0307 m/sec
2
So we see that vmid n xmid in this special equal energies case. This condition first occurs at t = 0.49 sec
and t = 0.99 sec.
139
Let us now repeat this SHM numerical example, with all the same input conditions, except that
the initial velocity should be 0.03 m/s instead of +0.03 m/s.
Solution
The three SHM response solution forms are (the natural frequency is unchanged, ):
Again, this problem can be viewed as stretching the spring by 0.01 m to the right, and further
imparting an initial velocity of 0.03 m/s, this time to the left. We now see that the initial slope is
negative in the plot, as specified.
140
The following two plots (on the same axes), present the time responses for the same numerical
example, with initial condition x0 = 0.01 m only and, separately, initial condition v0 = 0.03 m/sec,
respectively.
We see that the initial-position-only solution is a pure cosine wave starting at x0 = 0.01 m, with
flat slope initially (v0 = 0 m/sec). The initial-velocity-only solution is a pure sine wave with initial slope
v0 = 0.03 m/sec, and zero initial position (x0 = 0 m). Both distinct cases have the same time period of
vibration, T = 2 sec as before, but different amplitudes. The initial-position-only solution amplitude is x0
= 0.01 m, and the initial-velocity-only solution amplitude is v0 / n = 0.0095 m. Clearly if we were
instead to choose negative initial values for the initial-position-only and initial-velocity-only solutions,
the results would be a negative cosine wave, and a negative sine wave, respectively.
141
Finally for this numerical example, we will compare similar initial-position only solution results
but for three systems of differing natural frequency; case 1 is identical to the numerical example and
cases 2 and 3 are new.
case
1
2
3
k (N/m)
102
52 / 2
102 / 9
m (kg)
10
10
10
n (rad/sec)
/2
/3
f (Hz)
1/2
1/4
1/6
T (sec)
2
4
6
In the above graphs we can clearly see the time periods of T = 2, 4, 6, for cases 1, 2, 3,
respectively. The solutions for all three cases are pure cosine waves starting at x0 = 0.01 m, with an
initial flat slope (v0 = 0 m/sec). Comparing the table above with the graphs above, we see that for
greater time periods T, the natural frequency n must be lesser (they are inversely related, n 2 T ).
Also, assuming a constant mass m as in the three cases above, the spring constant k must decrease as n
decreases (they are directly related, k mn2 ). That is, the time period T of vibration increases as the
spring k becomes softer.
The previous three plots were also generated by MATLAB file SHM.m.
142
The original single second-order ODE can be written as a system of two first-order ODEs.
In this example, the state vector is composed of the position and velocity of the output y(t) (originally
called x(t)). Two states are required since we started with one second-order ODE.
143
m
p
n
number of inputs
number of outputs
number of state variables
(m = 1 in this example)
(p = 1 in this example)
(the order of the ODE, n = 2 in this example)
(t ) = AX(t ) + BU(t )
State differential equations: matrix of first-order ODEs X
A
n x n system dynamics matrix
X
n x 1 state vector
B
n x m input matrix
U
p x 1 input vector
D 0 for most physical systems because dynamics appear in all paths from input to output.
For the second-order m-c-k system, m = p = 1, n = 2
0
A k
1
c
0
B1
m
C 1 0
D 0
The current problem is undamped so c = 0 and unforced so f(t) = 0. We will set c to 0 in the A
matrix, but we will not set matrix B to zero since MATLAB function initial already assumes zero
input forcing.
Back to the problem at hand:
Solve:
Given:
x(0) x0 0.01 m
x (0) v0 0.03 m/s
[y,t,x] = initial(SysName,X0);
Initial condition response of state-space models.
Y
output vector
t
time array chosen by MATLAB
x
resulting state vector
SysName
system model composed of A, B, C, D
X0
vector of initial conditions
144
Here is some MATLAB code contained in SHM.m to solve the SHM numerical example using
MATLAB function initial:
clear; clc;
m = 10; k = 10*pi^2;
A = [0 1;-k/m 0];
B = [0; 1/m];
C = [1 0];
D = [0];
mck = ss(A,B,C,D);
X0 = [0.01;0.03];
[y,t,x] = initial(mck,X0);
figure;
plot(t,y); grid; axis([0 6 -0.015 0.015]);
set(gca,FontSize,18);
xlabel({\ittime} ({\itsec}));
ylabel({\itx(t)} ({\itm}));
The plot generated by this MATLAB m-file is identical to that presented earlier in the numerical
example, so it is not repeated here.
145
Solve
Given
MATLAB function ode45 integrates the system of differential equations y = f(t,y) from time
t0 to tfinal with initial conditions Y0.
So we must first express the ODE in the MATLAB-accepted form y = f(t,y), i.e. convert
the single second-order ODE into two first-order ODEs. Define:
x1 (t ) x(t )
x1 (t ) x2 (t )
x2 (t ) x1 (t ) x(t )
k
x2 (t ) x1 (t )
x2 (t )
x1 (t )
x(t )
m
Here is MATLAB m-file OdeToE452.m to solve the unforced second-order ODE numerical example
using MATLAB function ode45.
clear; clc;
[t,x] = ode45(@secund,[0 6],[0.01 0.03]);
figure;
plot(t,x(:,1)); grid;
The function containing the ODE RHS is given below. This function secund.m must be in the
MATLAB search path.
function dx = secund(t,x)
m = 10; k = 10*pi^2;
dx = zeroes(2,1);
% a column vector
dx(1) = x(2);
dx(2) = -(k/m)*x(1);
The plot generated by this MATLAB m-file is identical to that presented earlier in the numerical
example, so it is not repeated here.
146
Given the same translational mechanical Harmonic Oscillator from the previous numerical
examples, find the solution numerically using MATLAB function initial. This function solves
unforced IVP ODE problems numerically. MATLAB function initial only accepts state-space
matrices as inputs for your system, so we must first introduce this concept.
State-space matrices to represent the translational mechanical m-c-k system.
The general forced, damped translational mechanical m-c-k system model is recalled below.
mx(t ) cx (t ) kx (t ) f (t )
where x(t) is the single output displacement and f(t) is the single input force. Define state vector X(t):
x1 (t ) x(t )
x2 (t ) x1 (t ) x(t )
x (t )
X(t ) 1
x2 (t )
so
x (t ) x2 (t )
x(t ) x2 (t )
1
c
k
x2 (t ) x1 (t ) f (t )
m
m
m
y(t ) x(t ) x1 (t )
1 f (t )
k
c
x2 (t )
x2 (t )
m
m
m
* Output algebraic equation
x (t )
y(t ) 1 0 1 0 f (t )
x2 (t )
In this example, the state vector is composed of the position and velocity of the output y(t) (originally
called x(t)). Two states are required since we started with one second-order ODE.
147
m
p
n
number of inputs
number of outputs
number of state variables
(m = 1 in this example)
(p = 1 in this example)
(the order of the ODE, n = 2 in this example)
(t ) = AX(t ) + BU(t )
State differential equations matrix of first-order ODEs X
A
n x n system dynamics matrix
X
n x 1 state vector
B
n x m input matrix
U
m x 1 input vector
D 0 for most physical systems because dynamics appear in all paths from input to output.
For the second-order m-c-k system, m = p = 1, n = 2
0
A k
1
c
m
0
B1
m
C 1 0
D 0
The current problem is undamped so c = 0 and unforced so f(t) = 0. We will set c to 0 in the A
matrix, but we will not set matrix B to zero since MATLAB function initial assumes zero input
forcing.
Back to the problem at hand
Solve
Given
x(0) x0 0.01 m
x(0) v0 0.03 m/s
[y,t,x] = initial(SysName,X0);
Initial condition response of state-space models.
Y
output vector
t
time array chosen by MATLAB
x
resulting state vector
SysName
system model composed of A, B, C, D
X0
vector of initial conditions
148
Here is some MATLAB code contained in SHM.m to solve the SHM numerical example using
MATLAB function initial.
clear; clc;
m = 10; c = 0; k = 10*pi^2;
A = [0 1;-k/m -c/m];
%
B = [0; 1/m];
C = [1 0];
D = [0];
mck = ss(A,B,C,D);
%
X0 = [0.01;0.03];
%
[y,t,x] = initial(mck,X0); %
figure;
plot(t,y); grid; axis([0 6 -0.015 0.015]);
set(gca,FontSize,18);
xlabel({\ittime} ({\itsec}));
ylabel({\itx(t)} ({\itm}));
The plot generated by this MATLAB m-file is identical to that presented earlier in the numerical
example, so it is not repeated here.
149
We can solve the free response to initial conditions for the same undamped second-order ODE
(yielding Simple Harmonic Motion) using MATLABs GUI Simulink. From the MATLAB command
window type simulink and you can create and simulate any dynamic system described by ODEs,
including vibratory systems. Just like MATLAB function initial, we can enter a dynamic system
into Simulink via the state-space matrices given previously for this example.
The Simulink diagram below, SHMFree.mdl, was created to solve this same second-order
SHM free time response to the initial conditions. As shown, the input is a constant zero (free response)
and the output is plotted on a scope.
We double-clicked the State-Space block (see graphic below) to enter the (scalar) matrices
ABCD from the previous numerical example using MATLAB function initial. This is also the place
to enter the initial conditions x(0) = 0.01 and x (0) 0.03 . We entered 6.0 in the final time dialog
window at the top and then just pressed the play button. Double-clicking on the scope then displayed
the simulation results. The resulting plot is identical to that shown previously for the SHM numerical
example (though the Simulink graphics do not look as nice); see the Simulink plot scope on the
following page.
150
Simulink Scope Plot for Undamped SHM Second-Order ODE Free Responses
151
After one obtains the solution to an ODE, the next important step is to check the solution x(t) to
ensure it is correct. We now present two ways to validate the solution, the first partial and the second
complete.
First, we can check the initial conditions of the resulting solution to ensure they are correct. For
the initial position we substitute t = 0 into the function x(t), and for the initial velocity we substitute t = 0
into the function x ( t ) .
x v
x(t ) e nt x0 cos d t 0 n 0 sin d t
d
x v
x (0) e(0) x0 cos(0) 0 n 0 sin(0)
d
x v
x (0) (1) x0 (1) 0 n 0 (0)
d
x (0) x0
x (t ) e nt (C1n C2d ) cos d t (C1d C2n ) sin d t
x (0) e(0) (C1n C2d ) cos(0) ( C1d C2n ) sin(0)
x (0) (C1n C2d )(1) ( C1d C2n )(0)
x (0) x0n
x0n v0
d x0n x0n v0
x (0) v0
So we see both required initial conditions x0 and v0 are achieved by our solution x(t). This is a
weak check, since it only looks at t = 0. A second, stronger solution check is to substitute x(t) and its
first and second derivatives into the original ODE and ensure that an equality results. This is a complete
check. First, since we have the general displacement solution x(t) and its first derivative x ( t ) , we must
x (t ) :
take another time derivative to find
x (t )
Simplifying
152
x (t ) e nt
x (t ) e n t
x (t ) e n t
x(t ) 2n x (t ) n x(t ) 0
n (C1n C2d ) d (C1d C2n ) cos d t
ent
2n ent (C1n C2d ) cos d t (C1d C2n )sin d t n2 ent C1 cos d t C2 sin d t 0
153
After the damped ODE solution x(t) is complete, we can calculate the shaking force for the free
damped cases. Shaking force is defined as the force that impacts the ground link due to the system
dynamics. Redrawing the m-c-k translational mechanical system FBD to include the ground link, we see
that the shaking force has another term due to the damping force, compared to the undamped case.
The general shaking force for the second-order translational mechanical Damped Oscillator is:
Fshake (t ) fS (t ) kx(t ) cx (t )
Shaking force for the underdamped second-order translational mechanical Damped Oscillator:
Fshake (t ) kx(t ) cx (t )
x v
k ent x0 cos d t 0 n 0 sin d t
d
x v
x v
c ent ( x0n 0 n 0 d ) cos d t ( x0d 0 n 0 n )sin d t
d
d
Shaking force for the critically-damped second-order translational mechanical Damped Oscillator:
Fshake (t ) kx (t ) cx (t )
k x0 e n t ( n x0 v0 )te n t c n x0 e n t ( n x0 v0 ) e n t n ( n x0 v0 )te n t
Shaking force for the overdamped second-order translational mechanical Damped Oscillator:
Fshake (t ) kx(t ) cx (t )
s x v
s x v s x v
s x v
k 2 0 0 es1t 1 0 0 es2t c s1 2 0 0 es1t s2 1 0 0 es2t
s2 s1 s2 s1
s2 s1
s2 s1
The shaking force for the undamped case was presented earlier.
154
As mentioned earlier, MATLAB dsolve can also solve IVP ODEs analytically given
numerical parameter and numerical initial condition values. We will demonstrate this now using the
same four damping cases from the numerical example.
Solve
Given
x(0) x0 0.01 m
x(0) v0 0.03 m/s
Given four damping coefficient values c
a. c = 0
N-sec/m
b. c = 18.85 N-sec/m
c. c = 62.83 N-sec/m
d. c = 125.66 N-sec/m
The MATLAB code below, contained in VibesDsolve.m, shows how to analytically solve
these second-order IVP ODEs using MATLAB function dsolve and display the analytical solution
results to the screen.
%---------------------------------------------------------------%
Analytical solution for the second-order Damped Oscillator
%
ODE using MATLAB function dsolve with numerical parameters.
%
Dr. Bob, ME 3012
%---------------------------------------------------------------clc; clear;
xa
xb
xc
xd
=
=
=
=
dsolve(10*D2x+98.696*x=0,
Dx(0)=0.03,x(0)=0.01);
dsolve(10*D2x+18.85*Dx+98.696*x=0, Dx(0)=0.03,x(0)=0.01);
dsolve(10*D2x+20*pi*Dx+10*pi^2*x=0,Dx(0)=0.03,x(0)=0.01);
dsolve(10*D2x+125.66*Dx+98.696*x=0,Dx(0)=0.03,x(0)=0.01);
% solve
XA
XB
XC
XD
=
=
=
=
vpa(xa,4);
vpa(xb,4);
vpa(xc,4);
vpa(xd,4);
% 4 digits
pretty(XA)
pretty(XB)
pretty(XC)
pretty(XD)
% display
155
The four dsolve results are given below, compared with known solutions given earlier.
a.
0.009547 sin(3.141 t) + 0.01000 cos(3.141 t)
x (t ) 0.01cos t 0.0095 sin t
a. Undamped Solution
0
b.
0.01316 exp(-0.9425 t) sin(2.997 t) + 0.01000 exp(-0.9425 t)
cos(2.997 t)
b. Underdamped Solution
0 1
c.
0.01000 exp(-3.142 t) + 0.06142 exp(-3.142 t) t
c. Critically-damped Solution
d.
0.01353 exp(-0.8410 t) 0.003533 exp(-11.72 t)
d. Overdamped Solution
We see that all four dsolve results above are equivalent to their respective known solutions.
156
Given a translational mechanical Damped Oscillator, assuming zero applied input force,
determine and plot the time response to the given initial conditions, for four given damping values c.
This problem is solved in DO.m.
Solve
Given
n
a2
m
10
rad
sec
0.5 Hz
2 2
b. Underdamped Solution 0 1
characteristic polynomial s 2 1.89 s 2
c
18.85
0.3
2 km 2 100 2
roots
1
1
2 sec
f 0.5
0.94 3i
d 3.00
0.48 Hz
2 2
Td
1
1
2.09 sec
fd 0.48
157
c. Critically-damped Solution 1
characteristic polynomial s 2 2 s 2
c
62.83
1
2 km 2 100 2
d. Overdamped Solution 1
characteristic polynomial s 2 12.57 s 2
c
125.66
2
2 km 2 100 2
roots
roots
0 .8 4 , 1 1 .7 3
The plot above shows the x(t) time responses for the four cases in this numerical example,
undamped ( 0 ), underdamped ( 0 1 ), critically-damped ( 1 ), and overdamped ( 1 ).
Physically this problem can be viewed as stretching the spring by 0.01 m to the right, and further
imparting an initial velocity of 0.03 m/s, also to the right, in all four cases. We see that all four curves
158
start at the given initial position x0 = 0.01 m, with the given initial velocity (slope) v0 = 0.01 m/sec. We
see that only the undamped and underdamped cases exhibit vibratory motion, the oscillations caused by
the sin and cos components in their solutions. The critically-damped and overdamped cases do no
oscillate, but approach the final value of zero exponentially after the initial conditions. Further we see
that as the damping coefficient c increases (for the undamped, underdamped, critically-damped, and
overdamped cases), less and less motion is allowed.
The undamped case ( 0 ) characteristic polynomial roots are complex conjugates with zero
real part so there is oscillation but no damping envelope. The time response exhibits Simple Harmonic
Motion, never damping out but oscillating about zero forever, which is impossible in free response in the
real world (there is always some friction).
The underdamped case ( 0 1 ) characteristic polynomial roots are complex conjugates with
negative real part so there is oscillation within a damping envelope. The time response overshoots and
undershoots the final value of zero, with a constantly-decreasing amplitude of vibration.
The critically-damped case ( 1 ) characteristic polynomial roots are real, negative, and
identical. There is no oscillation. The time response to zero is the fastest possible without overshooting
and vibrating.
The overdamped case ( 1 ) characteristic polynomial roots are real, negative, and distinct.
Again, there is no oscillation. The time response to zero is the slower than the critically-damped case.
The table below summarizes the characteristics of the undamped, underdamped, criticallydamped, and overdamped cases in this numerical example. It is very important for the student to learn
these without the need of solving ODEs and without the aid of MATLAB.
Case
a. undamped
c (N-sec/m)
roots
b. underdamped
18.85
0.3
0.94 3i
3.00
c. critically-damped
62.83
NA
125.66
0 .8 4 , 1 1 .7 3
NA
d. overdamped
159
Note in these plots time is implied, i.e. time elapses from the initial conditions (0.01 m, 0.03 m/sec) to
the final position/velocity values (0,0), as we can demonstrate on the plot above. For the undamped
case, there are no final position/velocity values, rather the phase portrait shown is in perpetual motion.
All four cases start at the given initial conditions (0.01 m, 0.03 m/sec) and proceed in a
clockwise direction as time increases. The underdamped, critically-damped, and overdamped cases end
(as time approaches infinity) at the origin (0,0). The underdamped case spirals in to this final value due
to its vibratory oscillations.
160
Underdamped Case
Now let us expand this numerical example to focus on the underdamped case. The plot below
shows five free vibrational time responses for the same exact conditions as this numerical example, with
five different underdamped c values, for comparison purposes.
1. c =
2. c =
3. c =
4. c =
5. c =
6.28
18.85
31.42
43.98
56.55
N-sec/m
N-sec/m
N-sec/m
N-sec/m.
N-sec/m.
All five of these cases have characteristic polynomial roots that are complex conjugates with
negative real part so oscillation within a damping envelope results. We see in the free time responses
below that all five cases exhibit the underdamped property of overshoot and undershoot while damping
to the final value of zero, with a constantly-decreasing amplitude of vibration. Again the initial
conditions, both position and velocity (slope) are evident. The damped natural frequency decreases as
increases, as expected. Therefore, the period of damped vibration increases as increases.
The table below summarizes the characteristics of the above five underdamped cases, for ease of
comparison. As the damping increases we see that the real part n of the roots increases (larger
negative values) while the imaginary part d i of the roots decreases.
161
Case
c (N-sec/m)
roots
1.
6.28
0.1
0.31 3.13i
3.13
2.
18.85
0.3
0.94 3.00i
3.00
3.
31.42
0.5
1.57 2.72i
2.72
4.
43.98
0.7
2.20 2.24i
2.24
5.
56.55
0.9
2.83 1.37i
1.37
The shaking forces for these Damped Oscillators are plotted below. The undamped result is
identical to that presented earlier, but the shaking forces for the underdamped, critically-damped, and
overdamped cases are new.
162
This plot is much more interesting than the shaking force for SHM (undamped, which is repeated
above, which is just an amplification of the response x(t) by k). Due to the effect of the increasing
damping coefficients, the initial shaking force increases more and more for the underdamped, criticallydamped, and overdamped cases, respectively. But the higher the damping, the faster the shaking force
approaches zero as time elapses.
The plot below shows the total energy for the four damping cases in this numerical example.
All four cases start with the same total energy since they have the same initial conditions, the
same mass and spring constant. The undamped cases, shown earlier, maintains constant energy since
there is no damping in this SHM model. In the underdamped, critically-damped, and overdamped cases,
the total energy goes to zero over time in the manner shown above. Due to damping, these latter three
cases no longer have constant total energy, which is more realistic that the SHM case.
The previous three plots were generated by DO.m.
163
Solve
Given
MATLAB function ode45 integrates the system of differential equations y = f(t,y) from time
t0 to tfinal with initial conditions Y0.
So we must first express the ODE in the MATLAB-accepted form y = f(t,y), i.e. convert
the single second-order ODE into two first-order ODEs. Define:
x1 (t ) x(t )
x1 (t ) x2 (t )
x2 (t ) x1 (t ) x (t )
k
c
x2 (t ) x1 (t ) x2 (t )
x2 (t )
x1 (t )
x(t )
m
m
Here is MATLAB m-file ODEToE452.m to solve the unforced second-order ODE numerical example
using MATLAB function ode45.
clear; clc;
[t,x] = ode45(@secund,[0 6],[0.01 0.03]);
figure;
plot(t,x(:,1)); grid;
164
The function containing the ODE RHS is given below. This function secund.m must be in the
MATLAB search path.
function dx = secund(t,x)
m = 10; c = 18.85; k = 10*pi^2;
dx = zeroes(2,1);
% a column vector
dx(1) = x(2);
dx(2) = -(k/m)*x(1) (c/m)*x(2);
The plots generated by this MATLAB m-file, by setting the proper values of c for the undamped,
underdamped, critically-damped, and undamped cases given, are identical to those presented earlier in
the numerical example, so they are not repeated here.
165
1
c
m
0
B1
m
C 1 0
D 0
Given a translational mechanical Damped Oscillator, assuming zero applied input force,
determine and plot the time response to the given initial conditions, for four given damping values c.
Solve
Given
x(0) x0 0.01 m
x(0) v0 0.03 m/s
Given four damping coefficient values c
a. c = 0
N-sec/m
b. c = 18.85 N-sec/m
c. c = 62.83 N-sec/m
d. c = 125.66 N-sec/m
Here is a MATLAB m-file to solve the SHM numerical example using MATLAB function initial.
clc; clear;
m = 10; k = 10*pi^2; ca = 0; cb = 18.85; cc = 62.83; cd = 125.66;
% state space for use with MATLAB function initial
X0 = [0.01;0.03];
% given initial conditions
B = [0; 1/m]; C = [1 0]; D = [0];
% common BCD matrices
% define undamped state-space model and solve IVP
Aa = [0 1;-k/m ca/m]; mcka = ss(Aa,B,C,D); [ya,ta,xa] = initial(mcka,X0);
% define underdamped state-space model and solve IVP
Ab = [0 1;-k/m cb/m]; mckb = ss(Ab,B,C,D); [yb,tb,xb] = initial(mckb,X0);
% define critically-damped state-space model and solve IVP
Ac = [0 1;-k/m cc/m]; mckc = ss(Ac,B,C,D); [yc,tc,xc] = initial(mckc,X0);
% define overdamped state-space model and solve IVP
Ad = [0 1;-k/m cd/m]; mckd = ss(Ad,B,C,D); [yd,td,xd] = initial(mckd,X0);
figure;
plot(ta,ya,k,tb,yb,r,tc,yc,g,td,yd,b); grid; axis([0 6 -0.015 0.015]);
set(gca,FontSize,18);
legend(undamped,underdamped,critically-damped,overdamped);
xlabel({\ittime} ({\itsec})); ylabel({\itx(t)} from initial ({\itm}));
The plot generated by this MATLAB m-file, contained in DO.m, is identical to that presented earlier in
the numerical example, so it is not repeated here.
166
We can solve the free response to initial conditions for the same series of second-order ODEs
(undamped, underdamped, critically-damped, and overdamped) using MATLABs GUI Simulink.
From the MATLAB command window type simulink and you can create and simulate any dynamic
system described by ODEs, including vibratory systems. Just like MATLAB function initial, we
can enter a dynamic system into Simulink via the state-space matrices given previously for this series of
examples.
The Simulink diagram below, SecondFree.mdl, was created to solve this same series of
second-order free time responses to the initial conditions. As shown, all four second-order systems
(differing only in the amount of damping) can be fed by the same input. Then all four time responses
can be plotted on the same scope for ease of comparison, using a multiplexer and double-clicking to
change the default number of signals from two to four.
We used a constant input and double-clicked on it to enter 0 input (for a free response). We
double-clicked the State-Space block to enter the (scalar) matrices ABCD from the previous numerical
example using MATLAB function initial. Once you enter one valid set of ABCD, the remaining
cases may be entered quickly by copying the first block and double-clicking to enter the appropriate
damping value. This is also the place to enter the initial conditions x(0) = 0.01 and x ( 0 ) 0 .0 3 . We
entered 6.0 in the final time dialog window at the top and then just pressed the play button. Doubleclicking on the scope will then display the simulation results. The resulting plots are identical to those
shown previously for the four damping cases (though the Simulink graphics do not look as nice); see the
Simulink plot scope on the following page.
167
168
For a more complete graphical result in this numerical example, we next separately plot on the
next four graphs, the same displacements x(t) as above, along with two derivatives. The first one, for
undamped free SHM using MATLAB file SHM.m, has been presented previously.
x(t ) 0.0100 cos t 0.0095sin t
x (t ) 0.0314sin t 0.0300 cos t
Undamped SHM Numerical Example x(t) and Time Derivatives Time Response
169
Underdamped SHM Numerical Example x(t) and Time Derivatives Time Response
Critically-damped SHM Numerical Example x(t) and Time Derivatives Time Response
170
Overdamped SHM Numerical Example x(t) and Time Derivatives Time Response
Note that if n > 1 then the magnitude of the acceleration is greater than the magnitude of the velocity,
which is greater than the magnitude of the position, in all four cases.
The previous three plots were generated by MATLAB file DO.m.
171
f (t ) F sin t
where F is the forcing function amplitude (N) and is the harmonic forcing circular frequency
(rad/sec), called the driving frequency. Note we can use (t ) sin t for systems with torque input.
We can also use similar harmonic forcing functions for voltage, current, displacement, and other
physical inputs. We will call the generic input u(t). Note that driving frequency is not the same as
natural frequency n (what happens if n ? Stay tuned.)
Now, many vibrations textbooks use f (t ) F cos t instead of our choice using the sine
function. The solution results will be very similar, basically involving a different phase angle for the
steady-state vibrational responses. However, I say the sine choice is a better, more natural one why?
Notice that we do not include a phase angle in the harmonic forcing function above. We could
easily include one that will not change the solution method or complexity. However, since the engineer
has control over the input, we choose to ignore the phase angle.
In this section we will solve all forced ODEs with zero initial conditions. Including non-zero
initial conditions is possible if necessary and this will not change the solution method or complexity.
Section 6.1 presented free vibrational response subject to zero forcing function input and non-zero initial
conditions. This led to transient vibrational response. In this section with harmonic forcing functions
and zero initial conditions, there is a transient response due to the forcing function, in addition to steadystate response also due to the forcing function.
6.2.1 Undamped Second-Order System Harmonically-Forced Responses
This section presents the IVP ODE solution for harmonically-forced undamped second-order
systems. We start with the free-response Harmonic Oscillators from Section 6.1, but add an input
forcing function f (t ) F sin t .
The vibratory motion we will find is the linear superposition of the forced solution at the driving
frequency and the free solution at the natural frequency n.
6.2.1.1 Analytical Undamped Second-Order Harmonically-Forced ODE Solutions
We have seen earlier that different physical system models will lead to the same undamped
externally-forced second-order ODE form.
172
x(t)
k
(t)
g
kR
f(t)
(t)
mx(t ) kx ( t ) f (t )
J (t ) k R (t ) (t )
L
(t)
(t)
m
g
L
(t ) (t ) (t )
The general second-order forced Harmonic Oscillator ODE form can be stated as:
a 2
x (t ) a 0 x (t ) u (t )
Solve a 2
x ( t ) a 0 x ( t ) u ( t ) for x(t) given a2, a0, u ( t ) U sin t , and zero initial conditions
x(0) x0 0
x(0) v0 0
This is the forced initial value problem (IVP) from ordinary differential equations.
Analytical Solution via the Slow ME Way
Taking advantage of linear superposition, the total solution x(t) is the sum of the homogeneous
solution xH(t) plus the particular solution xP(t). The homogeneous solution is the transient response to
the initial conditions and the particular solution is the steady-state response to the external input. There
is also a transient response due to the input forcing function.
1. Homogeneous Solution. The homogeneous solution xH(t) is the solution to the unforced
ODE a 2
x H ( t ) a 0 x H ( t ) 0 and was presented in Section 3.2.1 (we used coefficients Ci in Section
3.2.1, but use Bi here to avoid confusion with the ensuing particular solution):
x H (t ) B1 cos n t B2 sin n t
where n
a0
a2
173
The unknown homogeneous solution coefficients B1 and B2 must remain unknown for now. They will
be found later, by applying the initial conditions to the total solution, after the Particular Solution is
found.
2. Particular Solution. The particular solution xP(t) is the solution to the forced ODE:
a 2
x P (t ) a0 x P (t ) U sin t
and is new in this section. We assume a particular solution form consistent with the form of the
harmonic forcing function u ( t ) U sin t .
xP (t ) C1 sin t C 2 cos t
That is, for the harmonic forcing case with a sine function input and zero phase angle, the particular
solution must allow a non-zero phase angle, expressed above by including a cosine function along with
the sine function. Note that the frequency of the assumed particular solution (both sine and cosine) must
be identical to the driving circular frequency .
The assumed particular solution form and its first two derivatives are:
xP (t ) C1 sin t C2 cost
x P (t ) C1 cos t C2sint
xP (t ) C1 2 sin t C2 2 cos t
Substitute these expressions into the particular equation to obtain:
a2
xP (t ) a0 xP (t ) U sin t
a2 [C1 2 sin t C2 2 cos t ] a0 [C1 sin t C2cost ] U sin t
At this stage we must solve fully for the unknown particular solution constants C1 and C2,
independent of the initial conditions. To do so, we note that the sine terms and the cosine terms in the
above equation must balance separately, yielding two equations in the two particular solution unknowns
C1 and C2.
sin t : a2C1 2 a0C1 U
C1
U
a0 a22
C2 0
U
sin t
a0 a22
174
3. Total Solution. The total solution x(t) is the sum of the homogeneous solution xH(t) and the
particular solution xP(t).
x (t ) x H (t ) x P (t )
x (t ) B1 cos n t B2 sin n t
U
sin t
a0 a2 2
At this stage we apply the given zero initial conditions to the total solution x(t) and its first derivative to
solve for the unknown homogeneous coefficients B1 and B2.
x (0) 0 B1 cos(0) B2 sin(0)
U
sin(0)
a0 a2 2
B1 0
U
cos t
a0 a2 2
U
cos(0)
a0 a2 2
U
n ( a0 a2 2 )
Finally, the general ODE IVP solution for the general undamped second-order case subject to harmonic
forcing is:
x (t )
x (t )
U
U
sin n t
sin t
2
n ( a 0 a 2 )
a 0 a 2 2
U
a0 a2 2
where n
sin n t sin t
a0
a2
Since we solved a linear ODE, there is a unique solution, x(t) above. The first term is a pure sine
wave with the natural frequency n. The second term is a pure sine wave of different amplitude with the
driving frequency . The steady-state solution is vibratory in nature, the sum of both these sine waves,
called the modes of vibration. These two terms are called the two modes of vibration; the first is the
natural (free) mode and the second is the forced mode.
A numerical example for this case is given in this 3012 Supplement, Section 6.2.1.2.
How do we check the x(t) results? See the Solution Validation on the following page, after the
shaking force derivation.
175
After the x(t) solution is complete, we can calculate the shaking force for the forced undamped
case. Shaking force is defined as the force that impacts the ground link due to the system dynamics.
Redrawing the m-k translational mechanical system FBD to include the ground link, we see that it is
easy to calculate the shaking force in this case.
1-dof Forced Translational Mechanical System Free-Body Diagram with Ground Link
In the above FBD, is the spring force fS(t) equal to the input force f(t)? No, due to the vibrational
dynamics. However, the spring force is the shaking force as seen above and it can simply be calculated
from Hookes law, since the spring is massless.
So the shaking force for the second-order translational mechanical Harmonic Oscillator is:
Fshake (t ) fS (t ) kx(t )
kU
sin nt sin t
2
a0 a2 n
After one obtains the solution to an ODE, the next important step is to check the solution x(t) to
ensure it is correct. We now present two ways to validate the solution, the first partial and the second
complete.
First, we can check the initial conditions of the resulting solution to ensure they are correct. For
the initial position we substitute t = 0 into the function x(t), and for the initial velocity we substitute t = 0
into the function x(t ) .
x(t )
U
sin nt sin t
2
a0 a2 n
x (t )
U
( cos nt cos t )
a0 a2 2
x(0)
U
sin(0) sin(0)
2
a0 a2 n
x (0)
U
( cos(0) cos(0))
a0 a2 2
x(0) 0
x (0) 0
So we see both required zero initial conditions are achieved by our solution x(t). This is a weak
check, since it only looks at t = 0. A second, stronger solution check is to substitute x(t) and its second
176
derivative into the original ODE and ensure that an equality results. This is a complete check. First,
here are the displacement solution x(t) and its two time derivatives.
x (t )
U
sin n t sin t
2
a0 a2 n
x (t )
U
( cos n t cos t )
a0 a2 2
x (t )
U
(n sin nt sin t )
a0 a2 2
a0
.
a2
a2
x(t ) a0 x(t ) U sin t
a0U
a2U
sin nt sin t U sin t
sin nt sin t
2 n
2
a0 a2
a0 a2 n
a2U n
a0U
a0U
a2U 2
sin
sin t
sin nt
sin t U sin t
n
2
2
2
2
a0 a2
a0 a2
a0 a2
a0 a2 n
a2U n
a2U 2
a0U
a0U
sin
sin t U sin t
n
2
2
2
2
a0 a2 a0 a2 n
a0 a2 a0 a2
U
a0 a2 2
a0
2
a2n
sin nt (a2 a0 )sin t U sin t
n
U
a0 a2 2
a2n2 a0
a0 a0
U
2
U
(a a2 2 )sin t U sin t
2 0
a0 a2
U sin t U sin t
Since a valid equation results, i.e. U sin t U sin t , this means the unique ODE solution is correct.
177
Let us solve the same general harmonically-forced undamped second-order IVP ODE using an
alternative method: Laplace Transforms. Since we are solving a linear ODE, there is a unique solution,
which we have found using the Slow ME Way and validated by direct substitution.
The Problem Statement is the same:
x(t ) a0 x(t ) u (t ) for x(t) given a2, a0, u(t) U sint , and zero initial conditions
Solve a2
x(0) x0 0
x(0) v0 0
In contrast to the Slow ME Way, ODE solution via Laplace Transforms is accomplished
algebraically in the Laplace frequency domain, in a single step, including the forcing function and initial
conditions.
The first step is to take the Laplace Transform of both sides of the ODE, including the initial
conditions and forcing function, and solving algebraically for the unknown in the Laplace domain,
X(s) L{x(t)}.
L a2
x(t ) a0 x(t ) U sin t
s 2
(a2 s 2 a0 ) X ( s ) U 2
s 2
a2 ( s 2 X ( s ) sx(0) x (0)) a0 X ( s ) U
X ( s)
U
(a2 s a0 )( s 2 2 )
2
Note that the system characteristic polynomial a2s2 a0 appears when using the Laplace
Transform method. To find the solution in the time domain, x(t), we must take the inverse Laplace
Transform of X(s).
x(t ) L1 X ( s)
U
x(t ) L1
2
2
2
(a2 s a0 )( s )
We find no Laplace Transform entries matching this X(s), so we must first perform the Heaviside Partial
Fraction Expansion on X(s) to break it into manageable pieces that are found in the Laplace Transform
Table.
X (s)
C s C
C s C
U
1 2 2 32 24
2
2
(a2s a0 )(s ) (a2s a0 ) (s )
2
178
Where the Heaviside Partial Fraction unknown constants C1, C2, C3, C4 are called the residues. Note
that we break X(s) into a sum of terms each with a single denominator factor from the original. Also
note that the order of each numerator polynomial in s must be one less that the order of its denominator.
If you can factor a denominator into real factors, do so if they are imaginary, do not factor.
Immediately upon breaking apart X(s) into the partial fraction expansion, we express it again over a
common denominator, and equate it to the original X(s).
2
2
2
2
(a2s a0 )(s )
(a2s a0 )(s2 2 )
Equating the numerators we have:
s3 C1 a2C3 0
s 2 C2 a2C4 0
1
2
s1 C1 2 a0C3 0
a2 C1 0
a0 C3 0
1
2
a2 C2 0
a0 C4 U
s0 C2 2 a0C4 U
The solution to the Heaviside Partial Fraction unknown constants C1, C2, C3 (the residues) is:
C1 0
C2
a2U
a0 a22
C3 0
C4
U
a0 a22
X ( s)
C s C4
C1s C2
32
2
(a2 s a0 ) (s 2 )
X ( s)
C2
C
a U
1
U
1
2 4 2 2
2
2
2
2
2
(a2 s a0 ) ( s )
a0 a2 (a2 s a0 ) a0 a2 (s 2 )
1
U
U
X ( s)
2
2
a0 a2 2 a0 (s ) a0 a2 2
s
a2
a0
a2
a0 2 a0 (s 2 2 )
s
a2
a2
179
sin t
s 2
2
a0
a2
U
x (t ) L1 X ( s )
L1
2
a0 a2
a0 2 a0
a2
a2
x (t )
U
a0 a2 2
2
2
(s )
where n
a0
a2
sin n t sin t
n
As predicted, this solution agrees with the solution derived via the Slow ME Way we have validated
this solution and presented a numerical example so we neednt repeat this work since it is the same.
180
Let us solve the same general forced undamped second-order system IVP ODE using another
alternative method: the MATLAB function dsolve. The Problem Statement is again the same:
Solve a2
x(t ) a0 x(t ) U sin t for x(t) given a2, a0, and zero initial conditions
x(0) 0
x(0) 0
The MATLAB code below, contained in VibesDsolve.m, shows how to analytically solve
this second-order IVP ODE using MATLAB function dsolve and display the analytical solution
results to the screen.
%---------------------------------------------------------------% Analytical solution for the forced second-order system
%
ODE using symbolic MATLAB function dsolve.
%
Dr. Bob, ME 3012
%---------------------------------------------------------------clc;
clear;
syms a0 a2 x0 v0;
x = dsolve(a2*D2x+a0*x=U*sin(w*t),Dx(0)=0,x(0)=0); % solve
pretty(x)
% display
U
x(t )
sin nt sin t
2
a0 a2 n
a0
a2
Note MATLAB dsolve can also solve ODEs analytically given numerical parameter and initial
condition values.
181
Solve
Given
m = 10 kg, k = 102 N/m, f (t) F sint 0.5sin8t , and zero initial conditions:
x(0) x0 0 m
x(0) v0 0 m/s
Solution
This example is solved in MATLAB file SecondForce.m. From our earlier general
harmonically-forced second-order solution, the natural frequency n and the forced undamped secondorder system response x(t) are:
a
k
10 2
rad
x(t ) 0.0000804 8sin t sin 8 t
n 0
a2
m
10
sec
The total solution is a linear superposition of two vibratory modes, one of larger amplitude
vibrating at the natural frequency n and a second of smaller amplitude vibrating at the driving
frequency . The associated time periods for these two modes, visible in the plot below, are:
2 2 1
2 2
T sec
Tn 2 sec
8 4
n
182
From the above time response we clearly see that the dominant vibrational time period is Tn = 2
sec, as calculated. Upon this SHM mode is superimposed the forced mode of higher frequency (with
associated T = sec) and smaller amplitude, as seen above. This complicated periodic response
oscillates theoretically forever. The combined sinusoidal waves oscillate symmetrically about the
neutral spring location x = 0. At t = 0, the initial value is 0 m and the slope is also zero, as specified by
the zero initial conditions.
To better understand this time response x(t), the next plot shows the homogeneous and particular
solution components, along with the total solution (same as above).
In this example, there is no transient response as such, since the homogeneous solution does not
disappear given enough time, but continues to vibrate since there is no damping in the model. The
homogeneous solution is not driven by initial conditions, which are zero, but by the sinusoidal input
forcing function f(t).
The separate homogeneous and particular solutions above are called the modes of vibration.
These linearly sum to yield the overall total solution x(t).
183
Below we plot the same x(t) response for the same example as the above two plots, along with its
first and second derivatives. These three are arranged separately on a subplot since their magnitudes are
different; the acceleration is the largest, then the velocity, and the position magnitudes are the smallest.
We see that the acceleration reaches steady-state before the velocity, which reaches steady-state before
the position. We see both initial conditions, i.e. zero initial position and velocity. It also turns out that
the initial acceleration is zero, though this is not specified since it is only a second-order problem. What
are the relationships amongst these plots, from Calculus?
184
Now we plot the same response for the same example as the above three plots, this time showing
the x(t) vs. x(t) phase plot. To emphasize the steady-state behavior (vibratory response to the harmonic
forcing function), the plot below includes time up to 2 sec, instead of 6 sec as before. Since the natural
frequency period is Tn = 2 sec, the phase plot repeats every 2 sec. In this case the natural frequency
period dominates since it is longer than the driving frequency period. How do we interpret this
complicated graph? Where is time on this graph?
185
Let us repeat the above numerical example, only changing the driving frequency .
4 sec
2
The new time response is plotted below.
The natural frequency n is unchanged and the new second-order response x(t) is:
a0
k
10 2
rad
1
x (t ) 0.0068 sin t sin t
n
2
a2
m
10
sec
2
Again the total response is the superposition of the two modes of vibration. But this time the
dominant mode is the driving mode, with T = 4 sec and a larger amplitude, upon which is superimposed
the natural mode with the same time period is Tn = 2 sec as before, and a relatively-lower amplitude
(half). Again, this complicated periodic response oscillates theoretically forever, as long as the input
force is applied. The combined sinusoidal waves oscillate symmetrically about the neutral spring
location x = 0. At t = 0, the initial value is 0 m and the slope is also zero, as specified by the zero initial
conditions.
186
To better understand this time response x(t), the next plot shows the homogeneous and particular
solution components, along with the total solution (same as above).
187
Below we plot the same x(t) response for the same example as the above two plots, along with its
first and second derivatives. These three are arranged separately on a subplot since their magnitudes are
different; the acceleration is the largest, then the velocity, and the position magnitudes are the smallest.
We see that the acceleration reaches steady-state before the velocity, which reaches steady-state before
the position. We see both initial conditions, i.e. zero initial position and velocity. It also turns out that
the initial acceleration is zero, though this is not specified since it is only a second-order problem. What
are the relationships amongst these plots, from Calculus?
188
Now we plot the same response for the same example as the above three plots, this time showing
the x(t) vs. x(t) phase plot. To emphasize the steady-state behavior (vibratory response to the harmonic
forcing function), the plot below includes time up to 4 sec, instead of 8 sec as before. Since the driving
frequency period is T = 4 sec, the phase plot repeats every 4 sec. All plot results above also repeat every
4 sec. In this case the driving frequency period dominates since it is longer than the natural frequency
period . How do we interpret this graph? Where is time on this graph?
All plots in this subsection were generated using MATLAB file SecondForce.m.
189
In a vibrational system with two modes, such as an unforced 2-dof vibrational system, or a
harmonically-forced undamped m-k translational system, whenever the two frequencies of vibration are
close to each other, the resulting x(t) response demonstrates a beat frequency pattern.
For example, let us run the same numerical example from earlier, this time with the driving
frequency closer to the natural frequency n than in the two previous cases.
Solve
m = 10 kg, k = 102 N/m, f (t ) F sin t 0.5 sin 0.9 t , and zero initial
Given
conditions
x(0) x0 0 m
x(0) v0 0 m/s
In this case the driving frequency is = 0.9 rad/sec, much closer to the natural frequency n = than
either of the two previous examples (8 and /2, respectively).
Solution
The natural frequency n is unchanged and the new response x(t) is:
k
rad
x(t ) 0.0267 0.9sin t sin 0.9 t
n
m
sec
The total solution is a linear superposition of the two vibratory modes, whose natural frequency
n and driving frequency are close to each other. Note that the two vibrational mode amplitudes are
also closer to each other since n is closer to 1. The associated steady-state solution time periods for
these two modes are also close.
Tn
2 sec
2
2.22 sec
0.9
190
Forced m-k System Numerical Example x(t) Time Response with Beat Frequency
From the above time response, generated using MATLAB file SecondForce.m, we see that
the beat frequency is a curve with a relatively high frequency vibrating within a sinusoidal envelope of
lower frequency. Note that the maximum amplitude is much higher than the previous two examples,
despite using the same parameters m, k, and the same forcing function amplitude, F = 0.5 N. In 40 sec,
the beat vibration has gone through two complete cycles as shown above.
191
mx(t ) kx (t ) F sin t
Recall that the steady-state solution is (substituting parameters F, k, and m for U, a0, and a2,
respectively, in the general particular solution):
U
F
xP (t )
sin t
sin t
2
a0 a2
k m2
Define the steady-state vibrational amplitude A.
A
F
k m2
Defining r to be the ratio of the driving frequency to the natural frequency n, the amplitude A can be
genericized by the dividing the numerator and denominator by the spring constant k.
F
F k
F k
k
k
r
A
where n
2
2
k m 2
n
m
1 2 1 r
k k
n
The phase angle in the above steady-state solution A sin ( t ) is zero, for r < 1. For r > 1, one way
to account for the negative sign arising due to the denominator of A is to specify that the phase angle is
, that is, 180 .
Plotting the resulting steady-state vibrational amplitude and phase angle vs. frequency is called
the frequency response of the undamped system. Let us plot the normalized, dimensionless, amplitude
M and the phase angle vs. the dimensionless frequency ratio r.
A
1
0
M
tan1
2
2
F k 1 r
1 r
M stands for the amplitude magnification factor, i.e. the calculated amplitude of vibration A compared to
the generic F / k input magnitude. M is dimensionless, e.g. length / length for the translational
mechanical system. The amplitude magnification and phase angle plots are given on the next page,
generated using Resonance.m. We see that for r < 1 the motion is in phase and for r > 1 the motion is
180 out of phase. For r = 1, there is resonance with infinite amplitude and undefined phase angle.
We will present more details on vibrational resonance in the harmonically-forced damped
second-order section to follow.
192
193
The frequency response plots (magnitude and phase angle vs. dimensionless frequency ratio r)
presented above in the Undamped Resonance section do not show the effect of r on the vibratory time
response. Therefore, this is presented on the current page.
Given m = 10 kg, k = 102 N/m, f (t) 0.5sint , and zero initial conditions, the subplots below
give the time response for various values of r n , given in the legend table below.
r = 0.01
r = 0.5
r=2
r = 0.1
r = 0.9999
r=3
All plots have the same horizontal time scale and the same vertical displacement scale for easy
comparison. The r = 0 case yielded a flatline response in MATLAB; hence we used 0.01 to start. The r
= 1 case is the resonant case, yielding NaN in MATLAB; hence we used r = 0.9999 for successful
numerical simulation. This resonant case amplitude goes to given enough time.
For r < 1 we see that the vibratory solution displacement amplitude increases as r increases and
for r > 1 we see that the vibratory solution displacement amplitude decreases as r increases.
194
The vibratory time responses presented on the previous page are the total response x(t). For
clarity this page presents the same vibratory time responses, but for the particular solution only.
r = 0.01
r = 0.5
r=2
r = 0.1
r = 0.9999
r=3
For r < 1 we see that the vibratory solution displacement amplitude increases as r increases and
the frequency of vibration also increases. For r > 1 we see that the vibratory solution displacement
amplitude decreases as r increases, while the frequency of vibration still increases. Also, for r < 1 we
see that the phase angle is zero, while for r > 1 the phase angle is 180 deg.
Again, the r = 1 case is the resonant case with theoretically infinite amplitude. r = 0.9999 is
close, which has an amplitude about 4000x the other cases.
195
Solve
Given
m = 10 kg, k = 102 N/m, f (t) F sint 0.5sin8t , and zero initial conditions
x(0) x0 0 m
x(0) v0 0 m/s
Usage
[tout,yout] = ode45(odefun,tspan,Y0);
odefun
is a function handle to the function containing the ODE right-hand-side.
Tspan
= [t0 tfinal] is the time span
Y0
array of initial conditions on Y.
MATLAB function ode45 integrates the system of differential equations y = f(t,y) from time
t0 to tfinal with initial conditions Y0.
So we must first express the ODE in the MATLAB-accepted form y = f(t,y), i.e. convert
the single second-order ODE into two first-order ODEs. Define:
x1 (t ) x(t )
x1 (t ) x2 (t )
x2 (t ) x1 (t ) x (t )
k
F
x2 (t ) x1 (t ) sin t
x2 (t )
x1 (t )
x(t )
m
m
Here is MATLAB m-file OdeToE452.m to solve the harmonically-forced second-order ODE
numerical example using MATLAB function ode45.
clear; clc;
[t,x] = ode45(@SecundForc,[0 6],[0 0]);
% (fn name, t range, X0)
figure;
plot(t,x(:,1)); grid;
The function containing the ODE RHS is given below. This function SecundForc.m must be in the
MATLAB search path.
function dx = SecundForc(t,x)
m = 10; k = 10*pi^2; F = 0.5; w = 8*pi;
dx = zeroes(2,1);
% a column vector
dx(1) = x(2);
dx(2) = -(k/m)*x(1) + F*sin(w*t)/m;
The plot generated by this MATLAB m-file is identical to that presented earlier in the numerical
example, so it is not repeated here. The same is true for f (t) 0.5sin( / 2)t , and the beat frequency
example f (t) 0.5sin0.9t .
196
B1
C 1 0
D 0
A k
0
m
m
Solve
Given
x(0) v0 0 m/s
[y,t,x] = lsim(SysName,u,t,X0);
time response to arbitrary inputs.
Y
output vector
t
time array chosen by MATLAB (yes, its on both sides)
x
resulting state vector
SysName
system model composed of A, B, C, D
X0
vector of initial conditions if left off, MATLAB assumes zero
Here is some MATLAB code, contained in SecondForce.m, to solve the harmonically-forced firstorder ODE numerical example using MATLAB function lsim:
clear; clc;
m = 10; k = 10*pi^2; F = 0.5; w = 8*pi;
A = [0 1;-k/m 0];
% define ABCD state-space matrices
B = [0; 1/m];
C = [1 0];
D = [0];
mk = ss(A,B,C,D);
% define a state-space model in MATLAB
t = [0:0.01:6];
% time array
f = F*sin(w*t);
% harmonic forcing function
[y,t,x] = lsim(mk,f,t); % solve the forced value problem numerically
% with zero initial conditions
figure;
plot(t,y); grid;
set(gca,FontSize,18);
xlabel({\ittime} ({\itsec}));
ylabel({\itx(t)} from lsim ({\itm}));
The plot generated by this MATLAB m-file is identical to that presented earlier in the numerical
example, so it is not repeated here. The same is true for f (t) 0.5sin( / 2)t .
197
We know that forced undamped second-order system motion is impossible in the real world
since there is always energy loss for all dynamic systems. Therefore, this section presents solution of
the harmonically-forced second-order system model with friction included via a linear damping model.
There are four damping cases to consider: undamped (done in Section 6.2.1), underdamped, criticallydamped, and overdamped. These four distinct damping cases depend on the size of the damping
coefficient relative to the mass m and spring constant k.
6.2.2.1 Analytical Damped Second-Order Harmonically-Forced ODE Solutions
Again, we have seen earlier that different physical system models will lead to the same
externally-forced, damped second-order ODE form.
x(t)
cR
k
cR
f(t)
(t)
kR
(t)
(t)
mx( t ) cx ( t ) kx ( t ) f ( t )
(t)
J (t ) c R (t ) k R (t ) (t )
g
L
(t ) cR(t ) (t ) (t )
x(0) x0 0
x(0) v0 0
This is the forced initial value problem (IVP) from ordinary differential equations.
Analytical Solution via the Slow ME Way
Taking advantage of linear superposition, the total solution x(t) is the sum of the homogeneous
solution xH(t) plus the particular solution xP(t). The homogeneous solution is the transient response to
the initial conditions and the input harmonic forcing function and the particular solution is the steadystate response to the input harmonic forcing function only.
198
1. Homogeneous Solution. Recall from Section 6.1 that the general mechanical
translational m-c-k system can be genericized by using the definitions of natural frequency n (rad/sec)
and dimensionless damping ratio (unitless).
a
k
0
m
a2
a1
c
2 km 2 a0a2
x H ( t ) 2 n x H ( t ) n2 x H ( t ) 0
Recall, for the homogeneous solution, the characteristic polynomial and its roots are:
s 2 2n s n2 0
s1,2 n n 2 1
This yields four distinct cases, considered in detail below: undamped ( = 0), underdamped ( 0 1 ),
critically-damped ( = 1), and overdamped ( > 1).
The homogeneous solution xH(t) and was presented in Section 3.3.1; it is the solution to the
unforced ODE x H (t ) 2 n x H (t ) n2 x H (t ) 0 . There are four cases, summarized below.
undamped
xH (t ) B1 cos nt B2 sin nt
underdamped
critically-damped
xH (t ) B1ent B2tent
overdamped
x H (t ) B1e s1t B2 e s2 t
d n 1 2
s1,2 n n 2 1
The unknown homogeneous solution coefficients B1 and B2 must remain unknown for now. They will
be found later, in applying the initial condition to the total solution, after the Particular Solution is
found. The Particular Solution, presented below, has an identical form for all four damping cases.
2. Particular Solution. The particular solution xP(t) is the solution to the forced ODE:
mxP (t ) cx P (t ) kx P (t ) F sin t
We must assume a particular solution form consistent with the form of the harmonic forcing function
f (t ) F sin t .
xP (t ) C1 sin t C 2 cos t
That is, for the harmonic forcing case with a sine function input and zero phase angle, the particular
solution must allow a non-zero phase angle, expressed above by including a cosine function along with
the sine function form. Note that the frequency of the assumed particular solution form (both sine and
cosine) must be identical to the driving circular frequency .
The assumed particular solution form and its first two derivatives are:
199
xP (t ) C1 sin t C2 cost
x P (t ) C1 cos t C2sint
xP (t ) C1 2 sin t C2 2 cos t
Substitute these forms into the particular equation to obtain:
C2 cost ] F sin t
At this stage we must solve fully for the unknown particular solution constants C1 and C2,
independent of the initial conditions. To do so, we note that the sine terms and the cosine terms in the
above equation must balance separately, yielding two equations in the two particular solution unknowns
C1 and C2.
k m 2
c C1 F
k m 2 C2 0
k m 2
C1
1
2 2
2
C2 (k m ) (c ) c
C1 k m 2
C2 c
c F
k m 2 0
(k m 2 ) F
2 2
2
c F (k m ) (c )
c F
k m 2 0
(k m 2 )2 (c ) 2
xP (t )
F
(k m2 )sin t ccost
2
(k m ) (c)
2 2
An alternate solution form for xP(t) which is mathematically equivalent is found by applying the
sum of angles trigonometric formula for sine.
F
(k m 2 )sin t ccost A sin(t ) A[sin t cos cos t sin ]
(k m ) (c)2
2 2
200
(k m 2 ) F
(k m 2 )2 (c)2
c F
A sin
(k m 2 )2 (c)2
A cos
(k m 2 )F
cF
A cos sin A (1)
2 2
2
2 2
2
(k m ) (c) (k m ) (c)
(k m 2 )2 (c)2 F 2
2
A
2
(k m 2 )2 (c)2
F
A
(k m 2 )2 (c)2
2
c
2
k m
tan1
where we further used the trigonometric identity cos2 sin2 1. So the alternate particular solution
form is:
xP (t ) A sin(t )
F
(k m ) (c )
2 2
atan2 c, k m 2
where atan2 is the MATLAB quadrant-specific inverse tangent function. The input to atan2 must be
(num,den) rather than a single ratio as in the atan case.
Phasor Representation of Particular Solution. Recall from the unforced SHM solution that the
velocity vector v(t) leads the position vector x(t) by 90 and the acceleration vector a(t) leads the
velocity vector v(t) by 90 (thus the acceleration vector a(t) leads the position vector x(t) by 1 8 0 ).
Again using phasor notation for the vectors, the external harmonic input force is:
f (t ) Fe i t
where is the driving frequency. We know that the particular solution position vector x(t) must lag the
input force vector f(t); call this phase angle . Then the position vector phasor is:
x (t ) Ae i ( t )
whose two time derivatives are:
201
x (t ) iA ei (t )
x(t ) i 2 A 2 ei (t ) A 2 ei (t )
We can draw a rotating diagram for the particular solution similar to that of the unforced SHM
solution. This diagram displays the relationship amongst the position, velocity, and acceleration vectors
relative to the input forcing function. The magnitudes are constant, but the XY (i.e. ReIm) components
are always changing due to the continual rotation of this diagram at the constant angular velocity of ,
the driving frequency (see the figure below).
F(t)
v(t) A
A x(t)
a(t)
Rotating Phasor Diagram for Particular Solution
Where is the phase angle lag of the position vector x(t) relative to the excitation force f(t) and A is the
amplitude of the vibration x(t). The mechanical impedances for the mass, damper, and spring elements
are m2, ic, and k, respectively.
Note that for the undamped case, this rotating plane diagram above for the particular solution
collapses to a rotating collinear diagram with = 0.
Generic Expression of Particular Solution. Note the particular solution terms may be converted
to a generic description as follows.
F
k
k m
c
( 2 )2 ( )2
k k
k
c
k
tan 1
k m
2
k k
F
k
2 2 2 2
(1 2 ) (
)
n
n
2
1
tan n 2
1 2
n
Or, defining r to be the ratio of the driven frequency to the natural frequency, r
:
n
202
F k
(1 r 2 )2 (2 r )2
2 r
2
1 r
tan1
3. Total Solution. The total solution x(t) is the sum of the homogeneous solution xH(t) and the
particular solution xP(t).
x(t ) xH (t ) xP (t )
x(t ) xH (t ) A sin(t )
At this stage we must apply the given zero initial conditions to the total solution x(t) to solve for the
unknown homogeneous solution coefficients B1 and B2.
There are four sub-cases to consider in the homogeneous solution, with distinct solutions:
undamped, underdamped, critically-damped, and overdamped. The value of dimensionless damping
ratio , which is in turn dependent on the size of c relative to m and k, defines these four cases. We
solved the undamped case in Subsection 6.2.1 and next will solve only the underdamped case.
Underdamped System Total ODE Solution
In this case we have 0 1 and so the two system characteristic polynomial roots are
complex conjugates with negative real part.
s1,2 n n 2 1 n n (1)(1 2 ) n in 1 2 n id
where the damped frequency d is defined to be d n 1 2 , which is real and has units rad/sec.
The total solution form for x(t) is:
x (t ) xH (t ) xP (t )
x (t ) e nt B1 cos d t B2 sin d t A sin(t )
203
Simplifying using e
(0)
0 B1 A sin
0 n B1 B2d A cos
B2
d
d
Finally, the total x(t) solution for the case of harmonically-forced underdamped motion is
B1 Asin
d n 1 2
where
F
(k m ) (c )
2 2
F k
(1 r ) (2 r )
2 2
B2
c
2 r
tan 1
2
2
k m
1 r
tan 1
204
After the x(t) solution is complete, we can calculate the shaking force for the forced
underdamped case. Shaking force is defined as the force that impacts the ground link due to the system
dynamics. Redrawing the m-k translational mechanical system FBD to include the ground link, we see
that it is easy to calculate the shaking force in this case.
1-dof Forced Translational Mechanical System Free-Body Diagram with Ground Link
In the above FBD, is the spring force fS(t) equal to the input force f(t)? No, due to the vibrational
dynamics. However, the spring force plus the damper force is the shaking force as seen above and it can
simply be calculated from Hookes law and the viscous damper force/velocity relationship, since the
spring and damper are massless.
The general shaking force for the forced second-order translational mechanical Damped Oscillator is:
fS (t ) kx(t ) cx (t )
k ent B1 cos d t B2 sin d t A sin(t )
c x (t ) n ent B1 cos d t B2 sin d t ent B1d sin d t B2d cos d t A cos(t )
where
d n 1 2
B1 Asin
B2
After one obtains the solution to an ODE, the next important step is to check the solution x(t) to
ensure it is correct. We now present two ways to validate the solution, the first partial and the second
complete.
First, we can check the initial conditions of the resulting solution to ensure they are correct. For
the initial position we substitute t = 0 into the function x(t), and for the initial velocity we substitute t = 0
into the function x(t ) .
205
So we see both required initial conditions x0 and v0 are achieved by our solution x(t). This is a
weak check, since it only looks at t = 0. A second, stronger solution check is to substitute x(t) and its
first and second derivatives into the original ODE and ensure that an equality results. This is a complete
check. First, since we have the general displacement solution x(t) and its first derivative x(t ) , we must
x(t ) .
take another time derivative to find
x(t ) e nt B1 cos d t B2 sin d t A sin(t )
x (t ) n e nt B1 cos d t B2 sin d t e nt B1d sin d t B2d cos d t A cos(t )
x(t )
Simplifying
206
Now we have some common terms which look like they may simplify using
k
m
k mn2
c 2 km
d2 n2 (1 2 )
207
2mn c 2mn 2 km
2m 2n2 mn2 k cn
(2mn c)n k k
2 (mn km )
(2mn 2 km )n
2 (mn
2(mn km ) 2n
2(mn
m
km )
m
k
)
m
2 (mn mn )
m
km ) 2n
m
2 (mn m
k 2
) n
m
2(mn mn ) 2n
2(mn m
0
Now our validation simplifies to:
B1 (0)ent cos d t B2 (0)ent sin d t B1d (0)ent sin d t B2d (0)ent cos d t
A[(k m 2 )sin(t ) c cos(t )] F sin t
A[(k m 2 )sin(t ) c cos(t )] F sin t
Let us use the trigonometric sum of angle formulae to work on the left-hand side of the above equation.
cos( a b) cos a cos b sin a sin b
sin( a b) sin a cos b cos a sin b
(k m2 )F
Acos
(k m2 )2 (c)2
A sin
c F
(k m 2 )2 (c )2
Substituting the above formula into the above validation equation, we get
208
c F
(k m 2 ) F
[(k m 2 ) cos t c sin t ]
2 2
2
(k m ) (c )
(k m 2 )2 (c )2
c (k m 2 ) F
(k m 2 )2 F
t
sin
cos t
(k m 2 )2 (c )2
(k m 2 )2 (c )2
c (k m 2 ) F
(c )2 F
cos t
sin t
(k m 2 )2 (c )2
(k m 2 )2 (c )2
(k m 2 )2 F
(c )2 F
sin t
sin t
(k m 2 )2 (c )2
(k m 2 )2 (c )2
[(k m 2 )2 (c )2 ]F
sin t F sin t
(k m 2 )2 (c )2
Since a valid equation results, i.e. F sin t F sin t , this means the unique ODE solution is correct.
This harmonically-forced underdamped x(t) solution was derived with the alternate solution form
for the particular solution, i.e. xP (t ) A sin( t ) . We can also express the homogeneous solution in
this form as follows.
xH (t ) e n t B1 cos d t B2 sin d t Ce n t sin( d t H )
Ce n t sin d t cos H cos d t sin H
C cos H B2
C sin H B1
Solving for the new unknowns C and H:
B
tan H 1
B2
209
where we further used the trigonometric identity cos2 H sin 2 H 1 . In terms of previous parameters:
A(n sin cos )
C B B ( A sin )
2
1
2
2
C A2 sin 2
A sin
tan H
A(n sin cos )
d2
d sin
n sin cos
H tan 1
C
210
As mentioned earlier, MATLAB dsolve can also solve IVP ODEs analytically given
numerical parameter and numerical initial condition values. We will demonstrate this now using the
same four damping cases from the numerical example.
Solve
Given
m = 10 kg, c N-sec/m (see below), k = 102 N/m, f (t) F sint 0.5sin8t , and
zero initial conditions
x(0) x0 0
x(0) v0 0
Given four damping coefficient values c
a. c = 0
N-sec/m
b. c = 18.85 N-sec/m
c. c = 62.83 N-sec/m
d. c = 125.66 N-sec/m
The MATLAB code below, contained in VibesDsolve.m, shows how to analytically solve
these second-order IVP ODEs using MATLAB function dsolve and display the analytical solution
results to the screen.
%--------------------------------------------------------------------%
Analytical solution for the forced second-order system
%
ODE using MATLAB function dsolve with numerical parameters.
%
Dr. Bob, ME 3012
%--------------------------------------------------------------------clc; clear;
xa
xb
xc
xd
=
=
=
=
dsolve(10*D2x+98.696*x=0.5*sin(8*pi*t),
Dx(0)=0,x(0)=0); %solve
dsolve(10*D2x+18.85*Dx+98.696*x=0.5*sin(8*pi*t), Dx(0)=0,x(0)=0);
dsolve(10*D2x+20*pi*Dx+10*pi^2*x=0.5*sin(8*pi*t),Dx(0)=0,x(0)=0);
dsolve(10*D2x+125.66*Dx+98.696*x=0.5*sin(8*pi*t),Dx(0)=0,x(0)=0);
XA
XB
XC
XD
=
=
=
=
vpa(xa,4);
vpa(xb,4);
vpa(xc,4);
vpa(xd,4);
pretty(XA)
pretty(XB)
pretty(XC)
pretty(XD)
% 4 digits
% display
Try this program without the vpa function and you will see why this is necessary.
211
The four dsolve results are given below, compared with known solutions given earlier.
a.
0.0006430 sin(3.141 t) 0.00008039 sin(25.14 t)
Undamped Solution
b.
0.0006725 exp(-0.9425 t) sin(2.997 t)
-5
-5
+ 0.6089 10
exp(-0.9425 t) cos(2.997 t) 0.6093 10
cos(25.14 t)
- 0.00007998 sin(25.14 t)
Underdamped Solution
0.94t
x(t ) e
0 1
( 0.3)
c.
0.00001918 exp(-3.142 t) + 0.001959 exp(-3.142 t) t
- 0.00001918 cos(25.14 t) 0.00007550 sin(25.14 t)
Critically-damped Solution
1
x(t ) (0.0000192 0.002t )e t 0.0000779sin(8 t 2.89)
d.
0.0001826 exp(-0.8410 t) 0.0001501 exp(-11.72 t) 0.00003247
cos(25.14 t)
- 0.00006393 sin(25.14 t)
Overdamped Solution
1
x(t ) 0.000183e
0.84 t
( 2)
0.000150e 11.72t 0.000072sin(8 t 2.67)
We see that all four dsolve results above are equivalent to their respective known solutions.
212
Given a translational mechanical Damped Oscillator, assuming zero initial conditions, determine
and plot the time response to the given externally-applied input harmonic forcing function, for four
given damping values c.
Solve
Given
m = 10 kg, c N-sec/m (see below), k = 102 N/m, f (t) F sint 0.5sin8t , and
zero initial conditions
x(0) x0 0 m
x(0) v0 0 m/s
Given four damping coefficient values c
a. c = 0
N-sec/m
undamped
b. c = 18.85 N-sec/m
underdamped
c. c = 62.83 N-sec/m
critically-damped
d. c = 125.66 N-sec/m
overdamped
Solution
We used MATLAB program SecondForce.m. to obtain all plot results in this subsection. For
all four damping cases, the natural frequency n is:
a0
a2
k
10 2
m
10
rad
sec
a. Undamped Solution 0 this is identical to the Numerical Example presented earlier and
hence the plot is not repeated here. There are two time periods evident in the solution, Tn
based on the natural frequency and T based on the driving frequency.
Characteristic polynomial s2 2
roots
2 sec
2 1
sec
8 4
b. Underdamped Solution 0 1
characteristic polynomial s2 1.89s 2
c
18.85
0.3
2 km 2 100 2
roots
0.94 3.00i
213
1
1
2.09 sec
fd 0.48
2 1
sec
8 4
As seen in the time response plot below for x(t), two modes of vibration are evident. The
transient response has a larger amplitude and longer time period Td. The transient response goes
towards zero given enough time (around 6 sec). The particular solution is superimposed upon this
decaying vibration transient response. It has relatively lower amplitude and faster vibration (shorter
time period T). The particular solution does not decay but remains for as long as the input harmonic
forcing function is applied. At t = 0, the initial value is 0 m and the slope is also zero, as specified by
the zero initial conditions.
214
The next plot shows the same time response x(t), along with the transient (homogeneous) and
steady-state (particular) solutions that superimpose to generate the total solution. This plot more clearly
shows the nature of these solution components that were discussed above. The transient and steady-state
solutions appear to start from zero, but they start from very small numbers (6.0915e-006 and 6.0915e006), negative of each other to provide the overall zero initial position. This plot also shows more
clearly that the steady-state solution has converged to the total solution by t = 6 sec (i.e. the transient
solution is nearly zero by this point in time).
215
Below we plot the same total x(t) response for the same example as the above two plots, along
with its first and second derivatives (different color scheme than the previous page). These three plots
are arranged separately on a subplot since their magnitudes are greatly different; the acceleration is the
largest, then the velocity, and the position magnitudes are the smallest. We see that the acceleration
reaches steady-state before the velocity, which reaches steady-state before the position. We see both
initial conditions, i.e. zero initial position and zero initial velocity. It turns out that the initial
acceleration is also zero, though this is not specified since it is only a second-order problem. What are
the relationships amongst these plots, from Calculus?
216
Now we plot the same response for the same example as the above three plots, this time showing
the x(t) vs. x(t) phase plot. To emphasize the steady-state behavior (vibratory response to the harmonic
forcing function), the plot below includes time up to 20 sec, instead of 6 sec as before. How do we
interpret this complicated graph? Where is time on this graph?
Let us repeat the above underdamped numerical example, changing only the driving frequency
f (t ) F sin t 0.5sin t
2
The associated driven-mode time period T is 16x longer.
T
4 sec
217
The natural frequency n is unchanged and the new second-order response x(t) is:
10 2
rad
n
10
sec
Again the total response is the superposition of the two modes of vibration. But this time the
dominant mode is the driving mode, with T = 4 sec and a larger amplitude, upon which is superimposed
the decaying damped mode with the same time period Td = 2.09 sec as before, and a relatively-lower
amplitude (less than half). Again, this combined periodic response oscillates theoretically forever, as
long as the input force is applied. The transient term dies out, but the steady-state solution continues.
At t = 0, the initial value is 0 m and the slope is also zero, as specified by the zero initial conditions.
The two plots below show the same second underdamped system harmonically-forced example,
first the position, velocity, and acceleration and second the phase plot.
218
219
c. Critically-damped Solution 1
characteristic polynomial s2 2 s 2
c
62.83
1
2 km 2 100 2
roots
2 1
sec
8 4
As seen in the time response plot below for the total x(t), one steady-state mode of vibration is
superimposed onto the non-oscillatory critically-damped transient response. We see that the transient
response disappears (the total solution approaches the steady-state solution) by around 3 sec. The
particular solution remains for as long as the input harmonic forcing function is applied. At t = 0, the
initial value is 0 m and the slope is also zero, as specified by the zero initial conditions.
220
Below we plot the same x(t) response for the same example as the above plot, along with its first
and second derivatives. These three are arranged separately on a subplot since their magnitudes are
greatly different; the acceleration is the largest, then the velocity, and the position magnitudes are the
smallest. We see that the acceleration reaches steady-state before the velocity, which reaches steadystate before the position. We see both initial conditions, i.e. zero initial position and velocity. It also
turns out that the initial acceleration is zero, though this is not specified since it is only a second-order
problem. What are the relationships amongst these plots, from Calculus?
221
Now we plot the same response for the same example as the above two plots, this time showing
the x(t) vs. x(t) phase plot. To emphasize the steady-state behavior (vibratory response to the harmonic
forcing function), the plot below includes time up to 20 sec, instead of 6 sec as before. How do we
interpret this complicated graph? Where is time on this graph?
222
Let us repeat the above critically-damped numerical example, only changing the driving
frequency , with associated driven time period T 16x longer.
2 2
f (t ) F sin t 0.5sin t
4 sec
T
2
The new time response is plotted below.
The natural frequency n is unchanged and the new second-order response x(t) is:
10 2
rad
10
sec
Again in the total time response x(t), one steady-state mode of vibration is superimposed onto the
non-oscillatory critically-damped transient response. We see that the transient response again
disappears (the total solution approaches the steady-state solution) by around 3 sec. The particular
solution remains for as long as the input harmonic forcing function is applied. At t = 0, the initial value
is 0 m and the slope is also zero, as specified by the zero initial conditions.
The two plots below show the same second critically-damped system harmonically-forced
example, first the position, velocity, and acceleration and second the phase plot.
223
224
d. Overdamped Solution 1
characteristic polynomial s2 12.57s 2
c
125.66
2
2 km 2 100 2
2 1
sec
8 4
As seen in the time response plot below for the total x(t), one steady-state mode of vibration is
superimposed onto the non-oscillatory overdamped transient response. We see that the transient
response disappears (the total solution approaches the steady-state solution) by around 6 sec, slower than
the critically-damped case. The particular solution remains for as long as the input harmonic forcing
function is applied. At t = 0, the initial value is 0 m and the slope is also zero, as specified by the zero
initial conditions.
225
Below we plot the same x(t) response for the same example as the above plot, along with its first
and second derivatives. These three are arranged separately on a subplot since their magnitudes are
greatly different; the acceleration is the largest, then the velocity, and the position magnitudes are the
smallest. We see that the acceleration reaches steady-state before the velocity, which reaches steadystate before the position. We see both initial conditions, i.e. zero initial position and velocity. What are
the relationships amongst these plots, from Calculus?
226
Now we plot the same response for the same example as the above two plots, this time showing
the x(t) vs. x(t) phase plot. To emphasize the steady-state behavior (vibratory response to the harmonic
forcing function), the plot below includes time up to 20 sec, instead of 6 sec as before. How do we
interpret this complicated graph? Where is time on this graph?
227
Let us repeat the above critically-damped numerical example, only changing the driving
frequency , with associated driven time period T 16x longer.
2 2
f (t ) F sin t 0.5sin t
4 sec
T
2
The new time response is plotted below.
The natural frequency n is unchanged and the new second-order response x(t) is:
10 2
10
rad
sec
Again in the total time response x(t), one steady-state mode of vibration is superimposed onto the
non-oscillatory critically-damped transient response. We see that the transient response again
disappears (the total solution approaches the steady-state solution) by around 7 sec. The particular
solution remains for as long as the input harmonic forcing function is applied. At t = 0, the initial value
is 0 m and the slope is also zero, as specified by the zero initial conditions.
The two plots below show the same second critically-damped system harmonically-forced
example, first the position, velocity, and acceleration and second the phase plot.
228
229
Solve
Given
m = 10 kg, c (the four values for different damping conditions), k = 102 N/m,
f (t) F sint 0.5sin8t , and zero initial conditions.
x(0) x0 0 m
x(0) v0 0 m/s
Usage
[tout,yout] = ode45(odefun,tspan,Y0);
odefun
is a function handle to the function containing the ODE right-hand-side.
Tspan
= [t0 tfinal] is the time span
Y0
array of initial conditions on Y.
MATLAB function ode45 integrates the system of differential equations y = f(t,y) from time
t0 to tfinal with initial conditions Y0.
So we must first express the ODE in the MATLAB-accepted form y = f(t,y), i.e. convert
the single second-order ODE into two first-order ODEs. Define:
x1 (t ) x(t )
x1 (t ) x2 (t )
x2 (t ) x1 (t ) x(t )
k
c
F
x2 (t ) x1 (t ) x2 (t ) sin t
x2 (t )
x1 (t )
x(t )
m
m
m
Here is MATLAB m-file OdeToE452.m to solve the harmonically-forced second-order ODE
numerical examples using MATLAB function ode45.
clear; clc;
[t,x] = ode45(@SecundForc,[0 6],[0 0]);
figure; plot(t,x(:,1)); grid;
The function containing the ODE RHS is given below. This function SecundForc.m must be in the
MATLAB search path.
function dx = SecundForc(t,x)
m = 10; c = 18.55; k = 10*pi^2; F = 0.5; w = 8*pi; % underdamped
dx = zeroes(2,1);
% a column vector
dx(1) = x(2);
dx(2) = -(k/m)*x(1) + -(c/m)*x(2) + F*sin(w*t)/m;
The plots generated by this MATLAB m-file for each of the four c values are identical to those
presented earlier in the numerical example, so they are not repeated here. The same is true for
f (t) 0.5sin( / 2)t .
230
1
c
m
0
B1
m
C 1 0
D 0
Given a translational mechanical Damped Oscillator, with applied input force f (t) F sint ,
determine and plot the time response x(t), for four given damping values c.
Solve
Given
m = 10 kg, c N-sec/m (see below), k = 102 N/m and zero initial conditions
x(0) x0 0 m
x(0) v0 0 m/s
Given four damping coefficient values c:
a. c = 0
N-sec/m
b. c = 18.85 N-sec/m
c. c = 62.83 N-sec/m
d. c = 125.66 N-sec/m
Here is a MATLAB m-file to solve the SHM numerical example using MATLAB function lsim.
clc; clear;
m = 10; k = 10*pi^2; ca = 0; cb = 18.85; cc = 62.83; cd = 125.66;
% state space for use with MATLAB function lsim
F = 0.5; w = 8*pi; f = F*sin(w*t); % given forcing function
t = [0:0.01:6];
% time array
B = [0; 1/m]; C = [1 0]; D = [0];
% common BCD matrices
% define undamped state-space model and solve IVP
Aa = [0 1;-k/m ca/m]; mcka = ss(Aa,B,C,D); [ya,ta,xa] = lsim(mcka,f,t);
% define underdamped state-space model and solve IVP
Ab = [0 1;-k/m cb/m]; mckb = ss(Ab,B,C,D); [yb,tb,xb] = lsim(mckb,f,t);
% define critically-damped state-space model and solve IVP
Ac = [0 1;-k/m cc/m]; mckc = ss(Ac,B,C,D); [yc,tc,xc] = lsim(mckc,f,t);
% define overdamped state-space model and solve IVP
Ad = [0 1;-k/m cd/m]; mckd = ss(Ad,B,C,D); [yd,td,xd] = lsim(mckd,f,t);
figure;
plot(ta,ya,k,tb,yb,r,tc,yc,g,td,yd,b); grid; axis([0 6 -0.015 0.015]);
set(gca,FontSize,18);
legend(undamped,underdamped,critically-damped,overdamped);
xlabel({\ittime} ({\itsec})); ylabel({\itx(t)} from lsim ({\itm}));
The curves generated by this MATLAB m-file, contained in SecondForce.m, are identical to
those presented earlier in the numerical example, so they are not repeated here.
231
We can solve the forced response to the given input sine wave and zero initial conditions for the
same series of second-order ODEs (undamped, underdamped, critically-damped, and overdamped) using
MATLABs GUI Simulink. From the MATLAB command window type simulink and you can
create and simulate any dynamic system described by ODEs, including vibratory systems. Just like
MATLAB function lsim, we can enter a dynamic system into Simulink via the state-space matrices
given previously for this series of examples.
The Simulink diagram below, SecondForc.mdl, was created to solve this same series of
second-order forced time responses to the given harmonic input. As shown, all four second-order
systems (differing only in the amount of damping) can be fed by the same input sine wave. This time all
four time responses are plotted on separate scopes, since we did not compare all four on the same plot
earlier.
We used a Sine Wave input and double-clicked on it to enter 0.5 amplitude and a driving
frequency of 8. We had the proper State-Space blocks with the four sets of matrices ABCD from the
free (unforced) numerical Simulink example presented earlier. Be sure to also enter the zero initial
conditions [0 0] here. We entered 6.0 in the final time dialog window at the top and then just pressed
the play button. Double-clicking on each scope will then display the simulation results for that damping
case. The resulting plots are identical to those shown previously (though the Simulink graphics do not
look as nice), so they are not repeated here. We repeated this simulation for a driving frequency of / 2
and a final time of 8.0 sec and also got the identical results as previously.
232
xkcd.com
As another practical example, pushing a child on a swing higher and higher is easier when the
external input force of excitation (your pushing) is at the same frequency as the natural frequency of this
pendulum system. You neednt apply excessive force, just time your force inputs to the pendulum
natural frequency, to increase the amplitude of swinging.
Other examples of desired uses of mechanical resonance are in high-quality musical instruments
and breaking a wine glass by a note sung at the correct frequency. Crossing a flexible cable bridge can
be fun if you are the source of the resonant excitation force, or scary if you are the innocent mass simply
trying to cross safely.
As we stated before, resonance in vibrational systems is a potentially big problem. When the
driving frequency of the input forcing function is the same as, or close to, the natural frequency n of
the system, the resulting amplitude of the steady-state vibration becomes very large. Some systems may
be able to harness resonance for good, but generally resonance is something to avoid since it could
damage the system or environment.
The catastrophic destruction of the Tacoma Narrows Bridge in 1940 (Galloping Gertie) is often
put forth as an example of mechanical resonance. Certainly resonance contributed, but, according to
Wikipedia, aeroelastic flutter is now thought as the primary destructive mechanism for that famous
example. Understanding, avoiding, and/or isolating a structure from earthquakes, wind loading, or other
planned or unplanned loading is a major effort in large construction projects.
For the harmonically-forced second-order damped vibrational m-c-k model:
mx(t ) cx (t ) kx (t ) F sin t
233
F
(k m 2 )2 (c )2
c
2
k m
tan1
Defining r to be the ratio of the driving frequency to the natural frequency, these terms can be
genericized by dividing the numerator and denominator of A by the spring constant k. This was done in
detail at the end of the particular solution earlier and the results are summarized below.
F k
(1 r 2 )2 (2 r )2
c
2 km
2 r
2
1 r
tan1
Plotting the resulting steady-state vibrational amplitude and phase angle is called the frequency
response of the system. This demonstrates graphically what happens to the amplitude and phase angle
of vibration as the driving frequency changes (relative to the natural frequency). Let us plot the
normalized amplitude M and the phase angle vs. the dimensionless frequency ratio r.
A
1
F k
(1 r 2 )2 (2 r )2
M stands for the amplitude magnification factor, i.e. the calculated amplitude of vibration A compared to
the generic F / k input magnitude. M is unitless, e.g. length / length for the translational mechanical
system.
234
We see above in the M vs. r part of the frequency response plot that, for the undamped case =
0, the maximum M peak is infinite, at r = 1. The peak M values occur before r = 1 for the damped cases.
The peaks disappear for = 0.707 and higher damping cases.
All plots in this subsection were generated using MATLAB file Resonance.m.
In the vs. r part of the frequency response plot below, for the undamped case = 0, the phase
angle shifts from 0 to 180 to account for the change in sign for M at r = 1, as previously discussed. As
damping increases, this sharp shape is rounded more and more until, at = 0.707, the initial part of the
curve loses its concavity. All curves pass through 90 at r = 1.
235
For sample time responses, see the last three pages of this subsection.
To analyze the normalized amplitude M behavior discussed above, we take the derivative of M
with respect to r, to find the location of the M function extrema.
dM
2r (1 r 2 2 2 )
3
dr
(1 r 2 ) 2 (2 r ) 2 2
dM/dr vs. r
236
The above plot shows the r derivative of M plotted vs. r, for the same cases as before. We
focus on the zero crossings in the above graphical result.
To find the maximum amplification value Mmax for each dimensionless damping ratio , we set
dM
0, which yields
dr
r (1 r 2 2 2 ) 0
whose solution is:
r 1 2 2
This point on each M vs. r curve gives the maximum peak, as long as
The initial point on each M vs. r curve is a local minimum for 0.707 ; for
0.707 it is a maximum point since there is no peak in those cases, as stated
above.
The final point on each M vs. r curve is the global minimum for all cases.
rmax 1 2 2 vs.
The above plot shows the values of r ( rmax 1 2 2 ) for which the maximum peak values of M
are achieved in the damped frequency response. For 0.707 no peak exists since rmax 1 2 2 is
imaginary, as stated above. Also as stated earlier, the location of the maximum peak M for no damping
is r = 1; this is the undamped resonant case with M .
237
To evaluate the maximum peak values for M for the various damping values, substitute
rmax 1 2 2 into M.
M max M (rmax 1 2 2 )
M max
1
4 4 8
4
1
(1 (1 2 ))2 4 2 (1 2 2 )
2
1
4 (1 )
2
1
2 1 2
This result is valid only for 0 0.707 , including for = 0, whose maximum resonant peak
value is infinite, and also for = 0.707, whose maximum peak value is M = 1.0 at r = 0.
In the above Mmax result it is convenient to express it instead in terms of maximum r,
rmax 1 2 2 , that is the r value leading to the maximum peak value for each case.
1
1
M max
2 1 2
1 r2
1 r2
rmax 1 2 2
2
1
2
2
1
1
1
M max
2
2
1 r2
2
2
2
1 r4
1 r 1 r
r
r
(1
)(1
)
2
4
2 2
Plotting this Mmax curve vs. r will intersect all the maximum peak values for all cases. Let us
demonstrate by re-plotting the normalized amplitude M portion of the previous frequency response, this
time with Mmax and finer resolution over the range that has peaks, 0 0.707 .
238
x(t) (m)
The frequency response plots (magnitude and phase angle vs. dimensionless frequency ratio r)
presented in the Damped Resonance subsection above do not show the effect of r on the vibratory time
response. Therefore, we present this on the current page.
Given m = 10 kg, k = 102 N/m, f (t) 0.5sint , and zero initial conditions, the subplots below
give the time response for various values of r n , given in the r values in the legend table below,
for the three values shown in the plot legend (all underdamped).
0.01
0.01
0.005
0.005
-0.005
-0.005
-0.01
0
10
15
20
-0.01
0
= 0.1
= 0.4
= 0.707
10
15
20
10
15
20
10
time (sec)
15
20
0.01
0.02
x(t) (m)
0.005
0
-0.005
x(t) (m)
-0.01
0
-0.02
5
10
15
20
0.01
0.01
0.005
0.005
-0.005
-0.005
-0.01
0
10
time (sec)
15
20
-0.01
0
r = 0.01
r = 0.5
r=2
r = 0.1
r=1
r=3
All plots have the same horizontal time scale and the same vertical displacement scale for easy
comparison (except for the vertical scale of the resonant case, which is 3x bigger than all other plots).
The r = 1 case was the resonant case for zero damping; since there is damping we no longer need to use
r = 0.9999 in MATLAB for successful numerical simulation as in the undamped case. Due to damping,
the amplitude no longer goes to , but the worst amplitude (for = 0.1) is 0.0253 .
For r < 1 we see that the vibratory solution displacement amplitude increases as r increases and
for r > 1 we see that the vibratory solution displacement amplitude decreases as r increases. Also, the
higher the damping is, the lower the vibratory motion amplitudes are.
239
x(t) (m)
The vibratory time responses presented on the previous page are the total response x(t). For
clarity this page presents the same vibratory time responses, but for the particular solution only.
0.01
0.01
0.005
0.005
-0.005
-0.005
-0.01
0
10
15
20
-0.01
0
= 0.1
= 0.4
= 0.707
10
15
20
10
15
20
10
time (sec)
15
20
0.01
0.02
x(t) (m)
0.005
0
-0.005
x(t) (m)
-0.01
0
-0.02
5
10
15
20
0.01
0.01
0.005
0.005
-0.005
-0.005
-0.01
0
10
time (sec)
15
20
-0.01
0
r = 0.01
r = 0.5
r=2
r = 0.1
r=1
r=3
For r < 1 we see that the vibratory solution displacement amplitude increases as r increases and
the frequency of vibration also increases. For r > 1 we see that the vibratory solution displacement
amplitude decreases as r increases, while the frequency of vibration still increases. Also, for r < 1 we
see that the phase angle is zero, while for r > 1 the phase angle is 180 deg.
240
On the previous two pages, the x(t) responses shown for the r = 1 case are not the resonant cases.
As derived in the ME 3012 NotesBook, with damping included, the resonant peaks occur for r < 1. The
maximum magnitude amplification factor M occurs for r 1 2 2 . For dimensionless damping ratios
of = 0.1, 0.4, and 0.707, these resonant r values are r = 0.990, 0.825, and 0, respectively. The figure
below shows the x(t) particular solution responses for the damped resonant cases. Since = 0.707 has
no resonant peak, we instead show = 0.7, with r = 0.141.
0.03
= 0.1, r = 0.990
= 0.4, r = 0.825
= 0.7, r = 0.141
0.02
x(t) (m)
0.01
-0.01
-0.02
-0.03
0
10
time (sec)
12
14
16
18
20
All of these damped resonant amplitudes are somewhat higher than the previously-shown r = 1
cases.
241
6.2.2.5 Transmissibility
An important topic in vibrations and machine design is vibration isolation. For a given
machine, designers specify the mountings (combinations of springs and dashpots) to reduce the shaking
forces and moments on the ground as much as possible. Passive vibration isolation indicates using fixed
components for isolation. Active vibration isolation requires sensors, a processor, actuation, and control
theory, which is much more complicated, but with potential improvements in vibration isolation
compared to the passive case.
Transmissibility is defined as the ratio of the maximum force transmitted to the base over the
maximum input force magnitude and is thus unitless or can be expressed as a percentage. In a good
vibration isolation system, the transmissibility should be low, much less than 1.
Consider the standard forced m-c-k system. Recall from the section on resonance that the
maximum normalized amplitude M is:
A
1
Fk
(1 r 2 )2 (2 r )2
where A is the amplitude of vibration, F is the input sinusoidal force magnitude, and k is the spring
constant. In this system the ground force is transmitted through the spring and dashpot elements. Recall
that the spring and dashpot forces are f S kx(t ) and f D cx (t ) . Further recall that the velocity x (t )
always leads the position x(t) by 90 . Therefore the total maximum transmitted force Ft is:
2
2
2
c
Ft (kA) (cA) kA 1 kA 1
kA 1 2 r
k
n
2
TR
1 (2 r )2
(1 r 2 )2 (2 r )2
Note that this TR result has the same denominator as the M ratio from the resonance discussion, but a
different numerator. Below we plot TR vs. frequency ratio r, for various values.
242
Transmissibility vs. r
We see all curves pass through the same ratio point of 1 at r = 0 and r 2 . From these
graphical results we see that the designer must keep the frequency ratio r as large as possible and the
damping as small as possible to achieve low transmissibility TR 1 .
MATLAB file Transmiss.m was used to generate the above curves.
The vibrational model for a second-order m-c-k system with input displacement u(t) instead of
input external force f(t) is:
mx( t ) cx ( t ) kx ( t ) cu ( t ) ku ( t )
Due to the similarity of these models, the transmissibility TR
X
is identical to the transmissibility
U
Ft
and so the above plot covers the displacement input case also, with the same design
F
conclusions.
TR
243
m1
x(t)
e
t
m2
x(t ) cx(t ) kx(t ) m1e 2 sin t
m2
k
where the unbalanced mass is m1, the total machine mass is m2, e is the effective offset length of the
imbalance, and the equivalent spring and damping coefficients connecting the machine to ground are k
and c, respectively. Following the same method we used for deriving the resonance plots we obtain the
dimensionless ratio E expressing the machine motion relative to the unbalanced motion.
mA
r2
E 2
m1e
(1 r 2 ) 2 (2 r ) 2
This E relationship is plotted below vs. frequency ratio r, for various values.
244
At first this series of plots resembles the resonance plots from before. Two main differences are that the
peaks in E ratios for the various values are to the right of r = 1, rather than to the left, and the final
value asymptote is 1 rather than 0. This means that the machine vibration approaches that of the rotating
imbalance as r increases. Again, r values near resonance are to be avoided due to high output motion.
The transmissibility results for this rotating imbalance case are different than for the two cases
presented previously in the last section. The transmissibility in this case is defined as the force
transmitted to ground through the springs and dashpots, relative to the normalized unbalanced mass.
r 2 1 (2 r ) 2
Ft k
TRU
m1e m2
(1 r 2 )2 (2 r )2
This TRU relationship is plotted below vs. frequency ratio r, for various values.
We see all curves pass through the same transmissibility point of 2 at r 2 . Again, we
desire very low values of transmissibility in the rotating unbalance case, that is we want TRU 1 . In
the TRU plots above we see that all cases will yield T RU 1 , some even yield TRU 1 . For all r
values greater than 1, (and for many r values less than 1), higher damping causes higher transmissibility,
which is undesirable. The best way to limit transmissibility in this case is to minimize the rotating
imbalance m 1 e by balancing the rotating shaft.
MATLAB file Transmiss.m was used to generate the above two plots.
245
In the previous section we considered only periodic harmonic input forcing of the form
f (t) F sint
We could have equally considered periodic harmonic input forcing of the form f (t) F cost . All
derived results would be very similar so we neednt repeat our derivations for the cosine input function.
This section discusses more general input functions for forced vibrations of dynamic systems.
We consider both periodic and non-periodic general input forcing functions. These topics used to be
central in learning classical vibrations, but, with the advent of MATLAB/Simulink, these types of
general input functions are easy to represent using computer simulation. These simulations are much
more accurate and far easier to perform than earlier in history.
Periodic forcing functions used as external inputs to vibratory systems have classically been
represented by the Fourier series. Any periodic forcing function f(t) with a time period of T 2 can
be represented by an infinite Fourier series.
f (t )
a0
a p cos pt b p sin pt
2 p 1
p 1
where
ap
2 T
f (t )cos ptdt
T 0
p 0,1,2,
bp
2 T
f (t )sin ptdt
T 0
p 1,2,
It is up to the engineer to decide how many p terms to include in the series to obtain the desired fidelity
and accuracy.
An alternate form for the Fourier series, suitable for the frequency response, is obtained by using
a familiar transformation (sine sum-of-angles formula); the result is:
f (t ) A0 Ap sin p t p
p 1
where
A0
a0
2
Ap a2p bp2
ap
b p
p tan 1
246
1. Square Wave. Represent the f(t) square wave below by using a Fourier series. The time period
in this example is T 2 sec (thus 2 T 1 rad/sec) and this input repeats periodically as
long as desired. The discontinuous square wave function f(t) is:
f (t) 1
0t
f (t) 1
t 2
Solution.
Evaluating the Fourier series coefficients for this given square-wave and given time period T, we
find the following coefficients.
p 0,1,2,
ap 0
bp
4
p
p 1,3,5,
p 2,4,6,
bp 0
3
5
1
2 2
rad
1
T 2
sec
and the harmonic frequencies of a periodic function, the components contributing to the Fourier series,
are:
p2 p2
rad
p
T
2
sec
p 1,3,5,
Any guitar player knows that harmonic frequencies are integer multiples of the fundamental
frequency for each string.
As shown above, only the odd sine terms are non-zero in the Fourier series for the square wave.
The subplots below show the Fourier series approximation for the given square wave, for p = 1, 7, 13,
19.
247
We see that higher p values represent the discontinuous square wave more faithfully. However,
the harmonic frequencies increase, though with relatively low amplitude, as p increases. Also, the
amount of overshoot shown for p = 19 is no longer decreasing for higher p.
It is pretty cool to animate this in MATLAB demonstrate this using MATLAB file
FourierSeries.m.
2. Saw-Tooth Wave. Represent the f(t) saw-tooth wave below by using a Fourier series. The time
period in this example is again T 2 sec (thus 2 T 1 rad/sec) and this input repeats
periodically as long as desired. The discontinuous saw-tooth wave function f(t) is:
f (t) t
0t
f (t) t 2
t 2
Solution
Evaluating the Fourier series coefficients for this given saw-tooth wave and given time period T,
we find the following coefficients.
248
p 0,1,2,
ap 0
bp
2(1) p 1
p
p 1,2,3,4,
f (t ) 2
2
3
4
1
2 2
rad
1
T 2
sec
p2 p2
rad
p
T
2
sec
p 1,2,3,4,
As shown above, only the sine terms are non-zero in the Fourier series for the saw-tooth wave, in
this case, all p terms (not just the odds as in the square wave). The subplots below show the Fourier
series approximation for the given saw-tooth wave, for p = 1, 4, 7, 10.
249
We see again that higher p values represent the discontinuous saw-tooth wave more faithfully.
However, the harmonic frequencies increase as p increases. Also, the amount of overshoot increases for
increasing p. These plots were generated using MATLAB file FourierSeriesSaw.m.
Fourier Series Frequency Spectrum
We can also represent Fourier Series example results using a frequency spectrum. That is, we
can plot the amplitude A of each Fourier Series component vs. p, the frequency counter for each term.
Remember p = 1 is associated with the fundamental frequency , and p > 1 are the harmonic
frequencies, where p is always an integer. The frequency spectrum plots are given below for the squareand saw-tooth wave examples from before.
Remember for the square wave that only the odd sine terms were active. The plot above shows the
Fourier Series amplitude for each component in the square wave approximation, up to p = 19. The curve
gives the amplitude formula, 4 p , but it is only in effect for the odd integer p values.
250
Remember for the saw-tooth wave that only the sine terms were active, this time odds and evens for p.
The plot above shows the Fourier Series amplitude for each component in the saw-tooth wave
approximation, up to p = 10. The curve gives the amplitude formula, 2 p , but it is only in effect for the
integer p values. Note that the amplitudes A(p) above are shown to be positive only; in the saw-tooth
Fourier Series approximation, all the even terms are negative.
These two plots were generated using MATLAB files FourierSeries.m. and
FourierSeriesSaw.m, respectively.
The 3D plot below shows a diagram to better explain the relationships amongst amplitude, time,
and frequency in sinusoidal functions.
251
The model for a standard m-c-k system with a general input periodic forcing function is:
mx(t ) cx (t ) kx (t ) f (t )
a0
a p cos p t b p sin p t
2 p 1
p 1
Classically, this problem can be solved by utilizing linear superposition, i.e. solving this linear secondorder ODE separately for each of the three forcing terms above, and then adding the three solutions to
obtain the overall solution. In this section, instead, we will use MATLAB/Simulink to solve some
example numerical problems with periodic forcing functions.
Example 1
Solve the following ODEs given that u(t) is a periodic square pulse wave of time period 4 sec,
with a value of 1 for half the cycle and a value of zero for the second half of the cycle (see the yellow
curve below).
As presented earlier, to communicate a system to MATLABs Simulink, we must use state space
matrices. For a first order system, all state-space matrices are scalars:
a. A 5
B 5
C 1
D 0
b. A 1
B 1
C 1
D 0
The Simulink model SquareInput.mdl to simulate the time responses of these two systems
to the given square wave pulse is shown below. The Simulink time response plots are shown next.
252
For case a. the time constant is = 0.2 sec and we see the square wave pulse response does have
time to reach its steady-state value of 1 before the pulse magnitude switches. For case b. the time
constant is = 1 sec and we see the square wave pulse response does not have sufficient time to reach its
steady-state value of 1 before the pulse magnitude switches.
Example 2
Re-solve the case a. ODE from Example 1, given that u(t) is a periodic triangular saw wave of
time period 4 sec, with a value of u(t) = t for the cycle and a discontinuity leading to the next cycle (see
the yellow curve below).
The Simulink model SawInput.mdl to simulate the time responses of this first-order system
a. to the given saw-tooth wave is shown below. The Simulink time response plots are shown next.
253
First-order Response a.
We see that now case a. cannot keep up with the input triangular wave. There is time lag in the response
and the magnitudes do not reach the desired values either at the maximum or minimum saw-tooth
points.
254
Power Supply
255
Inverted Pendulum
256
257
258
RoboCup Player
259
Here the Simulink closed-loop feedback diagram for the 7-cable robot appears to be open (split)
and incomplete; the plant is missing. However, the real-world machine under control serves as the plant
and no model of this plant is required since the real-world behaves as it will, much better than any model
we can construct. So the gap (split) in this diagram is where the real-world plant is (motors outputs to
and sensors readings (stringpots in this example) from the real-world).
The seventh motor is controlled in a different way for tensioning the cables and entire endeffector.
260
Desired Position
Error
Robot
Controller Chassis
Software Routine
PLC Analog
Output Module
DC Motor
Axis 1
PWM
Servo Amp.
PLC Analog
Input Module
20-80 cm Calibration
Function
Actual Position
1-10 VDC
IR Sensor
L1
L2
GND
115 VAC
On
Off
E-Stop
Fuse
MCR1
MCR1
MCR2
Suppresser
Suppresser
Fuse
PLC
MCR1
PWM
Servo Amp.
Axis 1-5
+ 24 VDC
MCR2
Fuse
DC Power Supply
Unregulated
+
40VDC
DC Power Supply
Regulated
Outputs To
Sensors
Switches and
Indicators
Outputs To
Digital
Encoders
+5 VDC
MCR2
COM
261
PC Programming Terminal
Power Supply
+
24 VDC
5 VDC
+
Serial Port
Interface
PLC
PLC
Power
Supply
Space
For
Expansion
Limit &
Control
Switches
LED
Indicators
Ultrasonic
Sensors
(0-10 V)
(1-10 V)
IR
Sensor
(+/- 10 VDC)
PWM
Servo
Amp.
DC Motor
PWM
Servo
Amp.
DC Motor
& Encoder
Axis 2
Axis 1
(+/- 10 VDC)
Encoder Feedback
(+/- 10 VDC)
PWM
Servo
Amp.
DC Motor
& Encoder
Axis 5
Encoder Feedback
262
PLC Cabinet
PLC Interface