Professional Documents
Culture Documents
Solutions 3
Solutions 3
1. Part (A) of the figure depicts a body of mass M = 1kg connected to the ground
through a spring of stiffness k = 3000 N/m and a linear damper with damping
constant c = 100 N m−1 s. Provide a linear model in state-space form for this
device, choosing as state variables the vertical position y(t) and velocity ẏ(t) of the
body (let y = 0 when the body is at the equilibrium position). Now suppose that
at time t = 0 the body is still at the equilibrium position, and at time t0 = 1s we
put a second body of mass m = 0.2kg above the device. Model this as an input
force. What will the position of the body be after the device has returned to steady
state? Verify it by simulating the evolution of the system in Matlab.
2. Part (B) of the figure depicts the orbit of the Earth around the Sun. Provide a
nonlinear dynamical model for the motion of the Earth, taking as state variables
the components of its position and velocity with respect to the center of the Sun.
To simplify matters, ignore the motion of the Moon (just consider Earth and Moon
as a unique body) and the presence of the other planets; you may also want to take
into account that the motion is planar, with good approximation. Suppose that the
initial position of the Earth is at the perihelion (the point of its trajectory which is
closest to the Sun). Based on the data in the table below (taken from Wikipedia),
find a realistic initial velocity, exploiting conservation of angular momentum and
conservation of energy. Simulate one year of motion (Warning: choose a reasonable
sampling time for the ODE solver!). Does the Earth return to its initial state at the
end of the year?
1
Quantity Symbol Value
Mass of the Sun M 1.9891 × 1030 kg
Mass of the Earth m 5.9736 × 1024 kg
Mass of the Moon µ 7.3477 × 1022 kg
Perihelion r 147098290 km
Aphelion R 152098232 km
Gravitational constant γ 6.67300 × 10−11 m3 kg −1 s−2
Solution 1.
1. The equation is found by writing down the equations of dynamics and balancing all
the forces that act on M . At the equilibrium position, the initial displacement of the
spring produces a force which is exactly balanced by the gravitational force acting
on M . Since y(t) is the displacement from the resulting equilibrium, the Newton
differential equation is obtained by balancing the remaining forces:
or
c k
ÿ(t) + ẏ(t) + y(t) = 0
M M
When the second body is added, the equation (that is, the model) changes, and
becomes
or
c k mg
ÿ(t) + ẏ(t) + y(t) = −
M +m M +m M +m
At the new steady state, we have ÿ = ẏ = 0, hence
−mg
y=
k
(note that it does not depend on M ). If m << M , we can approximate the new
equation as
c k mg
ÿ(t) + ẏ(t) + y(t) = − = u(t)
M M M
(thus modeling the little weight just as a “step” input), and the steady state would
remain exactly the same. The latter model can be put in state-space form:
ẏ(t) 0 1 y(t) 0
= + u(t)
v̇y (t) −k/M −c/M vy (t) 1
2
2. We model the motion of Earth (or better, the Earth-Moon system) as the trajectory
of a 4-dimensional state-space nonlinear system choosing as coordinates the position
(x, y) in the Cartesian plane, and the velocity (vx , vy ). Projecting the gravitational
force onto the coordinate axes (via an intermediate switch to polar coordinates), we
obtain the system equation as follows:
˙ = f (ξ(t))
ξ(t)
vx (t) vx (t)
ẋ(t)
ẏ(t) vy (t) vy (t)
v̇x (t) = =
γM (m+µ) γM (m+µ)
− ρ2 (t) cos(ϕ(t)) − x2 (t)+y2 (t) cos(atan2(x(t), y(t)))
v̇y (t) − γMρ(m+µ)
2 (t) sin(ϕ(t)) − xγM (m+µ)
2 (t)+y 2 (t) sin(atan2(x(t), y(t)))
Plugging in the data found in the above table and solving for v, V , one finds in
particular v ' 30289 m/s. By symmetry, since x(t) has a maximum at the perihelion
if the coordinates are choosen as in the figure, whenever x = r it must hold vx = 0;
Hence v = vy , and an appropriate initial condition is ξ0 = [r, 0, 0, v]> .
can be put in state-space form (where u(t) plays the role of an input).
Assume that the input u(t) is constant on each interval of the form [kT, (k + 1)T ),
i.e. u(t) = uk for t ∈ [kT, (k + 1)T ). Consider the situation where the output of
the system is sampled every T time units, i.e. it is observed through the sequence
y0 = y(0), y1 = y(1T ), ..., yk = y(kT ), .... By appropriately defining a sequence {ξk },
3
show that the sampled system can be viewed as a time-varying discrete time linear
system:
ξk+1 = Āk ξk + B̄k uk
yk = C̄k ξk + D̄k uk
Provide an expression for (Āk , B̄k , C̄k , D̄k ) as a function of (A(t), B(t), C(t), D(t)).
Solution 2.
1. Let
x0 (t) := y(t)
x1 (t) := ẏ(t) = ẋ0 (t)
x2 (t) := ÿ(t) = ẋ1 (t)
..
.
xn−1 (t) := y (n−1) (t) = ẋn−2 (t)
Then we have
ẋn−1 (t) = y (n) (t)
= −an−1 y (n−1) − · · · − a1 ẏ(t) − a0 y(t) + u(t)
= −an−1 xn−1 − · · · − a1 x1 (t) − a0 x0 (t) + u(t)
Putting together these equalities, we obtain
ẋ0 (t) 0 1 0 ··· 0 0 x0 (t) 0
ẋ1 (t) 0
0 1 ··· 0 0
x1 (t)
0
ẋ2 (t) 0 0 0 · · · 0 0 x2 (t) 0
= .. + u(t)
.. .. .. ... .
.. .. .. ..
. .
. . .
.
.
ẋn−2 (t) 0 0 0 ··· 0 1 xn−2 (t) 0
ẋn−1 (t) −a0 −a1 −a2 · · · −an−2 −an−1 xn−1 (t) 1
x0 (t)
x1 (t)
x 2 (t)
y(t) = 1 0 · · · 0
..
.
xn−2 (t)
xn−1 (t)
or, with appropriate definitions,
˙ = A ξ(t) + B u(t)
ξ(t)
y(t) = C ξ(t)
Thus, dealing with higher-order derivatives in linear ODE’s does not add any con-
ceptual difficulty to the first-order theory (the same indeed applies to nonlinear
equations).
4
2. Given times t1 and t2 , let Φ(t2 , t1 ) be the state transition matrix for the continuous
time system. Define ξk = x(kT ). Then, according to the evolution property of
linear systems (Theorem 4.3 in the lecture notes),
It follows immediately that the matrices of the discrete-time system can be chosen
as follows:
Note: This property describes a fundamental scheme in digital control, and it can be
implemented in practice. An electronic device that takes as input a digital (discrete-
time) signal uk = u(kT ) and produces as output an analog signal holding uk constant
between kT and (k + 1)T is called a digital-to-analog converter or DAC. Another
device that samples its input y(t) at instants {kT } and produces the “digital”
sequence {yk } is called analog-to-digital converter or ADC. The exercise tells us that
a cascade of a DAC, a continuous-time physical system (like an electrical network),
and an ADC, can be viewed as a discrete-time or “digital” system; hence it can be
controlled with computers, which always work in discrete-time. In practice, digital
signals have the further property of being quantized.
5
Exercise 3. (Linear ODEs, 25%)
Let A(·) : R+ → Rn×n be piecewise continuous. Consider the following linear ODE:
and let Φ(t, t0 ) be the state transition matrix and s(t, t0 , x0 ) = Φ(t, t0 )x0 the solution of
(?) passing through (t0 , x0 ) ∈ R+ × Rn .
∂
1. Show that ∂t Φ(t0 , t) = −Φ(t0 , t)A(t).
(Hint: differentiate the identity Φ(t0 , t)Φ(t, t0 ) = I.)
Solution 3.
∂
Φ(t0 , t) + Φ(t0 , t)A(t) = 0,
∂t
whence the result.
2. Note that s(t, t0 , x0 ) = Φ(t, t0 )x0 . Let x0 , x00 ∈ X0 and t ∈ R+ . Then, for any
λ ∈ [0, 1],
λs(t, t0 , x0 )+(1−λ)s(t, t0 , x00 ) = λΦ(t, t0 )x0 +(1−λ)Φ(t, t0 )x00 = Φ(t, t0 ) λx0 +(1−λ)x00 .
6
3. By the uniqueness of the solution, we only need to check that X(t)X(t0 )−1 is a
solution of the matrix equation Ẏ (t) = A(t)Y (t) with Y (t0 ) = I. Check of initial
condition: [X(t)X(t0 )−1 ]t=t0 = X(t0 )X(t0 )−1 = I. Check of differential equation:
∂ −1 ∂
X(t) X(t0 )−1 = A(t)X(t) X(t0 )−1 = A(t) X(t)X(t0 )−1 .
X(t)X(t0 ) =
∂t ∂t
1. Let χA (s) = det(sI −A) = sn +cn−1 sn−1 +· · ·+c1 s+c0 be the characteristic polyno-
mial of A, and λ1 · · · λi · · · λk be its roots, that is the
Peigenvalues of A, respectively
with multiplicities µ1 · · · µi · · · µk (having of course ki=1 µi = n). Show that
k
Y
det A = λµi i = (−1)n c0
i=1
Xk
trA = µi λi = −cn−1
i=1
2. Show that the characteristic polynomial of A, its determinant, and its trace are
invariant under change of basis (A 7→ T −1 AT ).
3. Show that det eA = etrA .
(Hint: Consider the Jordan form of A and take the previous points into account.)
Solution 4.
1. The roots of the characteristic polynomial of A, taken with their multiplicities, are
the eigenvalues of A. Since χA is monic, it can be written as
Therefore,
k
Y
µ1 µ2
χA (0) = (−λ1 ) (−λ2 ) · · · (−λk ) µk
= (−1)n
λµi i
i=1
therefore
χA (0) = c0
7
Finally,
cn−1 = −µ1 λ1 − · · · − µk λk
it is easy to convince oneself that the “other terms” have degree at most n − 2.
Therefore, the monomial of degree n−1 in (0.2null) can arise only from (s−a11 )(s−
a22 ) · · · (s − ann ), and indeed
3. Since the characteristic polynomial, the eigenvalues, the determinant and the trace
do not depend on the choice of the basis, we can transform A into its Jordan form,
that is let à = T −1 AT , where
λ1 ∗ 0 · · · · · · · · · 0
0 ... ∗ 0 · · · · · · 0
.
..
0 λ 1 ∗ 0 · · · 0
.. .. ..
à = .
. 0 . ∗ 0 0
. . .
. . .
. . . 0 λ ∗ 0
k
. .. .. .. ...
.. . . . 0 ∗
0 0 0 0 0 0 λk
8
Moreover eA = T eà T −1 , where
λ1
e ∗ ··· ··· ··· ··· ∗
0 ... ∗ · · · · · · ··· ∗
.
..
0 e λ1 ∗ · · · ··· ∗
eà = ... .. ...
. 0 ∗ ··· ∗
.. .. ..
. . . 0 eλk ∗ ∗
. .. .. .. ..
.. . . . 0 . ∗
0 0 0 0 0 0 eλk
Finally,
k Pk
(eλi )µi = e( i=1 µi λi ) = etrà = etrA .
Y
A Ã
det e = det e =
i=1