Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Linear System Theory, Fall 2011

Solutions to Examples Paper 3


ODEs, linear systems
(not graded)

Exercise 1. (Modeling and simulation, 25%)

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:

M ÿ(t) = −ky(t) − cẏ(t)

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

(M + m)ÿ(t) = −ky(t) − cẏ(t) − mg

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)))

(atan2 is a “generalized version” of the arctangent function, provided by most math-


ematical libraries including of course those of Matlab).
Let r = perihelion, R =aphelion, v =speed at perihelion, and V =speed at aphelion.
To choose a realistic initial condition, we impose that the Earth-Moon system is at
the perihelion (x = r, y = 0), and we find the corresponding initial speed v. This
is done by taking into account conservation of energy and conservation of angular
momentum:
1 2 γM (m + µ) 1 γM (m + µ)
mv − = mV 2 −
2 r 2 R
mvr = mV R

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]> .

Exercise 2. (Linear systems, 25%)

1. Show that any n-th order linear differential equation

y (n) + an−1 y (n−1) + · · · + a1 y 0 (t) + a0 y(t) = u(t)

can be put in state-space form (where u(t) plays the role of an input).

2. Consider the linear system

ẋ(t) = A(t)x(t) + B(t)u(t)


y(t) = C(t)x(t) + D(t)u(t)

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),

ξk+1 = x((k + 1)T )


Z (k+1)T
= Φ((k + 1)T, kT ) x(kT ) + Φ((k + 1)T, τ )B(τ )u(τ )dτ
kT
Z (k+1)T
= Φ((k + 1)T, kT ) ξk + Φ((k + 1)T, τ )B(τ )dτ uk
kT

It follows immediately that the matrices of the discrete-time system can be chosen
as follows:

Āk = Φ((k + 1)T, kT )


Z (k+1)T
B̄k = Φ((k + 1)T, τ )B(τ )dτ
kT
C̄k = C(kT )
D̄k = D(kT )

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:

ẋ(t) = A(t)x(t), (?)

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.)

2. Let X0 be a convex set (i.e. x, x0 ∈ X0 ⇒ λx + (1 − λ)x0 ∈ X0 , ∀λ ∈ [0, 1]). Let


s(t, t0 , x0 ) be the solution of (1) associated with the initial condition x(t0 ) = x0 .
Show that the set
X (t) = {s(t, t0 , x0 ) | x0 ∈ X0 }
is convex for all t ∈ R+ .

3. A function X(·) : R → Rn×n is said to be a fundamental matrix if it is a solution


of the matrix differential equation Ẋ(t) = A(t)X(t), and it is nonsingular for all
t ∈ R. Show that Φ(t, t0 ) = X(t) · X(t0 )−1 for any fundamental matrix X(·).

Solution 3.

1. Differentiating the identity I = Φ(t0 , t)Φ(t, t0 ) one gets:


   
∂ ∂
0= Φ(t0 , t) Φ(t, t0 ) + Φ(t0 , t) Φ(t, t0 )
∂t ∂t
 

= Φ(t0 , t) Φ(t, t0 ) + Φ(t0 , t)A(t)Φ(t, t0 )
∂t
 

= Φ(t0 , t) + Φ(t0 , t)A(t) Φ(t, t0 ).
∂t

Since Φ(t, t0 ) is nonsingular for all t, it follows from above that


Φ(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 .


Since X0 is convex, λx0 + (1 − λ)x00 ∈ X0 . Then, Φ(t, t0 ) λx0 + (1 − λ)x00 =




s(t, t0 , λx0 + (1 − λ)x00 ) ∈ X (t), i.e. X (t) is convex.

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

Exercise 4. (Matrix exponential and eigenvalues, 25%)


Let A ∈ Rn×n . Recall that thePtrace of a square matrix A, denoted trA, is the sum of all
its diagonal elements (trA := ni=1 aii ).

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

χA (s) = (s − λ1 )µ1 (s − λ2 )µ2 · · · (s − λk )µk (0.1)

Therefore,
k
Y
µ1 µ2
χA (0) = (−λ1 ) (−λ2 ) · · · (−λk ) µk
= (−1)n
λµi i
i=1

On the other hand

χA (s) = sn + cn−1 sn−1 + · · · + c1 s + c0 , (0.2)

therefore

χA (0) = c0

7
Finally,

χA (0) = det(0I − A) = det(−A) = (−1)n det A


Qk
Equating the tree expressions for χA (0), one gets det A = i=1 λµi i = (−1)n c0 .
Comparing again (0.1null) and (0.2null), it is easy to see that

cn−1 = −µ1 λ1 − · · · − µk λk

On the other hand, consider the determinant


 
s − a11 −a12 · · · −a1n
 −a21 s − a22 · · · −a2n 
χA (s) = det(sI − A) = det 
 
.. .. . .. .. 
 . . . 
−an1 s − an2 · · · s − ann
= (s − a11 )(s − a22 ) · · · (s − ann ) + other terms

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

cn−1 = −a11 − a22 − · · · − ann = −trA


Pk
Equating the expressions for cn−1 , one finds trA = i=1 µi λi = −cn−1 .

2. Let à = T −1 AT for a certain change of basis T . Then

det(sI − Ã) = det(sI − T −1 AT ) = det(sT −1 T − T −1 AT )


= det(T −1 (sI − A)T ) = det T −1 det(sI − A) det T
= (det T )−1 det(sI − A) det T = det(sI − A)

Hence, χà = χA . As a consequence, the eigenvalues of A are invariant under change


of basis; by the previous point such is the determinant of A (their product) and its
trace (their sum).

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

You might also like