Module 4F2: Nonlinear
Systems and Control
Lectures 1 – 2: Dynamical Systems
Jan Maciejowski
jmm@eng.cam.ac.uk
Department of Engineering
University of Cambridge
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 1/26
‘Nonlinear’ overview — 7L
Nonlinear dynamical systems 2 lectures
Continuous, discrete, hybrid
Examples
State-space description
Solutions, simulations
Attractors, Stability, Lyapunov methods 1.5 lectures
Describing functions 1.5 lectures
Circle criterion for stability 2 lectures
2 Examples papers, 1 Examples class
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 2/26
Dynamical system classification
Dynamical system: Evolution of state over time.
Types of state:
Continuous State x lives in Euclidean space Rn — familiar, eg
from 3F2. Write x ∈ Rn .
Discrete State q takes values in finite or countable set
{q1 , q2 , . . .}. Example: Light switch, q ∈ {ON, OF F }.
Hybrid Part of state lives in Rn , other part has values in finite
set. Example: Computer control of inverted pendulum.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 3/26
Types of time:
Continuous ẋ = Ax (linear) or ẋ = f (x) (nonlinear).
Discrete xk+1 = Axk (linear) or xk+1 = f (xk ) (nonlinear).
Hybrid System evolves over continuous time, but special things
happen at particular instants.
We will deal mostly with:
Continuous-state, continuous-time, nonlinear
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 4/26
Example: Pendulum
Continuous-state, continuous-time, nonlinear
θ ℓ
mg
mℓθ̈ + dℓθ̇ + mg sin(θ) = 0
Exercise: Derive this. Why is it nonlinear?
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 5/26
Solve the ODE:
Find
θ(·) : R → R
such that
θ(0) = θ0
θ̇(0) = θ̇0
mℓθ̈(t) + dℓθ̇(t) + mg sin(θ(t)) = 0, ∀t ∈ R
Usually difficult to find solution analytically.
Find approximate solution by simulation.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 6/26
Simulated solution
Parameters: ℓ = 1, m = 1, d = 1, g = 9.8.
Initial conditions: θ(0) = 0.75, θ̇(0) = 0.
1.5
x2
1
0.5
x1
−0.5
−1
−1.5
−2
0 1 2 3 4 5 6 7 8 9 10
t
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 7/26
State-space form:
n
ẋ = f (x), x∈R , n≥1
For the pendulum, x ∈ R2 :
x1 θ
x= =
x2 θ̇
which gives:
ẋ1 x2
ẋ = = g d = f (x)
ẋ2 − ℓ sin(x1 ) − m x2
x is state. This system has dimension 2.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 8/26
Vector field
ẋ = f (x), f (·) : R2 → R2 is vector field
f (·) assigns velocity vector to each state vector.
0.6
0.4
0.2
θ̇
−0.2
−0.4
−0.6
−0.25 −0.2 −0.15 −0.1 −0.05 0 0.05 0.1 0.15 0.2 0.25
θ
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 9/26
Solve the ODE (another view):
Find x(·) : R → R2 such that
x1 (0) θ0
x(0) = =
x2 (0) θ̇0
ẋ(t) = f (x(t)), ∀t ∈ R.
1.5
0.5
0
θ̇
−0.5
−1
−1.5
−2
−0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8
θ
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 10/26
Equilibrium states
For certain states x̂ ∈ Rn ,
f (x̂) = 0
Hence system never leaves the state x̂.
Such a state is an equilibrium state.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 11/26
Equilibrium states
For certain states x̂ ∈ Rn ,
f (x̂) = 0
Hence system never leaves the state x̂.
Such a state is an equilibrium state.
For the pendulum:
0 π
x̂ = or x̂ =
0 0
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 11/26
Equilibrium states
For certain states x̂ ∈ Rn ,
f (x̂) = 0
Hence system never leaves the state x̂.
Such a state is an equilibrium state.
For the pendulum:
0 π
x̂ = or x̂ =
0 0
| {z } | {z }
stable unstable
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 11/26
Equilibrium states
For certain states x̂ ∈ Rn ,
f (x̂) = 0
Hence system never leaves the state x̂.
Such a state is an equilibrium state.
For the pendulum:
0 π
x̂ = or x̂ =
0 0
| {z } | {z }
stable unstable
Nonlinear system can have several equilibria.
Some stable, others unstable.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 11/26
Linearisation
For θ close to 0: sin(θ) ≈ θ. Hence for θ close to 0:
mℓθ̈ + dℓθ̇ + mgθ = 0
or in state space form
x2 0 1 x1
ẋ = g d = g d = g(x)
− ℓ x1 − m x2 − ℓ −m x2
Note that g(x) = Ax ie linear state-space system.
A has eigenvalues in LHP — stable linear system.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 12/26
Linearisation
For θ close to 0: sin(θ) ≈ θ. Hence for θ close to 0:
mℓθ̈ + dℓθ̇ + mgθ = 0
or in state space form
x2 0 1 x1
ẋ = g d = g d = g(x)
− ℓ x1 − m x2 − ℓ −m x2
Note that g(x) = Ax ie linear state-space system.
A has eigenvalues in LHP — stable linear system.
Exercise: Find linearisation near the other
equilibrium. Examine its stability.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 12/26
Example: Logistic map
Continuous-state, discrete-time, nonlinear.
xk+1 = axk (1 − xk ) = f (xk )
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 13/26
Example: Logistic map
Continuous-state, discrete-time, nonlinear.
xk+1 = axk (1 − xk ) = f (xk )
1
0.9
0.8
0.7
0.6
f (x)
0.5
0.4
0.3
0.2
0.1
x
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 13/26
Equilibrium, Oscillation, Chaos
a=0.9
0.1
0.09
0.08
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
0 5 10 15 20 25 30
0 ≤ a < 1: Decays to 0 for all x0 . a = 0.9
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 14/26
Equilibrium, Oscillation, Chaos
a=2.0
0.5
0.45
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
0 5 10 15 20 25 30
1 ≤ a ≤ 3: Tends to steady-state value. a = 2.0
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 14/26
Equilibrium, Oscillation, Chaos
a=2.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 5 10 15 20 25 30
1 ≤ a ≤ 3: Tends to steady-state value. a = 2.9
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 14/26
Equilibrium, Oscillation, Chaos
a=3.2
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 5 10 15 20 25 30
√
3 < a ≤ 1 + 6 = 3.449:
Tends to 2-period oscillation. a = 3.2
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 14/26
Equilibrium, Oscillation, Chaos
a=3.8
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 5 10 15 20 25 30
√
1 + 6 < a < 4:
3-period, 4-period, . . . , chaos. a = 3.8
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 14/26
Example: Manufacturing cell
A discrete-state system.
Possible states: Idle (I), Working (W), Down (D).
Possible events: p part arrives
c complete processing
f failure
r repair
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 15/26
Abstract description of machine
q ∈ Q = {I, W, D}, σ ∈ Σ = {p, c, f, r}
State transition relation:
δ :Q×Σ→Q
δ(I, p) = W , δ(W, c) = I, δ(W, f ) = D, δ(D, r) = I.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 16/26
Abstract description of machine
q ∈ Q = {I, W, D}, σ ∈ Σ = {p, c, f, r}
State transition relation:
δ :Q×Σ→Q
δ(I, p) = W , δ(W, c) = I, δ(W, f ) = D, δ(D, r) = I.
Otherwise δ is undefined — eg δ(D, p).
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 16/26
Abstract description of machine
q ∈ Q = {I, W, D}, σ ∈ Σ = {p, c, f, r}
State transition relation:
δ :Q×Σ→Q
δ(I, p) = W , δ(W, c) = I, δ(W, f ) = D, δ(D, r) = I.
Otherwise δ is undefined — eg δ(D, p).
I
p
r
c
W f D
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 16/26
Example: Thermostat
A hybrid system.
x ∈ R: Room temperature,
q ∈ {ON, OF F }: Heater state.
Heater off: q = OF F , ẋ = −ax
Heater on: q = ON , ẋ = −a(x − 30)
Use hysteresis to prevent ‘chattering’:
if x<19, q := ON,
elseif x>21, q := OFF,
end
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 17/26
x
22
21
20
19
18
t
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 18/26
x
22
21
20
19
18
t
x ≤ 19
OFF ON
ẋ = −ax ẋ = −a(x − 30)
x ≥ 18 x ≤ 22
x ≥ 21
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 18/26
State-space form
States: xi ∈ R, i = 1, 2, . . . , n
Inputs: uj ∈ R,j = 1, 2, . . . , m
Outputs: yk ∈ R, k = 1, 2, . . . , p
ẋ = f (x, u, t), y = h(u, x, t), vector functions
Special case: ẋ = f (x) autonomous
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 19/26
What do ẋ = f (x, u, t) and y = h(u, x, t) mean?
ẋ1 = f1 (x1 , . . . , xn , u1 , . . . , um , t)
..
.
ẋn = fn (x1 , . . . , xn , u1 , . . . , um , t)
y1 = h1 (x1 , . . . , xn , u1 , . . . , um , t)
..
.
yp = hp (x1 , . . . , xn , u1 , . . . , um , t)
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 20/26
Existence, Uniqueness
ẋ = −sign(x), x(0) = 0 — No solutions
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 21/26
Existence, Uniqueness
ẋ = −sign(x), x(0) = 0 — No solutions
ẋ = 3x2/3 , x(0) = 0 — Multiple solutions
(t − a)3 t ≥ a
For any a ≥ 0, x(t) =
0 t≤a
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 21/26
Existence, Uniqueness
ẋ = −sign(x), x(0) = 0 — No solutions
ẋ = 3x2/3 , x(0) = 0 — Multiple solutions
(t − a)3 t ≥ a
For any a ≥ 0, x(t) =
0 t≤a
ẋ = 1 + x2 , x(0) = 0 — Finite escape time
One solution: x(t) = tan(t)
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 21/26
Lipschitz continuity
Definition 1 A function f : Rn → Rn is Lipschitz
continuous if ∃λ > 0 such that ∀x, x̂ ∈ Rn
kf (x) − f (x̂)k < λkx − x̂k
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 22/26
Lipschitz continuity
Definition 2 A function f : Rn → Rn is Lipschitz
continuous if ∃λ > 0 such that ∀x, x̂ ∈ Rn
kf (x) − f (x̂)k < λkx − x̂k
Theorem 2 (Existence & Uniqueness of Solutions)
If f is Lipschitz continuous, then
ẋ = f (x), x(0) = x0
has a unique solution x(·) : [0, T ] → Rn for all T ≥ 0
and all x0 ∈ Rn .
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 22/26
Simulation
Theorem 3 (Continuity with Initial State) Assume
f is Lipschitz continuous with Lipschitz constant λ.
Let x(·) : [0, T ] → Rn and x̂(·) : [0, T ] → Rn be
solutions to ẋ = f (x) with x(0) = x0 and x̂(0) = x̂0 ,
respectively. Then for all t ∈ [0, T ]
kx(t) − x̂(t)k ≤ kx0 − x̂0 keλt
“Solutions that start close, remain close.”
This justifies simulation.
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 23/26
Pendulum simulation (Matlab)
ẋ1 x2
ẋ = = = f (x)
ẋ2 − gℓ sin(x1 ) − d
m x2
function [xdot] = pendulum(t,x)
l = 1; m=1; d=1; g=9.8;
xdot(1) = x(2);
xdot(2) = -sin(x(1))*g/l-x(2)*d/m;
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 24/26
>> x=[0.75 0];
>> [T,X]=ode45(’pendulum’, [0 10], x’);
>> plot(T,X);
>> grid;
ode45 is 4’th order Runge-Kutta integration function.
Exercise: Try this at home! (or in the DPO)
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 25/26
Simulation tools
Simulink provides GUI front-end to Matlab.
Other similar products available.
Pendulum:
1 Scope1
sin(u) g/l
s
x1 Fcn Gain
1
d/m
s
x2 Gain1
Lent 2011 4F2: Nonlinear Systems and Control, Lectures 1–2 – p. 26/26