www.elsolucionario.net
Chapter 2
Dynamic Models
Problems and Solutions for Section 2.1
1. Write the differential equations for the mechanical systems shown in Fig. 2.38.
Solution:
The key is to draw the Free Body Diagram (FBD) in order to keep the
signs right. For (a), to identify the direction of the spring forces on the
object, let x2 = 0 and Þxed and increase x1 from 0. Then the k1 spring
will be stretched producing its spring force to the left and the k2 spring
will be compressed producing its spring force to the left also. You can use
the same technique on the damper forces and the other mass.
(a)
m1 x
ă1
m2 x
ă2
= −k1 x1 − b1 xú 1 − k2 (x1 − x2 )
= −k2 (x2 − x1 ) − k3 (x2 − y) − b2 xú 2
11
www.elsolucionario.net
12
CHAPTER 2. DYNAMIC MODELS
Figure 2.38: Mechanical systems
www.elsolucionario.net
13
m1 x
ă1
m2 x
ă2
m1 x
ă1
m2 x
ă2
= k1 x1 k2 (x1 − x2 ) − b1 xú 1
= −k2 (x2 − x1 ) − k3 x2
= −k1 x1 − k2 (x1 − x2 ) − b1 (xú 1 − xú 2 )
= F − k2 (x2 − x1 ) − b1 (xú 2 − xú 1 )
2. Write the equations of motion of a pendulum consisting of a thin, 2-kg
stick of length l suspended from a pivot. How long should the rod be in
order for the period to be exactly 2 secs? (The inertia I of a thin stick
about an endpoint is 13 ml2 . Assume θ is small enough that sin θ ∼
= θ.)
Solution:
Let’s use Eq. (2.14)
M = Iα,
www.elsolucionario.net
14
CHAPTER 2. DYNAMIC MODELS
l
2
O
G
mg
Moment about point O.
MO
= −mg ×
=
l
sin θ = IO ă
2
1 2ă
ml
3
ă + 3g sin = 0
2l
As we assumed is small,
ă + 3g = 0
2l
The frequency only depends on the length of the rod
ω2 =
3g
2l
s
2l
=2
3g
T
=
2π
= 2π
ω
l
=
3g
= 1.49 m
2π2
<Notes>
www.elsolucionario.net
15
Figure 2.39: Double pendulum
q
2l
(a) Compare the formula for the period, T = 2π 3g
with the well known
formula for the period
of a point mass hanging with a string with
q
length l. T = 2π gl .
(b) Important!
In general, Eq. (2.14) is valid only when the reference point for
the moment and the moment of inertia is the mass center of the
body. However, we also can use the formular with a reference point
other than mass center when the point of reference is Þxed or not
accelerating, as was the case here for point O.
3. Write the equations of motion for the double-pendulum system shown in
Fig. 2.39. Assume the displacement angles of the pendulums are small
enough to ensure that the spring is always horizontal. The pendulum
rods are taken to be massless, of length l, and the springs are attached
3/4 of the way down.
Solution:
www.elsolucionario.net
16
CHAPTER 2. DYNAMIC MODELS
G1
3
l
4
G2
k
m
3
l sin G1
4
m
3
l sin G 2
4
If we write the moment equilibrium about the pivot point of the left pendulem from the free body diagram,
3
3
M = −mgl sin θ1 − k l (sin θ1 − sin θ2 ) cos 1 l = ml2 ă1
4
4
ml2 ă1 + mgl sin θ1 +
9 2
kl cos θ1 (sin θ1 − sin θ2 ) = 0
16
Similary we can write the equation of motion for the right pendulem
3
3
−mgl sin θ2 + k l (sin θ1 − sin θ2 ) cos θ2 l = ml2 ¨θ2
4
4
As we assumed the angles are small, we can approximate using sin θ1 ≈
θ1 , sin θ2 ≈ θ2 , cos θ1 ≈ 1, and cos θ2 ≈ 1. Finally the linearized equations
of motion becomes,
9
kl (θ1 − θ2 ) = 0
16
9
mlă2 + mg2 + kl (2 1 ) = 0
16
mlă1 + mg1 +
Or
www.elsolucionario.net
17
ă1 + g 1 +
l
g
ă2 + 2 +
l
9 k
(1 θ2 ) = 0
16 m
9 k
(θ2 − θ1 ) = 0
16 m
4. Write the equations of motion for a body of mass M suspended from a
Þxed point by a spring with a constant k. Carefully deÞne where the
body’s displacement is zero.
Solution:
Some care needs to be taken when the spring is suspended vertically in
the presence of the gravity. We deÞne x = 0 to be when the spring is
unstretched with no mass attached as in (a). The static situation in (b)
results from a balance between the gravity force and the spring.
From the free body diagram in (b), the dynamic equation results
mă
x = kx mg.
We can manipulate the equation
m
mă
x = −k x + g ,
k
so if we replace x using y = x +
m
k g,
mă
y = ky
mă
y + ky = 0
www.elsolucionario.net
18
CHAPTER 2. DYNAMIC MODELS
The equilibrium value of x including the effect of gravity is at x = − m
kg
and y represents the motion of the mass about that equilibrium point.
An alternate solution method, which is applicable for any problem
involving vertical spring motion, is to deÞne the motion to be with respect
to the static equilibrium point of the springs including the effect of gravity,
and then to proceed as if no gravity was present. In this problem, we
would deÞne y to be the motion with respect to the equilibrium point,
then the FBD in (c) would result directly in
mă
y = ky.
5. For the car suspension discussed in Example 2.2,
(a) write the equations of motion (Eqs. (2.10) and (2.11)) in state-variable
form. Use the state vector x = [ x xú y yú ]T .
(b) Plot the position of the car and the wheel after the car hits a “unit
bump” (i.e., r is a unit step) using MATLAB. Assume that m1 =
10 kg, m2 = 350 kg, kw = 500, 000 N/m, ks = 10, 000 N/m. Find
the value of b that you would prefer if you were a passenger in the
car.
Solution:
(a) We can arrange the equations of motion to be used in the statevariable form
b
ks
b
kw
kw
ks
x
xỳ +
y+
yỳ
x+
r
m1
m1
m1
m1
m1
m1
ả
à
kw
ks
b
kw
b
ks
+
xỳ +
y+
yỳ +
r
x
=
m1 m1
m1
m1
m1
m1
b
ks
b
ks
x+
xỳ
y
yỳ
yă =
m2
m2
m2
m2
x
ă = −
So, for the given sate vector of x = [ x xú y
form will be,
xú
³ 0
− ks +
x
m1
ă =
yỳ
0
ks
yă
m2
kw
m1
1
0
0
mb1
ks
m1
b
m1
0
ks
m
2
1
mb2
0
b
m2
yỳ ]T , the state-space
0
x
k
w
xú
+ m1 r
0
y
yú
0
(b) Note that b is not the damping ratio, but damping. We need to Þnd
the proper order of magnitude for b, which can be done by trial and
www.elsolucionario.net
19
error. What passengers feel is the position of the car. Some general
requirements for the smooth ride will be, slow response with small
overshoot and oscillation.
Respons e with b = 1000.0
Response with b = 2000.0
1.5
1.5
W heel
Car
W heel
Car
1
1
0.5
0.5
0
0
0
0.5
1
1.5
2
0
Respons e with b = 3000.0
0.5
1
1.5
2
Response with b = 4000.0
1.5
1.5
W heel
Car
W heel
Car
1
1
0.5
0.5
0
0
0
0.5
1
1.5
2
0
0.5
1
1.5
2
From the Þgures, b ≈ 3000 would be acceptable. There is too much
overshoot for lower values, and the system gets too fast (and harsh)
for larger values.
www.elsolucionario.net
20
CHAPTER 2. DYNAMIC MODELS
% Problem 2.5 b
clear all, close all
m1 = 10;
m2 = 350;
kw = 500000;
ks = 10000;
B = [ 1000 2000 3000 4000 ];
t = 0:0.01:2;
for i = 1:4
b = B(i);
F = [ 0 1 0 0; -( ks/m1 + kw/m1 ) -b/m1 ks/m1 b/m1;
0 0 0 1; ks/m2 b/m2 -ks/m2 -b/m2 ];
G = [ 0; kw/m1; 0; 0 ];
H = [ 1 0 0 0; 0 0 1 0 ];
J = 0;
y = step( F, G, H, J, 1, t );
subplot(2,2,i);
plot( t, y(:,1), ’:’, t, y(:,2), ’-’ );
legend(’Wheel’,’Car’);
ttl = sprintf(’Response with b = %4.1f ’,b );
title(ttl);
end
6. Automobile manufacturers are contemplating building active suspension
systems. The simplest change is to make shock absorbers with a changeable damping, b(u1 ). It is also possible to make a device to be placed in
parallel with the springs that has the ability to supply an equal force, u2,
in opposite directions on the wheel axle and the car body.
(a) Modify the equations of motion in Example 2.2 to include such control inputs.
(b) Is the resulting system linear?
(c) Is it possible to use the forcer, u2, to completely replace the springs
and shock absorber? Is this a good idea?
Solution:
(a) The FBD shows the addition of the variable force, u2 , and shows b
as in the FBD of Fig. 2.5, however, here b is a function of the control
variable, u1 . The forces below are drawn in the direction that would
result from a positive displacement of x.
www.elsolucionario.net
21
m1 x
ă = b (u1 ) (yỳ x)
ỳ + ks (y − x) − kw (x − r) − u2
m2 yă = ks (y x) b (u1 ) (yú − x)
ú + u2
(b) The system is linear with respect to u2 because it is additive. But
b is not constant so the system is non-linear with respect to u1 because the control essentially multiplies a state element. So if we add
controllable damping, the system becomes non-linear.
(c) It is technically possible. However, it would take very high forces
and thus a lot of power and is therefore not done. It is a much better solution to modulate the damping coefficient by changing oriÞce
sizes in the shock absorber and/or by changing the spring forces by
increasing or decreasing the pressure in air springs. These features
are now available on some cars... where the driver chooses between
a soft or stiff ride.
7. Modify the equation of motion for the cruise control in Example 2.1,
Eq(2.4), so that it has a control law; that is, let
u = K(vr − v)
(124)
= reference speed
= constant.
(125)
(126)
where
vr
K
This is a ‘proportional’ control law where the difference between vr and
the actual speed is used as a signal to speed the engine up or slow it down.
Put the equations in the standard state-variable form with vr as the input
and v as the state. Assume that m = 1000 kg and b = 50 N · s / m, and
Þnd the response for a unit step in vr using MATLAB. Using trial and
error, Þnd a value of K that you think would result in a control system in
which the actual speed converges as quickly as possible to the reference
speed with no objectional behavior.
Solution:
www.elsolucionario.net
22
CHAPTER 2. DYNAMIC MODELS
vú +
1
b
v= u
m
m
substitute in u = K (vr − v)
vú +
1
K
b
v= u=
(vr − v)
m
m
m
A block diagram of the scheme is shown below where the car dynamics
are depicted by its transfer function from Eq. 2.7.
vr
+
-
5
1
m
u
K
s+
v
b
m
The state-variable form of the equations is,
vỳ
=
y
= v
à
b
K
+
m m
ả
v+
K
vr
m
so that the matrices for Matlab are
F
= −
µ
K
b
+
m m
K
m
= 1
= 0
G =
H
J
For K = 100, 500, 1000, 5000 We have,
www.elsolucionario.net
¶
23
Step Res pons e
From: U(1)
1
0.9
0.8
K =500
K= 1000
0.7
To: Y (1)
A m plitude
0.6
K = 5000
0.5
K =100
0.4
0.3
0.2
0.1
0
0
5
10
15
20
25
30
35
40
Tim e (sec .)
We can see that the larger the K is, the better the performance, with no
objectionable behaviour for any of the cases. The fact that increasing K
also results in the need for higher acceleration is less obvious from the
plot but it will limit how fast K can be in the real situation because the
engine has only so much poop. Note also that the error with this scheme
gets quite large with the lower values of K. You will Þnd out how to
eliminate this error in chapter 4 using integral control, which is contained
in all cruise control systems in use today. For this problem, a reasonable
compromise between speed of response and steady state errors would be
K = 1000, where it responds is 5 seconds and the steady state error is 5%.
www.elsolucionario.net
24
CHAPTER 2. DYNAMIC MODELS
% Problem 2.7
clear all, close all
% data
m = 1000;
b = 50;
k = [ 100 500 1000 5000 ];
% Overlay the step response
hold on
for i=1:length(k)
K=k(i);
F = -(b+K)/m;
G = K/m;
H = 1;
J = 0;
step( F,G,H,J);
end
Problems and Solutions for Section 2.2
8. In many mechanical positioning systems there is ßexibility between one
part of the system and another. An example is shown in Figure 2.6
where there is ßexibility of the solar panels. Figure 2.40 depicts such a
situation, where a force u is applied to the mass M and another mass
m is connected to it. The coupling between the objects is often modeled
by a spring constant k with a damping coefficient b, although the actual
situation is usually much more complicated than this.
(a) Write the equations of motion governing this system, identify appropriate state variables, and express these equations in state-variable
form.
(b) Find the transfer function between the control input, u, and the
output, y.
Solution:
(a) The FBD for the system is
www.elsolucionario.net
25
Figure 2.40: Schematic of a system with ßexibility
which results in the equations
mă
x = k (x y) b (xỳ y)
ỳ
M yă = u + k (x y) + b (xú − y)
ú
Let the state-space vector x = [ x xú y
yú ]T
k
b
k
b
x − xú + y + yỳ
m
m
m
m
k
b
k
b
1
x+
xỳ
y
yỳ +
u
M
M
M
M
M
x
ă =
yă =
So,
0
xỳ
x
k
ă
m
yỳ = 0
k
yă
M
1
b
m
0
b
M
0
0
k
m
b
m
0
k
M
1
b
M
x
0
xỳ 0
y + 0
1
yú
M
u
(b) We have the complete state-variable form from part a. We will learn
the systematic way to convert from the state-variable form to transfer
function later in chapter 7. If we make Laplace Transform of the
equations of motion
k
b
k
b
X + sX − Y − sY
m
m
m
m
k
k
b
b
− X−
sX + s2 Y +
Y +
sY
M
M
M
M
s2 X +
= 0
1
U
M
=
In matrix form,
·
ms2 + bs + k
− (bs + k)
− (bs + k)
M s2 + bs + k
¸·
X
Y
¸
www.elsolucionario.net
=
·
0
U
¸
26
CHAPTER 2. DYNAMIC MODELS
From Cramer’s Rule,
Y
=
=
·
¸
ms2 + bs + k 0
− (bs + k)
U
·
¸
2
ms + bs + k
− (bs + k)
det
− (bs + k)
M s2 + bs + k
det
ms2 + bs + k
(ms2 + bs + k) (M s2 + bs + k) − (bs + k)2
U
Finally,
Y
U
=
=
ms2 + bs + k
(ms2 + bs + k) (M s2 + bs + k) − (bs + k)
ms2 + bs + k
mM s4 + (m + M )bs3 + (M + m)ks2
2
9. For the inverted pendulum, Eqs. (2.34),
(a) Try to put the equations of motion into state-variable form using the
state vector x = [ θ θú x xú ]T . Why is it not possible?
(b) Write the equations in the “descriptor” form
Ex˙ = F0 x + G0 u,
and deÞne values for E, F0 , and G0 (note that E is a 4 × 4 matrix).
Then show how you would compute F and G for the standard statevariable description of the equations of motion.]
Solution:
(a) It is impossible because the acceleration terms are coupled.
(b)
1
0
0 I + mp l2
0
0
0
mp l
ỳ
0
0
ă
0
mp l
xỳ
1
0
0 mt + mp
x
ă
0
mp gl
=
0
0
Ex = F0 x + G0 u
x˙ = E−1 F0 x + E−1 G0 u
F = E−1 F0 , G = E−1 G0
www.elsolucionario.net
1
0
0
0
θ
0 0
θú
0 0
0 1 x
0 −b
xú
0
0
+ u
0
1
27
10. The longitudinal linearized equations of motion of a Boeing 747 are given
in Eq. (9.28). Using MATLAB or other computer aid:
(a) Determine the response of the altitude h for a 2-sec pulse of the elevator with a magnitude of 2◦ . Note that, since Eq. (9.28) represents
a set of linearized equations, the state variables actually represent
the deviation of the state from the nominal operating point. For
example, h represents the amount the altitude of the aircraft differs
from 20,000 ft.
(b) Consider using the feedback law
δ e = Kh h + δ e,ext
(127)
where the elevator input angle is the sum of a term proportional
to the error in altitude h plus an external input (a disturbance or
command input). Note from part (a) that a positive change in
elevator causes a negative change in altitude, so that the proposed
proportional feedback law has the logical sign to anticipate a stable
system provided Kh > 0. By trial and error, try to Þnd a value for
the feedback gain Kh such that a 2◦ pulse of 2 sec on δ e,ext yields a
more stable altitude response.
(c) If you have trouble Þnding a value of Kh that produces a stable
response, try modifying the feedback law to include information on
pitch rate q :
δ e = Kh h + Kq q + δ e,ext
(128)
Use trial and error to pick appropriate values for both Kh and Kq .
Assume the same type of pulse input for δ e,ext as in part (b).
(d) Show that the further introduction of pitch-angle feedback, θ, such
that
δ e = Kh h + Kq q + Kθ θ + δ e,ext
(129)
allows you to decrease the time it takes for the altitude to settle back
to its nominal value, as well as to decrease the value of Kh required
for a stable response. Note that, although Kh = 0 produces stable
altitude behavior, we require Kh > 0 in order to guarantee that
h → 0 (so there will be no steady-state error).
Solution:
www.elsolucionario.net
28
CHAPTER 2. DYNAMIC MODELS
2 deg. pulse applied between t = 1 and t =3 sec.
50
0
-50
-100
-150
-200
-250
-300
-350
0
1
2
3
4
5
6
7
8
9
(a)
@ e, ext
+
5
@e
u , w, q,G , h
G
+
D
(b) Requires 0 < Kh <∼ 10−6 for stability, but yields very large oscillatory altitude variations.
(c) Numbers like Kh < 0.001 and Kq > 300 yields somewhat reasonable
altitude behavior ( altitude variations are stable and on the order
of a few hundred feet), but settling time is on the order of tens of
minutes.
(d) Kh = 0.005, Kθ = 25, and Kq = 10 (for example) yield maximum
altitude deviation of less than 50ft, plus a settling time of about 30
www.elsolucionario.net
10
29
second.
clear all, close all
F = [ -0.00643 0.0263 0 -32.2 0;
-0.0941 -0.624 820 0 0;
-0.000222 -0.00153 -0.668 0 0;
0 0 1 0 0;
0 -1 0 830 0 ];
G = [ 0; -32.7; -2.08; 0; 0 ];
J = 0;
x0 = [ 0; 0; 0; 0; 0 ];
% part a.
Hh = [ 0 0 0 0 1 ];
[ num, den ] = ss2tf( F, G, Hh, J );
sysa = tf( num, den );
T = 0:0.01:10;
u = (2/180*pi)*rectpuls( (T-2)/2 );
ya = lsim( sysa, u, T, x0 );
Þgure(1)
plot(T,ya)
title(’ 2 deg. pulse applied between t = 1 and t =3 sec. ’);
Problems and Solutions for Section 2.3
11. A Þrst step toward a realistic model of an op amp is given by the equations
below and shown in Fig. 2.41.
Vout
i+
107
[V+ − V− ]
s+1
= i− = 0
=
(a) Find the transfer function of the simple ampliÞcation circuit shown
using this model.
Solution:
(a) As i− = 0,
Vin − V−
V− − Vout
=
Rin
Rf
V− =
Rf
Rin
Vin +
Vout
Rin + Rf
Rin + Rf
www.elsolucionario.net
30
CHAPTER 2. DYNAMIC MODELS
Figure 2.41: Circuit for Problem 11.
Figure 2.42: Circuit for Problem 12.
Vout
107
[V+ V ]
s+1
ả
à
107
Rf
Rin
=
Vin
Vout
V+
s+1
Rin + Rf
Rin + Rf
ả
à
7
10
Rin
Rf
=
Vin +
Vout
s + 1 Rin + Rf
Rin + Rf
=
R
f
−107 Rin +R
Vout
f
=
in
Vin
s + 1 + 107 RinR+R
f
12. Show that the op amp connection shown in Fig. 2.42 results in Vo = Vin
if the op amp is ideal. Give the transfer function if the op amp has the
non-ideal transfer function of Problem 2.11.
Solution:
www.elsolucionario.net
31
Figure 2.43: Circuit for Problem 13.
Ideal case:
Vin
V+
V−
= V+
= V−
= Vout
Non-ideal case:
Vin = V+ , V− = Vout
but,
V+ 6= V−
instead,
Vout
=
=
107
[V+ − V− ]
s+1
107
[Vin − Vout ]
s+1
so,
107
107
Vout
107
∼
= s+1107 =
=
Vin
s + 1 + 107
s + 107
1 + s+1
13. Show that, with the non-ideal transfer function of Problem 2.11, the op
amp connection shown in Fig. 2.43 is unstable.
www.elsolucionario.net
32
CHAPTER 2. DYNAMIC MODELS
Figure 2.44: Op Amp circuit for Problem 14.
Solution:
Vin = V− , V+ = Vout
Vout
107
[V+ − V− ]
s+1
107
[Vout − Vin ]
s+1
=
=
Vout
=
Vin
107
s+1
107
s+1 −
1
=
−107
107
∼
=
−s − 1 + 107
s − 107
The transfer function has a denominator with s − 107 , and the minus sign
means the exponential time function is increasing, which means that it
has an unstable root.
14. A common connection for a motor power ampliÞer is shown in Fig. 2.44.
The idea is to have the motor current follow the input voltage and the
connection is called a current ampliÞer. Assume that the sense resistor,
Rs is very small compared with the feedback resistor, R and Þnd the
transfer function from Vin to Ia .
Solution:
www.elsolucionario.net
33
[Note to Instructors: You might want to assign this
problem with Rf = ∞,meaning no feedback from the
output voltage.]
At node A,
Vin − 0 Vout − 0 VB − 0
+
+
=0
Rin
Rf
R
(130)
At node B, with Rs ¿ R
Ia +
0 − VB
0 − VB
+
R
Rs
VB
VB
= 0
(131)
RRs
Ia
R + Rs
≈ Rs Ia
=
The dynamics of the motor is modeled with negligible inductance as
Jm ăm + bỳ m = Kt Ia
Jm sΩ + bΩ = Kt Ia
(132)
At the output, from Eq. 131. Eq. 132 and the motor equation Va =
Ia Ra + Ke sΩ
Vo
= Ia Rs + Va
= Ia Rs + Ia Ra + Ke
Kt Ia
Jm s + b
Substituting this into Eq.130
·
¸
1
Vin
Ia Rs
Kt Ia
+
Ia Rs + Ia Ra + Ke
+
=0
Rin
Rf
Jm s + b
R
This expression shows that, in the steady state when s → 0, the current
is proportional to the input voltage.
If fact, the current ampliÞer normally has no feedback form the output
voltage, in which case Rf → ∞ and we have simply
Ia
R
=−
Vin
Rin Rs
15. An op amp connection with feedback to both the negative and the positive
terminals is shown in Fig 2.45. If the op amp has the non-ideal transfer
function given in Problem 11, give the maximum value possible for the
r
positive feedback ratio, P =
in terms of the negative feedback
r+R
Rin
for the circuit to remain stable.
ratio,N =
Rin + Rf
www.elsolucionario.net
34
CHAPTER 2. DYNAMIC MODELS
Figure 2.45: Op Amp circuit for Problem 15.
Solution:
Vout − V−
Vin − V−
+
Rin
Rf
Vout − V+ 0 − V+
+
R
r
V−
V+
Vout
=
=
= 0
= 0
Rf
Rin
Vin +
Vout
Rin + Rf
Rin + Rf
= (1 − N ) Vin + N Vout
r
=
Vout = P Vout
r+R
=
107
[V+ − V− ]
s+1
107
[P Vout − (1 − N ) Vin − N Vout ]
s+1
www.elsolucionario.net