Lecture 3
Lecture 3
Cyber-Physical Systems
Fall - 2022
Fall - 2022 1 / 58
Outline
Fall - 2022 2 / 58
Lecture 2 - Recap
Fall - 2022 3 / 58
Attack Space: 3D modeling
Model
Communication Channels
Disruptive Disclosure
Attacker Policy
Networked Controller
3D ATTACK SPACE
Model Knowledge
Model Knowledge
- Plant Disclosure Resources
-Controller - Sensor measurements the attacker
-Detector can intercept
- Control Inputs the attacker can
intercept
Disclosure Resources
es
rc
ou
es
eR
Disruptive Resources
tiv
isr
up - Sensor measurements the attacker
can violate the integrity/availablity
D
Fall - 2022 4 / 58
Fall - 2022 5 / 58
Model→ Md = {P, C, E, D}
u(t) y(t)
A Plantstate x(t) S
Communication Channels
u(t) r(t)
control logic state
te estimator
anomaly detector
Networked Controller
Input Output
Input Output
Input Output Input Output
Input
Output
Input Output Input
Output
Fall - 2022 7 / 58
• The way the system evolves over time defines the dynamics of
the system
• A dynamical model of a system is a set of mathematical
equations that explain how the system evolves over time under the
effect of an external excitation u(t) or autonomously (if u(t) ≡ 0)
Fall - 2022 8 / 58
Fall - 2022 9 / 58
How can we derive a dynamical model of a system?
1 Knowledge-based methods: A mathematical model is derived
by resorting to the physic laws governing the considered process,
e.g., Kirchhoff’s voltage and current laws, Newton’s second law
2 Identification based methods: The physical laws governing the
process dynamics are unknown (black box) or partially known
(gray box)
• We do experiments to find a model that explain how the input influences
the output.
Fall - 2022 10 / 58
Fall - 2022 11 / 58
1 dxi (t)
Note that ẋi (t) = dt
denotes the time derivative of xi (t).
Fall - 2022 13 / 58
where:
• x(t) := [x1 , x2 , · · · , xn ]T ∈ IRn is state vector of the system
• u(t) := [u1 , u2 , · · · , um ]T ∈ IRm is input vector of the system
• y(t) := [y1 , y2 , · · · , yp ]T ∈ IRp is output vector of the system
Fall - 2022 14 / 58
(
ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
2 R
the term 1/s denotes the integrator operator, i.e., x(t) = ẋ(t)dt
Fall - 2022 15 / 58
Example: mass-spring-damper system (1/4)
• Find the state-space model of the mass-spring-damper system
where
• M =mass
• K= spring constant
• β= damping coefficient
y(t) = z(t)
Fall - 2022 16 / 58
4
other equivalent choices for x1 and x2 are possible
Fall - 2022 18 / 58
Example: mass-spring-damper system (4/4)
x˙1 (t) = x2 (t)
β K 1
x˙2 (t) = − M x2 (t) − M x1 (t) + M u(t)
y(t) = x1 (t)
• We need to solve the above to know how x(t) and y(t) evolve
• The solution is given by the following Lagrange’s Formula
Proposition
Given the continuous-time linear system ẋ = Ax + Bu, with initial
condition x(0) = x0 ∈ IRn , there exist a unique solution (x(t), y(t)) for
any input u(t) :
forced response
natural response
zZ }| {
z }| { t
x(t) = eAt x0 + eA(t−τ ) Bu(τ )dτ
Z t 0
y(t) = CeAt x(0) + C eA(t−τ ) Bu(τ )dτ + Du(t)
0
Fall - 2022 20 / 58
Fall - 2022 21 / 58
Eigenvalues and Eigenvectors (1/3)
Example:
2 3
A= ∈ IR2×2 , det(λI − A) = (λ − 2)(λ − 4) = 0
0 4
Fall - 2022 22 / 58
Avi = λi vi
Example:
2 3
A= ∈ IR2×2
0 4
The eigenvectors associate to the eigenvalues λ1 = 2, λ1 = 4 are 5
1 0.8321
v1(λ1 =2) = , v2(λ2 =4) =
0 0.5547
Indeed (try yourself):
2 v1 , Av2 = |{z}
Av1 = |{z} 4 v2
λ1 λ2
5
You can use the Matlab function “eig(A)” to computer the eigenvalues and eigenvectors.
Fall - 2022 23 / 58
A = T ∆T −1
λ1 0 . . . 0
0 λ2 . . . 0
= T −1 AT, T = [v1 |v2 . . . |vn ]
∆= .. .. . . .
. . . ..
0 0 . . . λn
ẋ = Ax
Fall - 2022 26 / 58
αn i=1
x(t)
At
• Instead of studying e we can now study e λ i t
Example: how does x(t) evolve over time if x(t) = 2e−3t + 7e5t ?
Fall - 2022 27 / 58
Classes of Dynamical Systems
• Besides Linear Systems, other classes of dynamical systems exist
Fall - 2022 28 / 58
LT I : P = {A, B, C, D}
Fall - 2022 29 / 58
• The system
ẋ(t) = f (t, x(t), u(t))
y(t) = g(t, x(t), u(t))
defines a nonlinear time-varying system (NLTV).
Fall - 2022 30 / 58
Equilibrium Points and Stability
Fall - 2022 31 / 58
Definition
A state xe ∈ IRn and an input ue ∈ IRm are an equilibrium pair if for an
initial condition x(0) = xe and constant input u(t) ≡ ue , the state
remains constant, i.e.,
x(t) ≡ xe , ∀t ≥ 0
Fall - 2022 32 / 58
Definition
A state xe ∈ IRn and an input ue ∈ IRm are an equilibrium pair if
f (xe , ue ) = 0 =⇒ ẋ(t) = 0 ∀t
Definition
If xe ∈ IRn and an input ue ∈ IRm are an equilibrium pair then
• xe is called the equilibrium state
• ue is called the equilibrium input
Fall - 2022 33 / 58
Stability of Equilibrium Points
Fall - 2022 34 / 58
Fall - 2022 35 / 58
Figure: Stable
6
https://www.math24.net/stability-theory-basic-concepts/
Fall - 2022 36 / 58
Equilibrium points and stability for LTI systems
Fall - 2022 37 / 58
(
ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
Equilibrium points:
• Pairs (xe , ue ) such that Axe + Bue = 0
• (xe , ue ) = (0, 0) is an evident equilibrium, valid for any linear
system
Fall - 2022 38 / 58
Fall - 2022 39 / 58
Example - Mass-Spring-Damper
• Check the stability of the mass-spring-damper system if M = 25,
K = 24, and β = 8
0 1 0
ẋ(t) = k β x(t) + 1 u(t)
−M −M M
| {z } | {z }
A B
y(t) = 1 0 x(t)
| {z }
C
Fall - 2022 40 / 58
Fall - 2022 41 / 58
Example - Mass-Spring-Damper
• Since all the eigenvalues have a negative real part (e.g., −0.16)
we can conclude that the system is asymptotically stable
Fall - 2022 42 / 58
Mass-Spring-Damper: Simulation
Starting from any initial state x(0) = [1, 0]T and for a constant input
u(t) = 1, ∀ t ≥ 0, the mass-spring-damper system will asymptotically
settle down (after a transitory period) to an equilibrium point
Fall - 2022 43 / 58
Fall - 2022 44 / 58
Fall - 2022 46 / 58
Fall - 2022 47 / 58
Fall - 2022 48 / 58
Linearization of nonlinear dynamical state-space
models around an equilibrium pair
• Given a nonlinear state-space model (set of n nonlinear
differential equation of order 1):
f1 (x(t), u(t))
ẋ(t) = ..
.
fn (x(t), u(t))
where x = [x1 , . . . , xn ]T , u = [u1 , . . . , um ]T
• The linearized model around an equilibrium pair (xe , ue ) is
˙
x̃(t) = Al x̃(t) + Bl ũ(t)
∂f1 ∂f1 ∂f1 ∂f1
∂x1 ... ∂xn ∂u1 ... ∂um
Al = .. ..
Bl = .. ..
. ... . . ... .
∂fn ∂fn ∂fn ∂fn
∂x1 ... ∂xn (xe ,ue ) ∂u1 ... ∂um (xe ,ue )
where x̃ = x − xe and ũ = u − ue
Fall - 2022 49 / 58
˙
x̃(t) = Al x̃(t) + Bl ũ(t)
• Question:
Fall - 2022 50 / 58
Theorem
Consider a NLTI system ẋ = f (x), with f differentiable, and its
linearization
˙
x̃(t) = Al x̃(t)
obtained considering the equilibrium point xe = 0.
• If x̃˙ = Al x̃ is asymptotically stable, then x = 0 is a locally
asymptotically stable equilibrium point for the NLTI system
• If x̃˙ = Al x̃ is unstable, then x = 0 is an unstable equilibrium for
the NLTI system
• If x̃˙ = Al x̃ is marginally stable, nothing can be said about the
stability of x = 0 for the NLTI system
7
g is the force per unit mass due to gravity
Fall - 2022 52 / 58
Fall - 2022 53 / 58
Fall - 2022 55 / 58
Fall - 2022 56 / 58
Thank you!
Fall - 2022 57 / 58
References I
Alberto Bemporad
Lecture Slides: Identification, Analysis and Control of Dynamical Systems
http://dysco.imtlucca.it/courses/iacds/, 2018.
Fall - 2022 58 / 58