You are on page 1of 41

Control Systems I

Lecture 3: Time response, Stability

Suggested Readings: Åström & Murray Ch. 4-5

Jacopo Tani

Institute for Dynamic Systems and Control


D-MAVT
ETH Zürich

October 5, 2018

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 1 / 40


Tentative schedule

# Date Topic
1 Sept. 21 Introduction, Signals and Systems
2 Sept. 28 Modeling, Linearization
3 Oct. 5 Analysis 1: Time response, Stability
4 Oct. 12 Analysis 2: Diagonalization, Modal coordinates
5 Oct. 19 Transfer functions 1: Definition and properties
6 Oct. 26 Transfer functions 2: Poles and Zeros
7 Nov. 2 Analysis of feedback systems: internal stability,
root locus
8 Nov. 9 Frequency response
9 Nov. 16 Analysis of feedback systems 2: the Nyquist
condition
10 Nov. 23 Specifications for feedback systems
11 Nov. 30 Loop Shaping
12 Dec. 7 PID control
13 Dec. 14 State feedback and Luenberger observers
14 Dec. 21 On Robustness and Implementation challenges

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 2 / 40


State of a system

We know that, if a system is causal, in order to compute its output at a given


time t0 , we need to know “only” the input signal over (−∞, t0 ].

This is a lot of information. Can we summarize it with something more man-


ageable?

Definition (state)
The state x(t0 ) of a causal system at time t0 is the information needed, together
with the input u between times t0 and t1 , to uniquely predict the output at time
t1 , for all t1 ≥ t0 .

Usually, the state of a system is a vector in some Euclidean space Rn , and n


is the dimension of the system.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 3 / 40


LTI State-space model
It can be shown that any finite-dimensional LTI system can be described by a
state-space model of the form:

Definition (Continuous-time State-Space Models)


d
x(t) = Ax(t) + Bu(t);
dt
y (t) = Cx(t) + Du(t);

The state x represents the memory of the system.


The state x is an “internal” variable that cannot be accessed directly, but only
“controlled” though the input u and “observed” through the output y .
The order of the system is the dimension of the state x.
A system is memoryless if the “dimension” of the state is zero (i.e., there is
no need to keep a state, or memory)
A system is strictly causal if the “feedthrough” term D is zero.
J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 4 / 40
Nonlinear systems

Unfortunately, most real-world systems are nonlinear.


Finite-dimensional, time-invariant, causal nonlinear control systems, with input
u and output y can typically be modeled using a set of differential equations
as follows:

Definition (Continuous-time Nonlinear State-Space Models)


d
ẋ(t) = x(t) = f (x(t), u(t)) ,
dt
y (t) = g (x(t), u(t));

Can we construct an LTI approximation of this system, so that we can apply


the techniques designed for LTI systems?
Remarkably, control systems designed for the LTI approximation will work very
well for the nonlinear system.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 5 / 40


Pendulum (2nd-order nonlinear system)

https://www.youtube.com/watch?v=oWiuSp6qAPk
Notation:
Angular position: θ,
Torque input: u,
Pendulum length: L,
Pendulum mass: m,
Viscous damping coefficient: c
Dynamic model:

mL2 θ̈ = −c θ̇ − mgL sin θ + u.

Define x1 := θ, and x2 := θ̇.


Then one can write

ẋ1 = x2 ,
c g
ẋ2 = − x2 − sin(x1 ) + u.
mL2 L

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 6 / 40


Equilibrium point

The pendulum is a nonlinear system. How can we construct an approximate


model which is linear?

The key idea is that of constructing an approximation that is valid “near” some
special operating condition, e.g., equilibrium points.

Definition (Equilibrium point)


A system described by an ODE ẋ(t) = f (x(t), u(t)) has an equilibrium point
(xe , ue ) if f (xe , ue ) = 0.

Clearly, if x(0) = xe , and u(t) = ue for all t ≥ 0, then

x(t) = x(0) = xe , for all t ≥ 0.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 7 / 40


Equilibria for a pendulum

What would be an equilibrium for the pendulum? We need to solve for

ẋ1 = x2 = 0,
c g
ẋ2 = − 2 x2 − sin(x1 ) + u = 0.
mL L

There are two solutions:

xe = (0, 0), ue = 0, and

xe = (π, 0), ue = 0.
The first equilibrium is stable, the second unstable; we will make these notions
more precise.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 8 / 40


(Jacobian) Linearization procedure

Given an equilibrium point (xe , ue ), with output ye = g (xe , ue ), a linearized


model is obtained by setting

x ← xe + δx,
u ← ue + δu,
y ← ye + δy ,

and then neglecting all terms of second (or higher) order in δx, δu, and δy in
the (nonlinear) dynamics model.

Note that since xe is a constant, ẋ = δ ẋ.

The resulting model would be a good approximation of the original nonlinear


model when “near” the equilibrium point, i.e., for |δx| ' 0, |δu| ' 0, and
|δy | ' 0.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 9 / 40


Linearization about the stable equilibrium

Susbstituting as in the previous slide, with xe = (0, 0) and ue = 0,

δ ẋ1 = 0 + δx2 ,
c g 1
δ ẋ2 = − 2 (0 + δx2 ) − (0 + δx1 ) + (0 + δu),
mL L mL2
δy = δx1 .

The above can be rewritten in the state-space form as

δ ẋ = Aδx + Bδu,
δy = C δx + Dδu,

where    
0 1 0
A= , B= .
−g /L −c/(mL2 ) 1/(mL2 )
 
C= 1 0 , D = 0.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 10 / 40


Linearization about the unstable equilibrium

Susbstituting xe = (π, 0) and ue = 0,

δ ẋ1 = π + δx2 ,
c g 1
δ ẋ2 = − 2 (0 + δx2 ) − (0 − δx1 ) + (0 + δu),
mL L mL2
δy = δx1 .

The above can be rewritten in the state-space form as

δ ẋ = Aδx + Bδu,
δy = C δx + Dδu,

where    
0 1 0
A= , B= .
+g /L −c/(mL2 ) 1/(mL2 )
 
C= 1 0 , D = 0.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 11 / 40


Equivalent approach for linearization
Let (xe , ue ) be an equilibrium point of a nonlinear system, i.e.: f (xe , ue ) = 0;
Consider the first first order Taylor expansion of ẋ(t) = f (x(t), u(t)) around
the equilibrium point:
∂f
ẋ(t) =f (x(t), u(t)) ' f (xe , ue ) + (x(t), u(t)) (x(t) − xe )
∂x (x,u)=(xe ,ue )
∂f
+ (x(t), u(t)) (u(t) − ue ) + h.o.t.
∂u (x,u)=(xe ,ue )

Define: z(t) = x(t) − xe and v (t) = u(t) − ue . Since xe is constant:


ż(t) = Az(t) + Bv (t),
where:
 ∂f1 ∂f1 
∂x
... ∂xn
∂f  .1 .. .. 
A= (x(t), u(t)) = 
 .. .
 ∈ <n×n
∂x (x,u)=(xe ,ue ) . 
∂fn ∂fn
∂x1
... ∂xn (x,u)=(xe ,ue )
 ∂f 
1

∂f  ∂u
. 
B= (x(t), u(t)) = 
 .. 
 ∈ <n×1
∂u (x,u)=(xe ,ue )
∂fn
∂u (x,u)=(xe ,ue )
J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 12 / 40
Questions of the day

Next steps:

We are convinced (hopefully) about the LTI formulation. But what is the
solution of ẋ(t) = Ax(t) + Bu(t), y = Cx(t) + Du(t)?

I.e., given the system A, B, C , D, the input sequence u(t), t ∈ [t0 , t] and some
initial conditions x(t0 ) = x0 ; how can we express x(t) and y (t), ∀t ≥ t0 ?

We saw that the first objective of control is to keep systems stable. What is
stability, and how can we tell if a system is stable?

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 13 / 40


Today’s learning objectives

After today’s lecture, you should be able to:

Compute the general form response of a linear system by adding its initial
condition response and its forced response.

Understand what is a matrix exponential, and how to compute it for several


cases of interest.

Use the matrix exponential to compute the response of a linear system.

Understand several definitions of stability for a dynamical system.

Check whether a LTI system is stable or not by inspection of the A matrix and
its eigenvalues.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 14 / 40


Example
It’s deep winter, and you are returning to your cabin in the mountains, the
temperature outside is 0 degrees.
Before leaving the cabin, many hours ago, you left the heater on, with power
“1”.
As you enter the door, the temperature is too cold (3 degrees), so you set the
heater to power “5”.
Question: how does the temperature evolve over time after you are back?

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 15 / 40


A model for the example

Suppose that the temperature dynamics in the cabin is well described by the
LTI model:

ẋ = −2x + 6u,
y = x,

where y is the temperature expressed in degrees, u is the power setting of the


heater (dimensionless), and time is measured in hours.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 16 / 40


Time response: Linearity and superposition

Given an input signal u, how do we compute the output y of a system Σ in


response to u?

Recall the definition of linear systems from Lecture 1:


An input-output system Σ is linear if, for all input signals ua , ub ,
and scalars α, β ∈ R,

Σ(αua + βub ) = α(Σua ) + β(Σub ) = αya + βyb .

Divide and conquer: express u as the linear combination of simpler or more


representative signals, and compute the response to each one of these
independently. Then compute the output y as the linear combination of
individual responses.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 17 / 40


Initial condition vs. forced response
In particular we could choose u = upast + ufuture , where

upast = PT u, ufuture = u − PT u.

Due to causality, we know that the effects of the ”past” input upast can be
summarized by the state x(t0 ) at time t0 .
Due to time invariance, the time reference does not matter, so we can choose
t0 = 0.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 18 / 40


Initial condition vs. forced response

If we want to comptue the output of a system starting at time 0, knowing the


initial state x(0) = x0 , and the present and future input u, for t ≥ t0 , we can
consider the following two cases instead:
Initial-conditions response:

xIC (0) = x0 ,
→ yIC ;
uIC (t) = 0, t ≥ t0 ,

Forced response:

xF (0) = 0,
→ yF .
uF (t) = u(t), t ≥ t0 ,

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 19 / 40


Initial condition vs. forced response
Clearly, x0 = xIC + xF , and u = uIC + uF , hence
y = yIC + yF ,
that is, we can always compute the output of a linear system by adding the
output corresponding to zero input and the original initial conditions, and the
output corresponding to a zero initial condition, and the original input.
In other words, we can study separately the effects of non-zero inputs and of
non-zero initial conditions. The “complete” case can be recovered from these
two.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 20 / 40


Initial condition (homogeneous) response

Consider the scalar case first (first-order system).

We need to solve the initial-condition problem

ẋ(t) = ax(t), x(0) = x0


y (t) = cx(t).

The solution of this ODE is

x(t) = e at x0 = φ(t)x0 ,

where φ(t) = e at is called the state-transition function.

The output is y (t) = ce at x0 = cφ(t)x0 .

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 21 / 40


In the cabin...
Recalling the LTI model of the temperature in the cabin:
ẋ = −2x + 6u,
y = 1 · x,
If the initial condition is x0 = 3, and the heather is set to 0 power, i.e.,
u(t) = 0, then the temperature would evolve as y (t) = 3e −2t (in our model
c = 1).

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 22 / 40


Forced response
Again, consider the scalar case first.
We need to solve the forced response problem
ẋ(t) = ax(t) + bu(t), x(0) = 0,
y (t) = cx(t) + du(t).

Multiply both sides of the ODE by e −at and integrate over [0, t]:
Z t Z t
e −aτ ẋ(τ ) dτ = e −aτ ax(τ ) + e −aτ bu(τ ) dτ

0 0

integrating by parts on the left:


Z t Z t
t
e −aτ x(τ ) 0 + e −aτ ax(τ ) dτ = e −aτ ax(τ ) + e −aτ bu(τ ) dτ

0 0

which yields (recall that x0 = 0):


Z t Z t
a(t−τ )
x(t) = e bu(τ ) dτ = φ(t − τ )bu(τ ) dτ.
0 0

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 23 / 40


In the cabin...
If the initial condition is x0 = 0, and the heather is set to power 5, the
temperature would evolve as
Z t Z t
y = 30 e −2(t−τ ) dτ = 15 e −2(t−τ ) d(−2(t − τ )) = 15(1 − e −2t ).
0 0

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 24 / 40


Putting things together

Time response of a first-order LTI system:


Z t
at
x(t) = e x0 + e a(t−τ ) bu(τ ) dτ,
0
Z t
y (t) = ce at x0 + c φ(t − τ )bu(τ ) dτ + du(t).
0

Note: the response will be a linear combination of terms of the form

e at : system’s natural dynamics,

u(t): the forcing input.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 25 / 40


In the cabin...
Adding the homogeneous (initial condition) response + the forced response,
we get the actual temperature profile in the cabin:
y (t) = 3e −2t + 15 − 15e −2t = 15 − 12e −2t .

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 26 / 40


The higher-order (matrix) case

So far we have seen how to compute the response of a first-order system, in


which the matrix A is a 1x1 matrix, i.e., a scalar.

In this case, we found out that, e.g., the IC response was determined by the
exponential x(t) = e at x0 .

Question What happens when A is a 2x2 matrix, or bigger?

When integrating ẋ(t) = ax(t), the key property we used was that de at /dt =
ae at . Also recall the series expansion for the exponential:
1 1
e at = 1 + at + (at)2 + . . . + (at)n + . . .
2 n!

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 27 / 40


The matrix exponential

So let us define the matrix exponential e At in such a way that

de At
= Ae At = e At A.
dt

The following definition achieves our goal:


1 1
e At = I + At + (At)2 + . . . + (At)n + . . . .
2 n!

Hence we can write, in the general case,

x(t) = e At x0 = Φ(t)x0 .

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 28 / 40


The higher-order (matrix) case: time response.

Using the matrix exponential, we can extend all calculations made in the scalar
case to the matrix case, and get
Z t
At
x(t) = e x0 + e A(t−τ ) Bu(τ ) dτ,
0
Z t
y (t) = Ce At x0 + C e A(t−τ ) Bu(τ ) dτ + Du(t).
0

Keep in mind that matrices in general do not commute, so it is important to


maintain the order of (non-scalar) factors.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 29 / 40


How to compute a matrix exponential
Brute force and lots of patience: compute many terms of the Taylor
expansion.
Python / Matlab: use matrix exponential function - has expm() in it (note
the m after exp)!
Our secret: you will never have to compute these “by hand” in practice!

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 30 / 40


How to compute a matrix exponential
Brute force and lots of patience: compute many terms of the Taylor
expansion.
Python / Matlab: use matrix exponential function - has expm() in it (note
the m after exp)!
Our secret: you will never have to compute these “by hand” in practice!
A method for analysis: find a realization of the system (i.e., a special choice
of the state vector x) such that the matrix A is either
Diagonal:     
λ1 0 exp(λ1 t) 0
exp t =
0 λ2 0 exp(λ2 t)
Jordan form:     
λ 1 exp(λt) t exp(λt)
exp t =
0 λ 0 exp(λt)
We will find out how to compute this transformation next time. For us, let us
work on diagonal systems (and Jordan form systems).
Note that the elements on the diagonal of these matrices are the eigenvalues
of the matrix A.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 30 / 40


Distinct real eigenvalues (diagonal, real matrix)

     
λ1 0   exp(λ1 t) 0 x0,1
y (t) = C exp(At)x0 = C exp t x0 = c1 c2
0 λ2 0 exp(λ2 t) x0,2
= c1 exp(λ1 t)x0,1 + c2 exp(λ2 t)x0,2

When there are two (or more) distinct real eigenvalues, the response is given
by the linear combination of exponentials of the form exp(λi t).
y (t)

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 31 / 40


Complex conjugate eigenvalues (diagonal, complex matrix)
  
σ + jω 0
y (t) = C exp(At)x0 = C exp t x0
0 σ − jω
= c1 exp(σt) exp(jωt)x0,1 + c2 exp(σt) exp(−jωt)x0,2
= exp(σt) [α1 sin(ωt) + α2 cos(ωt)]
= α exp(σt) sin(ωt + φ).

In the formulas above, we used Euler’s identity

e ±jωt = cos(ωt) ± j sin(ωt),

and the derived identities


exp(jωt) + exp(−jωt) exp(jωt) − exp(−jωt)
cos(ωt) = , sin(ωt) = .
2 2j

Note that since the matrix was real, the expression of the exponential must be
real as well, even though we use complex (conjugate) numbers in the process!

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 32 / 40


Complex conjugate eigenvalues (diagonal, complex matrix)

When there are two complex conjugate eigenvalues, the homogeneous response
(i.e., with u(t) = 0) is given by a sinusoid of frequency ω, with amplitude
increasing/decreasing as exp(σt).
Initial phase and amplitude are functions of the initial conditions.
y (t)

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 33 / 40


Complex conjugate eigenvalues (diagonal, complex matrix)

Forced responce:

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 34 / 40


Repeated real eigenvalues (real, Jordan matrix)

    
λ 1 exp(λt) t exp(λt)
y (t) = C exp(At)x0 = C exp t x0 = C x
0 λ 0 exp(λt) 0
= c1 exp(λt)x0,1 + c1 t exp(λt)x0,2 + c2 exp(λt)x0,2 .

The homogeneous response is a linear combination of an exponential exp(λt)


and a term of the form t exp(λt).

Often, repeated eigenvalues occur with λ = 0. In this case, the response is a


linear combination of terms of the form 1, t, and higher powers of t (for larger
Jordan blocks). In other words, polynomials.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 35 / 40


Repeated real eigenvalues (real, Jordan matrix)
An example:

ma = F ⇒ mp̈ = F

Choose the states x1 and x2 , s.t. x1 = p and x2 = ṗ.


A double integrator system:
(   " 0 #
ẋ1 = x2   
ẋ1 0 1 x1
F ⇒ = + 1 F
ẋ2 = ẋ2 0 0 x2
m m
If F = 0, then the position p(t) can be computed by having the initial
position p0 and the initial velocity v0 = ṗ(t)|t=0 as follows:

p(t) = p0 + v0 t ⇒ x1 (t) = x0,1 + x0,2 t


 
0 1
Note that A = has a Jordan form with a repeated eigenvalue λ = 0.
0 0
Then, the output y (t) = x1 (t) can be given by y (t) = x0,1 + x0,2 t.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 36 / 40


The general case

Any matrix can be reduced to a diagonal or Jordan form. Complex eigenvalues


always appear in complex-conjugate pairs.

The response of a linear system will always be a combination of terms of the


form

simple exponentials exp(λi t) for real λi ;

exponentially-modulated sinusoids exp(σi t) sin(ωi t + φ) for complex conjugate


λi , λ∗i , with σ = Re(λi ) and ω = Im(λi )

time-scaled exponentials t m exp(λi t), where m is an integer that depends on


the multiplicity of λi .

the input and its derivatives.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 37 / 40


Qualitative behavior of a LTI system

Lyapunov stability: A system is called Lyapunov stable if, for any bounded
initial condition, and zero input, the state remains bounded, i.e.,

∀kx0 k < , and u = 0 ⇒ kx(t)k < δ, for all t ≥ 0.

A system is called asymptotically stable if, for any bounded initial condition,
and zero input, the state converges to zero, i.e.,

∀kx0 k < , and u = 0 ⇒ lim kx(t)k = 0.


t→+∞

Bounded-Input, Bounded Output stability: A system is called BIBO-stable if,


for any bounded input, the output remains bounded, i.e.,

∀ku(t)k <  ∀t ≥ 0, and x0 = 0 ⇒ ky (t)k < δ ∀t ≥ 0.

A system is called unstable if not stable.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 38 / 40


Stability conditions

We have learned that, if the A matrix is diagonalizable, the state/output re-


sponse will be given by some linear combination of terms of the form

exp(λi t), exp(σt) sin(ωt + φ)

Lyapunov stable if Re(λi ) ≤ 0 for all i, ; asymptotically stable if Re(λi ) < 0


for all i.
If the A matrix is not diagonalizable, then the state/output response will also
contain terms of the form

t m exp(λi t), t m exp(σt) sin(ωt + φ)

the system is Lyapunov stable if the Re(λi ) ≤ 0 for all i, and there are no
repeated eigenvalues with 0 real part.
For linear systems asymptotic stability = BIBO stability.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 39 / 40


Today’s learning objectives

After today’s lecture, you should be able to:

Understand how to compute the general form response of a linear system by


adding its initial condition response and its forced response.

Understand what is a matrix exponential, and how to compute it for several


cases of interest.

Use the matrix exponential to compute the response of a linear system.

Understand several definitions of stability for a dynamical system.

Check whether a LTI system is stable or not by inspection of the A matrix and
its eigenvalues.

J. Tani, E. Frazzoli (ETH) Lecture 3: Control Systems I 10/05/2018 40 / 40

You might also like