INSE 6640: Smart Grids and Control System Security: Lecture 7 - Mathematical Modeling of Physical Systems
INSE 6640: Smart Grids and Control System Security: Lecture 7 - Mathematical Modeling of Physical Systems
Security
Fall 2020
Fall 2020 1 / 54
Outline
1 Motivations
3 Linear Systems
Fall 2020 2 / 54
What are we going to study in the second part of the
class?
• We have seen that control systems play a major role in Smart Grid
operations;
• A smart grid is a “cyber-physical system” (CPS), where we have
physical systems, cyber components and communication
infrastructures. Such components are highly coupled;
• Security of Smart Grid is not only a cyber problem. Cyber-attacks
have physical consequences.
• In the first part of the class (Lectures 1-6) we have seen cyber
models and cyber security measures for Smart Grid. In the
second part of the class (Lectures 8-11), we will investigate
control systems security.
Fall 2020 3 / 54
Networked Control Systems in Smart Grid
Fall 2020 4 / 54
Security Questions in Networked Control Systems
Fall 2020 5 / 54
Security Questions in Networked Control Systems
Fall 2020 6 / 54
Physical Plant (System) in CPS
Input Output
Input Output
Input Output Input Output
Input
Output
Input Output Input
Output
Fall 2020 7 / 54
Physical Plant Dynamical Model
• The way the system evolves over time is called 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 (y(t)),
under the effect of an external excitation u(t) or autonomously (if
u(t) ≡ 0)
Fall 2020 8 / 54
Why is a Dynamical Model Useful?
Fall 2020 9 / 54
How can we derive a dynamical model of a system?
Fall 2020 10 / 54
Introduction to Linear Systems
Fall 2020 11 / 54
What is it a linear system?
Fall 2020 12 / 54
Dynamical Model of a Linear System
where:
• x(t) := [x1 , x2 , · · · , xn ]T ∈ IRn is state vector of the system
• u(t) := [u1 , u2 , · · · , ur ]T ∈ IRr is input vector of the system
• y(t) := [y1 , y2 , · · · , ym ]T ∈ IRm is output vector of the system
• A ∈ IRn×n , B ∈ IRn×r , C ∈ IRm×n , and D ∈ IRm×r
Fall 2020 14 / 54
Linear Systems: block scheme representation
(
ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
Fall 2020 15 / 54
Example: mass-spring-damper system (1/4)
Fall 2020 16 / 54
Example: mass-spring-damper system (2/4)
( (
ẋ1 (t) = ż(t) x˙1 (t) = x2 (t)
⇒ β K 1
ẋ2 (t) = z̈(t) x˙2 (t) = − M x2 (t) − M x1 (t) + M u(t)
Fall 2020 18 / 54
Example: mass-spring-damper system (4/4)
1
u=1 xdot s x y
Input x0=[1;0] Measurements
B C
Fall 2020 19 / 54
How can we obtain the states evolution of the system?
(
ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
Proposition
Given the continuous-time linear system ẋ = Ax + Bu, with initial
condition x(0) = x0 ∈ IRn , there exist a unique solution x(t)
forced response
natural response z }| {
z }| { Z t
At A(t−τ )
x(t) = e x0 + e Bu(τ )dτ
Z t 0
At A(t−τ )
y(t) = C(e x(0)) + C e Bu(τ )dτ + Du(t)
0
Fall 2020 20 / 54
Example: Lagrange’s Formula
1
xdot s x ytotal
Input u=1 x0=[1;0] y
B C
1
u=0 xdot s x
x0=[1; 0] y due to the initial condition x0
B1 C1
Comparison
A1 xdot
1 Lagrange Formula
u=1 xdot s x
Input u =1 x0=[0;0] y due to the external input
B2 C2
Fall 2020 21 / 54
Math Recap: Eigenvalues and Eigenvectors
Fall 2020 22 / 54
Eigenvalues and Eigenvectors
Avi = λi vi
Fall 2020 23 / 54
Diagonalizable Matrix
A = T ∆T −1
λ1 0 . . . 0
0 λ2 . . . 0
∆= = T −1 AT, T = [v1 |v2 . . . |vn ]
.. .. . . .
. . . ..
0 0 . . . λn
Fall 2020 24 / 54
Example - Mass-Spring-Damper
• Find the eigenvalues and eigenvectors 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 2020 25 / 54
Example - Mass-Spring-Damper: Eigenvalues
• By using the MATLAB command “eig(A)” we obtain
• V, reading by column, contains the eigenvectors
• D, on the diagonal, contains the eigenvalues
Fall 2020 26 / 54
Why eigenvalues and eigenvectors are so important?
ẋ = Ax
x(t) = eAt x0
Fall 2020 27 / 54
Why eigenvalues and eigenvectors are so important?
• If A is diagonalizable we can rewrite the response as
λt
e 1 0 ... 0
0 e λ2 t . . . 0
x(t) = eAt x0 = T e∆t T −1 x0 = [v1 . . . vn ] . α
.. .. ..
| {z } .. . . .
α
0 0 . . . eλn t
α1 n
λn t ..
X
λ1 t
= [v1 e . . . vn e ] . = αi eλi t vi
αn i=1
x(t)
• The evolution depends upon the eigenvalues λi of A
• The exponentials eλi (t) are called the modes of the system
• E.g. What will happen over time if x(t) = 2e−3t + 2e5t ?
Fall 2020 28 / 54
Classes of Dynamical Systems
Fall 2020 29 / 54
Other classes of dynamical systems (1/2)
Fall 2020 30 / 54
Other classes of dynamical systems (2/2)
• The system
ẋ(t) = f (x(t), u(t))
y(t) = g(x(t), u(t))
with
Fall 2020 31 / 54
Equilibrium Points and Stability
Fall 2020 32 / 54
Equilibrium points of generic nonlinear systems
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 2020 33 / 54
How to find equilibrium points?
ẋ(t) = f (x(t), u(t))
y(t) = g(x(t), u(t))
Definition
A state xe ∈ IRn and an input ue ∈ IRm are an equilibrium pair if
f (xe , ue ) = 0
Definition
If xe ∈ IRn and an input ue ∈ IRm are an equilibrium pair the
• xe is called equilibrium state
• ue is called equilibrium input
Fall 2020 34 / 54
Stability of Equilibrium Points
Fall 2020 35 / 54
Stability of Equilibrium Points
Fall 2020 36 / 54
Stable and asymptotically stable
Figure: Stable
1
1
https://www.math24.net/stability-theory-basic-concepts/
Fall 2020 37 / 54
Equilibrium Points and Stability of Linear Systems
Fall 2020 38 / 54
Equilibrium points of linear systems
(
ẋ(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 a obvious equilibrium, valid for any linear system
Fall 2020 39 / 54
Stability of linear systems
(
ẋ(t) = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
Theorem
Let λ1 , . . . , λm , m ≤ n be the eingenvalues of A ∈ IRn×n .
• Asymptotically stable if and only if (iff) <[λi ] < 0, ∀i
• Unstable if ∃ i such that <[λi ] > 0 or ∃ <[λi ] = 0 with algebraic
multiplicity different from the geometric multiplicity.
• Stable or Marginally Stable if <[λi ] ≤ 0, ∀i and the eigenvalues
with <[λi ] = 0 have equal algebraic and geometric multiplicity
Fall 2020 40 / 54
Example - Mass-Spring-Damper
Fall 2020 41 / 54
Mass-Spring-Damper: Simulation
Fall 2020 42 / 54
Stability of equilibrium points of Nonlinear Systems
Fall 2020 43 / 54
Stability of equilibrium points of Nonlinear Systems
Fall 2020 45 / 54
Lyapunov indirect method: Idea
ẋ(t) = f (x(t), u(t))
Fall 2020 46 / 54
Linearization around an equilibrium point
• Given a NLTI system ẋ(t) = f (x(t), u(t))
• Linearizing the system, around (xe , ue ), using the Taylor series of
f (x, u) approximated to the first order derivative
∂f (x, u) ∂f (x, u)
f (x, u) = f (xe , ue ) + x̃ + ũ
∂x ∂u
| {z } (xe ,ue ) (xe ,ue )
=0
we obtain
˙
x̃(t) = Ax̃(t) + B ũ(t)
x̃ = x − xeq, u − ueq
ũ =
A = ∂f ∂x
(x,u)
, B= ∂f (x,u)
∂u (x ,u )
(xe ,ue ) e e
Fall 2020 47 / 54
Lyapunov indirect method: Theorem
Theorem
Consider a NLTI system ẋ = f (x) with f differentiable, xe = 0 an
equilibrium point. Given the LTI approximation of ẋ = f (x)
˙ ∂f
x̃(t) = Ax̃(t), A= (x − 0)
∂x
Fall 2020 48 / 54
Example - Pendulum
Next Lecture
The non-linear state-space representation of the pendulum is:
ẋ(t) = f (x(t))
where
ẋ1 (t) x2 (r) h
ẋ(t) = , f (x(t)) = g , H :=
ẋ2 (t) − l sin x1 (t) − Hx2 (t), ml2
Next Lecture
Fall 2020 50 / 54
Pendulum - Stability of first equilibrium points
Fall 2020 51 / 54
Pendulum - Stability of first equilibrium points
Fall 2020 52 / 54
Thank you!
Fall 2020 53 / 54
References
A. Bemporad
Lecture Slides: Identification, Analysis and Control of Dynamical Systems
IMT School for Advanced Studies Lucca, 2018.
Fall 2020 54 / 54