Modeling Physics with Differential-Algebraic Equations Lecture 1 - - PowerPoint PPT Presentation

modeling physics with differential algebraic equations
SMART_READER_LITE
LIVE PREVIEW

Modeling Physics with Differential-Algebraic Equations Lecture 1 - - PowerPoint PPT Presentation

Modeling Physics with Differential-Algebraic Equations Lecture 1 General Introduction to Differential Equations COMASIC (M2) December 4th, 2019 Khalil Ghorbal k halil.ghorbal@inria.fr K. Ghorbal (INRIA) 1 COMASIC M2 1 / 21 Ordinary


slide-1
SLIDE 1

Modeling Physics with Differential-Algebraic Equations

Lecture 1

General Introduction to Differential Equations

COMASIC (M2) December 4th, 2019

Khalil Ghorbal khalil.ghorbal@inria.fr

  • K. Ghorbal (INRIA)

1 COMASIC M2 1 / 21

slide-2
SLIDE 2

Ordinary Differential Equations

Intuitions

Functional equation with derivatives

(x′, y′) = dx dt , dy dt

  • = (˙

x, ˙ y) = (−y, x − y)

Local description of motion

  • K. Ghorbal (INRIA)

2 COMASIC M2 2 / 21

slide-3
SLIDE 3

Ordinary Differential Equations

Intuitions

Functional equation with derivatives

(x′, y′) = dx dt , dy dt

  • = (˙

x, ˙ y) = (−y, x − y)

Local description of motion

  • K. Ghorbal (INRIA)

2 COMASIC M2 2 / 21

slide-4
SLIDE 4

Ordinary Differential Equations

Very Useful

Ordinary (or Total) vs Partial ( ∂

∂u)

  • K. Ghorbal (INRIA)

3 COMASIC M2 3 / 21

slide-5
SLIDE 5

Ordinary Differential Equations

Very Useful

Ordinary (or Total) vs Partial ( ∂

∂u)

Sophus Lie

“Among all of the mathematical disciplines the theory of differential equations is the most important(...) It furnishes the explanation of all those elementary manifestations of nature which involve time.”

  • K. Ghorbal (INRIA)

3 COMASIC M2 3 / 21

slide-6
SLIDE 6

Ordinary Differential Equations

Very Useful

Ordinary (or Total) vs Partial ( ∂

∂u)

Sophus Lie

“Among all of the mathematical disciplines the theory of differential equations is the most important(...) It furnishes the explanation of all those elementary manifestations of nature which involve time.”

Convenient modeling language

  • Continuous dynamics (vs discrete)
  • No Boundary conditions (entire space)
  • No memory (next state completely determined from the current)
  • K. Ghorbal (INRIA)

3 COMASIC M2 3 / 21

slide-7
SLIDE 7

Langton’s ant

Conway’s Game of Life

An ant starts somewhere on a black and white squared plane

  • if the square is white, the ant turns right then move forward
  • if the square is black, the ant turns left then move forward
  • the ant flips the color of its square before moving
  • 20
  • 10
10 20 30
  • 20
  • 10
10 20
  • 20
  • 10
10 20
  • 30
  • 20
  • 10
10 20 30
  • K. Ghorbal (INRIA)

4 COMASIC M2 4 / 21

slide-8
SLIDE 8

Solving Differential Equations

Analytical/Symbolic

  • Cauchy-Lipschitz theorem: Local existence and unicity theorem

(assuming Lipschitz continuity) f : R → R is Lipschitz continuous in X ⊂ R if and only if there exists K ≥ 0 such that |f (y) − f (x)| ≤ K|y − x|, ∀x, y ∈ X

  • Solutions often involve transcendental functions (sine, exp, etc.) For

instance the first-order homogeneous equation y′ = ay: y = y0 exp(at)

  • Liouville theorem: No closed form solutions in general x′ = exp(−t2)

then x(t) = 2 √π x exp(−t2)dt

  • K. Ghorbal (INRIA)

5 COMASIC M2 5 / 21

slide-9
SLIDE 9

Solving Differential Equations

Analytical/Symbolic

  • Cauchy-Lipschitz theorem: Local existence and unicity theorem

(assuming Lipschitz continuity) f : R → R is Lipschitz continuous in X ⊂ R if and only if there exists K ≥ 0 such that |f (y) − f (x)| ≤ K|y − x|, ∀x, y ∈ X

  • Solutions often involve transcendental functions (sine, exp, etc.) For

instance the first-order homogeneous equation y′ = ay: y = y0 exp(at)

  • Liouville theorem: No closed form solutions in general x′ = exp(−t2)

then x(t) = 2 √π x exp(−t2)dt

  • K. Ghorbal (INRIA)

5 COMASIC M2 5 / 21

slide-10
SLIDE 10

Solving Differential Equations

Analytical/Symbolic

  • Cauchy-Lipschitz theorem: Local existence and unicity theorem

(assuming Lipschitz continuity) f : R → R is Lipschitz continuous in X ⊂ R if and only if there exists K ≥ 0 such that |f (y) − f (x)| ≤ K|y − x|, ∀x, y ∈ X

  • Solutions often involve transcendental functions (sine, exp, etc.) For

instance the first-order homogeneous equation y′ = ay: y = y0 exp(at)

  • Liouville theorem: No closed form solutions in general x′ = exp(−t2)

then x(t) = 2 √π x exp(−t2)dt

  • K. Ghorbal (INRIA)

5 COMASIC M2 5 / 21

slide-11
SLIDE 11

Finite Time Explosion Problems

  • x′ = x2, x(0) = x0 (Only locally Lipschitz)
  • x(t) =

1

1 x0 −t

  • Singularity at t = 1

x0 , maximum interval (−∞, 1 x0 )

  • 2.0
  • 1.5
  • 1.0
  • 0.5
0.5 1.0 1 2 3 4
  • K. Ghorbal (INRIA)

6 COMASIC M2 6 / 21

slide-12
SLIDE 12

Solving Differential Equations

Numerical

Numerical Integration

Euler Integration Schemes x′ = f (x) x• = x + f (x)δ Explicit x• = x + f (x•)δ Implicit Other similar Integration Schemes: the Runge-Kutta family

  • K. Ghorbal (INRIA)

7 COMASIC M2 7 / 21

slide-13
SLIDE 13

Solving Differential Equations

Numerical

Numerical Integration

Euler Integration Schemes x′ = f (x) x• = x + f (x)δ Explicit x• = x + f (x•)δ Implicit Other similar Integration Schemes: the Runge-Kutta family

Picard Iterations

x• = x + δ f (x)dt It boils down to approximate the integral term

  • K. Ghorbal (INRIA)

7 COMASIC M2 7 / 21

slide-14
SLIDE 14

Numerical Integration:Convergence and Stability

Numerical Analysis

  • Convergence: does the numerical scheme approximates the solution

when the discrete step goes toward zero ? The order gives the local quality of convergence.

  • Stability: the propagation of errors (stiffness).
  • K. Ghorbal (INRIA)

8 COMASIC M2 8 / 21

slide-15
SLIDE 15

Numerical Integration:Convergence and Stability

Numerical Analysis

  • Convergence: does the numerical scheme approximates the solution

when the discrete step goes toward zero ? The order gives the local quality of convergence.

  • Stability: the propagation of errors (stiffness).

(x′, y′) = (−y, x) Euler (order 1) Runge-Kutta (order 4)

  • K. Ghorbal (INRIA)

8 COMASIC M2 8 / 21

slide-16
SLIDE 16

Other Methods

  • Geometrical Integration: invariant-aware integration (e.g.

Symplectic Methods)

  • Quantized State Systems (QSS) Methods: efficient when

simulating sparse systems

  • K. Ghorbal (INRIA)

9 COMASIC M2 9 / 21

slide-17
SLIDE 17

Other Methods

  • Geometrical Integration: invariant-aware integration (e.g.

Symplectic Methods)

  • Quantized State Systems (QSS) Methods: efficient when

simulating sparse systems (x′, y′) = (−y, x) Symplectic Integration

  • K. Ghorbal (INRIA)

9 COMASIC M2 9 / 21

slide-18
SLIDE 18

Qualitative Analysis

( ˙ x1, ˙ x2) = (x1 − x3

1 − x2 − x1x2 2, x1 + x2 − x2 1x2 − x3 2)

  • Algebraic

Invariant Equation

The solution for x0 = (1, 0) respects x1(t)2 + x2(t)2 − 1 = 0 ∀t

  • K. Ghorbal (INRIA)

10 COMASIC M2 10 / 21

slide-19
SLIDE 19

Why Are Invariants Important ?

Numerical Integration & Qualitative Analysis

  • More precise numerical integration (Geometrical Integration)
  • Better understanding of the dynamics without solving the problem

(some invariants represent conserved quantities like momentum or energy)

Formal Verification

  • Formal verification for dynamical and hybrid systems
  • Static Analysis (as templates to statically analyze an implementation)
  • Safety, Reachability, Stability
  • K. Ghorbal (INRIA)

11 COMASIC M2 11 / 21

slide-20
SLIDE 20

Problem I. Checking Invariance of Algebraic Equations

Given ˙ x = (−2x2, −2x1 − 3x2

1), p(x0) = 0, is p(x(t)) = 0 for all t ?

  • p(x1, x2) = x2

1 + x3 1 − x2 2

p(x1, x2) = x1 − x2

2

  • K. Ghorbal (INRIA)

12 COMASIC M2 12 / 21

slide-21
SLIDE 21

Problem I. Checking Invariance of Algebraic Equations

Given ˙ x = (−2x2, −2x1 − 3x2

1), p(x0) = 0, is p(x(t)) = 0 for all t ?

  • p(x1, x2) = x2

1 + x3 1 − x2 2

p(x1, x2) = x1 − x2

2

  • K. Ghorbal (INRIA)

12 COMASIC M2 12 / 21

slide-22
SLIDE 22

Problem II. Generate Algebraic Invariant Equations

Given ˙ x = (−x1 + 2x2

1x2, −x2), how to generate p such that p(x(t)) = 0 ?

  • K. Ghorbal (INRIA)

13 COMASIC M2 13 / 21

slide-23
SLIDE 23

Problem II. Generate Algebraic Invariant Equations

Given ˙ x = (−x1 + 2x2

1x2, −x2), how to generate p such that p(x(t)) = 0 ?

  • p(x1(0),x2(0))(x1, x2) = (x2(0)−x1(0)x2(0)2)x1 − x1(0)(x2 − x1x2

2) = 0

  • K. Ghorbal (INRIA)

13 COMASIC M2 13 / 21

slide-24
SLIDE 24

Problem II. Generate Algebraic Invariant Equations

Given ˙ x = (−x1 + 2x2

1x2, −x2), how to generate p such that p(x(t)) = 0 ?

  • p(x1(0),x2(0))(x1, x2) = (x2(0)−x1(0)x2(0)2)x1 − x1(0)(x2 − x1x2

2) = 0 x1 x2−x1x2

2 is an invariant rational function.

  • K. Ghorbal (INRIA)

13 COMASIC M2 13 / 21

slide-25
SLIDE 25

So far ...

1 Ordinary Differential Equations:

  • Cauchy-Lipschitz theorem: existence and uniqueness of solutions
  • Liouville theorem: no closed form solutions in general
  • Numerical integration: convergence and stability
  • Qualitative analysis: invariant regions

2 Next: Differential-Algebraic Equations (Examples)

  • K. Ghorbal (INRIA)

14 COMASIC M2 14 / 21

slide-26
SLIDE 26

Pendulum

(Photo source: Wolfram)

  • K. Ghorbal (INRIA)

15 COMASIC M2 15 / 21

slide-27
SLIDE 27

Pendulum

(Photo source: Wolfram)

¨ x = −λx ¨ y = −λy − g (Newton’s law) = L2 − x2 − y2 (Algebraic constraint)

  • K. Ghorbal (INRIA)

15 COMASIC M2 15 / 21

slide-28
SLIDE 28

Pendulum

(Photo source: Wolfram)

¨ x = −λx ¨ y = −λy − g (Newton’s law) = L2 − x2 − y2 (Algebraic constraint) State variables: (x, y, ˙ x, ˙ y): x, y differential variables λ algebraic variable

  • K. Ghorbal (INRIA)

15 COMASIC M2 15 / 21

slide-29
SLIDE 29

Analytical Mechanics

Lagrange Equations

Lagrange Equations

d dt ∂L ∂ ˙ q

  • − ∂L

∂q = Q + F tλ

  • Lagrangian: L = T − U (Kinetic and potential Energies)
  • Generalized coordinates q = (q1, . . . , qn)
  • Holonomic constraints: f (q) = 0
  • Nonconservative forces: Q
  • F t: the transpose of the Jacobian of f
  • λ: vector of Lagrange multipliers
  • K. Ghorbal (INRIA)

16 COMASIC M2 16 / 21

slide-30
SLIDE 30

RLC Circuit

  • K. Ghorbal (INRIA)

17 COMASIC M2 17 / 21

slide-31
SLIDE 31

RLC Circuit

˙ VC = I

C

˙ I = VL

L

= VR − RI Ohm’s Law = VS − VR − VL − VC Algebraic Constraint State variables: (VR, VC, VL, I)

  • K. Ghorbal (INRIA)

17 COMASIC M2 17 / 21

slide-32
SLIDE 32

Tracking Control Problems

Inverted Pendulum - Segway

(Photo source: Wikipedia)

State variables: (θ, x) L = 1 2Mv2

1 + 1

2mv2

2 − mgℓ cos(θ)

v1 = d dt x, 0

  • v2 =

d dt (x − ℓ sin(θ)), d dt (ℓ cos(θ))

  • K. Ghorbal (INRIA)

18 COMASIC M2 18 / 21

slide-33
SLIDE 33

Inverted Pendulum, Continued

Lagrange Equations

F = (M + m)¨ x − mℓ¨ θ cos(θ) + mℓ ˙ θ2 sin(θ) ¨ x cos(θ) = ℓ¨ θ − g sin(θ)

  • K. Ghorbal (INRIA)

19 COMASIC M2 19 / 21

slide-34
SLIDE 34

Inverted Pendulum, Continued

Lagrange Equations

F = (M + m)¨ x − mℓ¨ θ cos(θ) + mℓ ˙ θ2 sin(θ) ¨ x cos(θ) = ℓ¨ θ − g sin(θ) Control Problem: Find F such that θ ∈ [θr − ǫ, θr + ǫ] for some given reference value θr

  • K. Ghorbal (INRIA)

19 COMASIC M2 19 / 21

slide-35
SLIDE 35

Some Forms of DAEs

  • Non-Linear (inverted pendulum):

f (˙ x, x, t) = 0, (f nonlinear)

  • Linear (RLC circuit):

A(t)˙ x + B(t)x + c(t) = 0 .

  • Semi-Explicit (pendulum):

˙ x = f (x, y, t) = g(x, y, t) .

  • K. Ghorbal (INRIA)

20 COMASIC M2 20 / 21

slide-36
SLIDE 36

Some Forms of DAEs

  • Non-Linear (inverted pendulum):

f (˙ x, x, t) = 0, (f nonlinear)

  • Linear (RLC circuit):

A(t)˙ x + B(t)x + c(t) = 0 .

  • Semi-Explicit (pendulum):

˙ x = f (x, y, t) = g(x, y, t) .

  • K. Ghorbal (INRIA)

20 COMASIC M2 20 / 21

slide-37
SLIDE 37

Some Forms of DAEs

  • Non-Linear (inverted pendulum):

f (˙ x, x, t) = 0, (f nonlinear)

  • Linear (RLC circuit):

A(t)˙ x + B(t)x + c(t) = 0 .

  • Semi-Explicit (pendulum):

˙ x = f (x, y, t) = g(x, y, t) .

  • K. Ghorbal (INRIA)

20 COMASIC M2 20 / 21

slide-38
SLIDE 38

To conclude

Next Lecture: More on DAEs

  • Index reduction
  • Numerical integration
  • Modelling tools

Some References

  • Wolfgang Walter: Ordinary Differential Equations. Springer New York,

1998

  • Ernst Hairer, Christian Lubich, Gerhard Wanner: Geometric Numerical
  • Integration. Springer Berlin Heidelberg, 2009
  • Peter Kunkel, Volker Mehrmann: Differential-Algebraic Equations.

European Mathematical Society, 2006

  • K. Ghorbal (INRIA)

21 COMASIC M2 21 / 21