modeling physics - sayanmitracode.github.io

48
Modeling Physics Sayan Mitra Verifying cyberphysical systems [email protected]

Upload: others

Post on 27-Mar-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

ModelingPhysics• Dynamical system models – notions of solutions – Linear dynamical systems – Connection to automata – Stability – Lyapunov method
Lecture Slides by Sayan Mitra [email protected]
Map of CPS models
Discrete transition systems, automata
Markov chains
Continuous time, continuous state MDPs
Stochastic Hybrid systems
Hybrid systems
All this was in the two plague years 1665 and 1666, for in those days I was in my prime of age for invention, and minded mathematics and philosophy more than at any time since. ---Isaac Newton
From: Wilczek, Frank. A Beautiful Question: Finding Nature's Deep Design (p. 87).
Introduction to dynamical systems
Behaviors of physical processes are described in terms of instantaneous laws
Common notation: !" # !#
= , , − 1 ,
where time ∈ ; state ∈ .; ∈ 3; :. × 3 × → .
Example. !" # !#
= () ; !: # !#
= −
Initial value problem: Given system (1) and initial state < ∈ ., < ∈ , and input u: → 3, find a state trajectory or solution of (1).
Lecture Slides by Sayan Mitra [email protected]
Notions of solution
What is a solution? Many different notions.
Definition 1. (First attempt) Given < and , : → . is a solution or trajectory iff (1) < = < and (2) !
!# = ( , , )), ∀ ∈ .
Mathematically makes sense, but too restrictive. Assumes that is not only continuous, but also differentiable. This disallows u() to be discontinuous, which is often required for optimal control.
Lecture Slides by Sayan Mitra [email protected]
Getting from point a to point b
2
1
0
1
2
time
0
10
20
30
po si ti on
Modified notion Definition. ⋅ is a piece-wise continuous with set of discontinuity points ⊆ 3 if (1) ∀ ∈ , lim
#→HI < ∞; lim
=
(3) ∀ < < M , <, M ∩ is finite
( <, M , 3) is the set of all piece-wise continuous functions over the domain <, M
Define , = , , , for a given . Since is PC in so is in the second argument.
Definition 2. Given < and , : → . is a solution or trajectory iff (1) < = < and (2) !
!# = ( , ), ∀ ∈ \D.
M T

Lecture Slides by Sayan Mitra [email protected]
Is PC input adequate for guaranteeing existence of solutions?
Example. = − ; < = ; < = 0; > 0 Solution: = − for ≤ ; check = −1 Problem: discontinuous is
Example. = T; < = ; < = 0; > 0 Solution: = [
M\#[ works for < 1/; check
Problem: As → M [
Lecture Slides by Sayan Mitra [email protected]
Lipschitz continuity
A function :. → is Lipschitz continuous if there exist > 0 such that for any pair , ′ ∈ ., − ′ ≤ − `
Examples: 6 + 4; ; all differentiable functions with bounded derivatives
Non-examples: ; T (locally Lipschitz)
Lecture Slides by Sayan Mitra [email protected]
Existence and uniqueness of solutions
Theorem. If ( , ) is Lipschitz continuous in the first argument then (1) has unique solutions.
Transition system model
Lecture Slides by Sayan Mitra [email protected]
Linear time-varying systems In general, for nonlinear dynamical systems we do not have closed form solutions for , but there are numerical solvers like CAPD, VNODE
= + --- (2) = +
continuous everywhere except "
Theorem. Let , <, <, be the solution for (2) with points of discontinuity , " 1. ∀< ∈ , < ∈ ., ∈ ,3 , ⋅, <, <, : → . is continuous and differentiable ∀ ∈ " 2. ∀, < ∈ , ∈ ,3 , , <,⋅, : . → . is continuous 3. ∀, < ∈ , <M, <T ∈ ., M,T ∈ ,3 , M, T ∈ , , <, M<M + T<T, MM + TT =
M , <, <M, M + T , <, <T, T 4. ∀, < ∈ , < ∈ ., ∈ ,3 , , <, <, = , <, <, + , <, 0,
Lecture Slides by Sayan Mitra [email protected]
Example 1: Simple model of an economy
• : national income • : rate of consumer spending • : rate government expenditure
• = − • = − −
0 2 4 6 8 10 12 14 time(t)
5
0
5
10
15
20
= + ()
For a given initial state < ∈ ., < ∈ (. ) ∈ (,.) the solution is a function . , <, <, : → .
We studied several properties of in the last lecture: continuity with respect to first and third argument, linearity, decomposition
Lecture Slides by Sayan Mitra [email protected]
Linear system and solutions
• Since . , <, <, : → . is a linear function of the initial state and input,
• , <, <, = , <, 0, + . , <, <, 0 • Let us focus on the linear function . , <, <, 0 • Define Φ . , < < = . , <, <, • This Φ . , < : → .×. is called the state transition matrix
Lecture Slides by Sayan Mitra [email protected]
Properties of Φ
• Φ . , < : → .×o is the unique solution of (2) and is defined by a (Peano-
Baker) infinite sequence of integrals
• p p# Φ , < = Φ(, <) with Φ , =
– Continuous everywhere
– Differentiable everywhere except " ( isn’t)
• ∀<, M, Φ , < = Φ , M Φ M, <
• Φ , < is invertible Φ , < \M = Φ <,
Lecture Slides by Sayan Mitra [email protected]
Solution of linear systems in Φ
Theorem.
, <, <, = Φ , < < + r #s
# Φ ,
Lecture Slides by Sayan Mitra [email protected]
Linear time invariant system
Matrix exponential:
T + … =x <
, <, <, = <eu(#\#s) + r #s
# eu(#\H)
Lecture Slides by Sayan Mitra [email protected]
Discrete time models / discrete transition systems
• + 1 = , • + 1 = ( ) autonomous • Execution: <, < , T < , … • = , <, – = ., < = < – :. → .; T() = ()
• Deterministic
Discretized or sampled-time model
• = , • Assume: ∈ , ⊆ 3 is a finite set • , <, <, • Fix a sampling period > 0 • = , <, , – = ., < = < , = , – ⊆ .×× .; , , ` ∈ T iff ` = (, 0, , )
Lecture Slides by Sayan Mitra [email protected]
Properties for dynamical systems
What type of properties are we interested in? • Invariance (as in the case of automata) • State remains bounded • Converges to target • Bounded input gives bounded output (BIBO)
Lecture Slides by Sayan Mitra [email protected]
Requirements: Stability
• We will focus on time invariant autonomous systems (closed systems, systems without inputs)
• = , < ∈ ., < = 0 –(1) • is the solution • | | norm • ∗ ∈ . is an equilibrium point if ∗ = 0. • For analysis we will assume 0 to be an equilibrium point of (1)
with out loss of generality
Lecture Slides by Sayan Mitra [email protected]
Example: Pendulum
T = M
T
up rig
ht do
w n
speed=0
Aleksandr M. Lyapunov
Aleksandr Mikhailovich Lyapunov (June 6 1857–November 3, 1918) was a Russian mathematician and physicist.
His methods make it possible to define the stability of ordinary differential equations. In the theory of probability, he generalized the works of Chebyshev and Markov, and proved the Central Limit Theorem under more general conditions than his predecessors.
Lecture Slides by Sayan Mitra [email protected]
Lyapunov stability
Lyapunov stability: The system (1) is said to be Lyapunov stable (at the origin) if ∀ > 0 ∃ > 0 such that < ≤ ⇒ ∀ t ≥ 0, <, ≤ .
How is this related to invariants and reachable states ?


<
Asymptotically stability
The system (1) is said to be Asymptotically stable (at the origin) if it is Lyapunov stable and ∃T> 0 such that ∀ < ≤ T as t → ∞, <, → .
If the property holds for any T then Globally Asymptotically Stable
Lecture Slides by Sayan Mitra [email protected]
T <
x1
2.0
1.5
1.0
0.5
0.0
0.5
1.0
1.5
= 2MT MT − TT
All solutions converge to 0 but the equilibrium point (0,0) is not Lyapunov stable
*Not discussed in class
Van der pol oscillator
T − 1 − T
+ = 0
T M
stable ?
Stability of solutions* (instead of points)
• For any ∈ PC <, . define the s-norm   = sup #∈
| |
• A dynamical system can be seen as an operator that maps initial states to signals :. → <,.
• Lyapunov stability required that this operator is continuous
• The solution ∗ is Lyapunov stable if is continuous as ∗(0) . i. e. , for every > 0 there exists > 0 such that for every < ∈ . if ∗ 0 − < ≤ then ∗ − <  
≤ .
Verifying Stability for Linear Systems
Consider the linear system =
Theorem. 1. It is asymptotically stable iff all the eigenvalues of A have strictly negative real parts (Hurwitz).
2. It is Lyapunov stable iff all the eigenvalues of A have real parts that are either zero or negative and the Jordan blocks corresponding to the eigenvalues with zero real parts are of size 1.
Jordan decomposition
For every n x n matrix A, there exists a nonsingular n x n matrix P such that
where each £ is a upper triangular matrix called a Jordan block
Example 1: Simple model of an economy
• : national income : rate of consumer spending; : rate government expenditure
• = − • = − − • = < + , , are positive constants • What is the equilibrium? • ∗ = s¤
¤\M\{¤ ∗ = s¤
Example: Simple linear model of an economy
• = 3, = 1, = 0
• M, M∗ = (−.25 ± 1.714)
• Negative real parts, therefore, asymptotically stable and the national income and consumer spending rate converge to = 1.764 = 5.294
Stability of nonlinear systems
• For any positive definite function of state :. → – ≥ 0 and = 0 iff = 0
• Sublevel sets of « = { ∈ . | ≤ } • ( ) V differentiable with continuous first derivative
• = ® ¯ # !#
Verifying Stability
Theorem. (Lyapunov) Consider the system (1) with state space ∈ . and suppose there exists a positive definite, continuously differentiable function :. → . The system is:
1. Lyapunov stable if = p® p" ≤ 0, for all ≠ 0
2. Asymptotically stable if < 0, for all ≠ 0 3. It is globally AS if V is also radially unbounded.
Proof sketch: Lyapunov stable if ≤ 0
• Assume ≤ 0 • Consider a ball B around the origin of
radius > 0. • Pick a positive number < min
" ´ .
• Let be a radius of ball around origin which is inside Bµ = ≤ }
• Since along all trajectories V is non- increasing, starting from µ each solution satisfies ≤ and therefore remains in B
B ¶ µ
Proof sketch: Asymptotically stable if < 0 • Assume < 0 • Take arbitrary initial state 0 ≤ , where this comes from some
for Lyapunov stability • Since . > 0 and decreasing along it has a limit ≥ 0 at → ∞ • It suffices to show that this limit is actually 0 • Suppose not, c > 0 then the solution 0 evolves in the compact set = ≤ ≤ } for some sufficiently small
• Let = max "∈º
() [slowest rate]
• This number is well-defined and negative • ≤ for all t • ≤ 0 + • But then eventually <
B
T
• Use = M T MT + TT ≥ 0
• = M M + T T =−MT −TT +M T + T M ≤ −MT −TT +
M T |MT| + |TM|
We conclude global asymptotic stability (in fact global exponential stability) without knowing solutions
M − T T ≥ 0
MT + TT ≥ 2 MT
MT ≤ 1 2 (M
M = −M + (T)
T = −T + (M)
Proposition. If V is a Lyapunov function then every sublevel set of V is an invariant
Proof. = = 0 + ∫<
# ≤ ((0))
• = ,<, – : set of variables
– < ⊆ – ⊆ × written as a program ′ ⊆ ()
• How do we check that ⊆ () is an inductive invariant? – < ⇒ ()
– ⇒ ( )
• Implies that < ⊆ without computing the executions or reachable states of A
• The key is to find such
Finding Lyapunov Functions
• The key to using Lyapunov theory is to find a Lyapunov function and verify that it has the properties
• In general, for nonlinear systems this is hard • There are several approaches – Quadratic Lyapunov functions for linear systems – Decide the form/template of the function (e.g., quadratic,
polynomial), parameterized by some parameters and find values of the parameters so that the conditions hold (Chapter 3 last section)
Linear autonomous systems
• = , ∈ .×.
• The Lyapunov equation: À + + = 0 where , ∈ .×. are symmetric
• Interpretation: = À then = À + À()
[using chain rule pÁ ÂÃ: p#
= pÁ p# + p:
= À À + = −À
• If À is the generalized energy then −À is the associated dissipation
Quadratic Lyapunov Functions
• If > 0 (positive definite) • = À = 0 ⇔ = 0 • The sub-level sets are ellipsoids • If > 0 then the system is globally asymptotically stable
Same example
T equations in + 1 /2 variables. Cost O(Ç)
Choose = 1 0 0 1 solving Lyapunov
equations we get = 2.59 −2.29 −2.29 4.92 and
we get the quadratic Lyapunov function − ∗ − ∗ À an a sequence of
invariants
Converse Lyapunov
Converse Lyapunov theorems show that conditions of the previous theorem are also necessary. For example, if the system is asymptotically stable then there exists a positive definite, continuously differentiable function V, that satisfies the inequalities.
For example if the LTI system = is globally asymptotically stable then there is a quadratic Lyapunov function that proves it.
Small puzzle
• Platonic solids. Solid bodies whose faces are regular polygons, all identical, that meet in identical fashion at every vertex. How many such are there? Exactly five!