differential-algebraic equations (daes) and numerical methods€¦ · differential-algebraic...

25
Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan

Upload: others

Post on 14-Jun-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Differential-Algebraic Equations(DAEs) and numerical methods

by Sirui Tan

Page 2: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Definition of DAEs

F (t, y , y ′) = 0,

where y:R→Rm is the solution, F :R×R

m ×Rm→R

m is a given function.∂ F

∂ y ′nonsingular ⇒ explicit ODE

y ′ = f(t, y).

semi-explicit DAE (or ODE with constraints)

x′ = f(t, x, z), (differential equation)

0 = g(t, x, z). (algebraic eqution)

2

Page 3: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Example 1. simple pendulum

Figure 1. simple pendulum

z(t) Lagrange multiplier

x1′′ = − z x1,

x2′′ = − z x2− g,

x12 + x2

2 = 1.

In standard form

x1′ = x3,

x2′ = x4,

x3′ = − z x1,

x4′ = − z x2− g,

0 = z12 + z2

2− 1.

3

Page 4: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Index

Minimum number of differentiations of the system which would be required tosolve for y ′ uniquely in terms of y and t (i.e., to obtain an explicit ODE).

It measures the distance from a DAE to its related ODE. It reveals the mathe-matical structure and potential complications in the analysis and the numericalsolution of the DAE.

The higher the index of a DAE, the more difficulties for its numerical solution.

Example:

• index-1 DAE

y = q(t).

since y ′= q ′(t) explicit ODE.

• index-2 DAE

y1 = q(t),

y2 = y1′.

since y2′ = y1

′′= q ′′(t).

4

Page 5: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Special DAE forms

• Hessenberg Index-1 system (or semi-explicit index-1 system)

x′ = f(t, x, z),

0 = g(t, x, z).

Jacobian matrix gz nonsingular.

x(t) differential variables, z(t) index-1 algebraic variables.

• Hessenberg Index-2 system

x′ = f(t, x, z),

0 = g(t, x).

gx fz is nonsingular.

z(t) index-2 variables. Pure index-2 DAE.

5

Page 6: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Example 2. Navier-Stokes equations

ut + u ux + v uy + px − ν(uxx + uyy) = 0,

vt + u vx + v vy + py − ν (vxx + vyy) = 0,

ux + vy = 0.

after spatial discretization (FD, FV, FE)

M u′+ (K + N(u)) u + C p = f ,

CT u = 0.

CT M−1 C is a nonsingular matrix with a bounded inverse⇒Hessenberg Index-2system.

6

Page 7: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Consistent initial values

Index-2 system

x(t) = sin(t)

x′ (t)+ y(t) = 0.

consistent� satisfying the algebraic constraint

x(t) = sin(t)

and hidden constraints

y(t) = − x′(t)=− cos(t).

Consistent initial values

x(0) = sin(0),

y(0) = − cos(0).

7

Page 8: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Applications

• constrained mechanical systems (e.g. simple pendulum, N-S equations)

• electrical circuits

large but sparse DAE of the form

M(y) y ′+ f(y) = q(t).

• chemical reaction kinetics

8

Page 9: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Numerical methods

Semi-explicit index-1 or index-2 DAE

x′ = f(t, x, z),

0 = g(t, x, z).

limiting case of the singularly perturbedODE

x′ = f(t, x, z),

εz ′ = g(t, x, z),

where 0 6 ε≪ 1.

Observations: consider methods for stiff ODEs.

9

Page 10: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Crank-Nicolson method

Explicit ODE

y ′ = f(t, y).

C-N methodyn − yn−1

h=

1

2(f (tn, yn) + f(tn−1, yn−1)).

Index-2 DAE

x(t) = sin(t)

x′(t)+ y(t) = 0

exact solution

x(t) = sin(t),

y(t) = − cos(t).

C-N method1

2(xn + xn−1) =

1

2(sin(tn)+ sin(tn−1))

xn −xn−1

h+

1

2(yn + yn−1) = 0.

10

Page 11: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Exact initial values

x0 = sin(0),

y0 = − cos(0).

0 1 2 3 4 5 6 7 8 9−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

x(t)

y(t)

Figure 2. C-N method, exact initial values, h = 0.04.

11

Page 12: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Perturbed initial values

x0 = sin(0) + h3,

y0 = − cos(0).

0 1 2 3 4 5 6 7 8 9 10−3

−2

−1

0

1

2

3

x(t)

y(t)

Figure 3. C-N method, perturbed initial values, h = 0.04.

12

Page 13: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Conclusion: A-stability is not enough.

x′ = f(t, x, z),

εz ′ = g(t, x, z),

where 0 6 ε≪ 1.

Set ε= 0 ⇒ the limit DAE.

13

Page 14: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Methods with stiff decay

test equation

y ′ = λ(y − g(t)),

or

ε y ′ = λ̂ (y − g(t)),

where ε=1

|Re(λ)|, λ̂ = ε λ. |λ̂ |= 1.

Set ε= 0⇒ y(t) = g(t).

The method has stiff decay if tn > 0 fixed

yn→ g(tn) as ε→ 0 + .

C-N method does not have stiff decay.

14

Page 15: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Backward Euler method

Index-2 DAE

x(t) = sin(t),

x′(t)+ y(t) = 0.

BE method

xn = sin(tn),xn − xn−1

h+ yn = 0.

15

Page 16: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Exact initial values

x0 = sin(0),

y0 = − cos(0).

0 1 2 3 4 5 6 7 8 9 10−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

x(t)

y(t)

Figure 4. BE method, exact initial values, h = 0.04.

16

Page 17: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Perturbed initial values

x0 = sin(0) + h,

y0 = − cos(0).

0 1 2 3 4 5 6 7 8 9 10−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

x(t)

y(t)

Figure 5. BE method, perturbed initial values, h = 0.04.

17

Page 18: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Multistep methods

The only method with stiff decay is the BDF method.

Semi-explicit index-1 or index-2 DAE

x′ = f(t, x, z),

0 = g(t, x, z).

BDF method

1

β0 h

j=0

k

αj xn−j = f (tn, xn, zn),

0 = g(tn, xn, zn).

18

Page 19: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Convergence of BDF

Theorem: the k-step BDF method is convergent of order p= k for k 6 6, i.e.,

xn −x(tn) = O(hp), zn − z(tn) = O(hp),

whenever the initial values satisfy

• if k 6 2

xj −x(tj)= O(hp+1) for j = 0,� , k − 1.

• if k > 3

xj −x(tj)= O(hp) for j = 0,� , k − 1.

19

Page 20: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Multistage methods

If we consider collocation methods, the only method with stiff decay is theRadau method.

Semi-explicit index-1 or index-2 DAE

x′ = f(t, x, z),

0 = g(t, x, z).

Radau method

ti = tn−1 + ci h, i = 1,� , s,

Ki = f(ti, Xi, Zi),

Xi = xn−1 + h∑

j=1

s

aij Kj ,

0 = g(ti, Xi, Zi).

and (since asj = bj , j = 1,� , s.)

xn = Xs, zn = Zs.

20

Page 21: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Convergence of the Radau method

Theorem: the s-stage Radau method is convergent of order 2 s− 1 for xn and oforder s for zn. (No order reduction for xn.)

21

Page 22: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Practical difficulties

• obtaining a consistent set of initial conditions

Given x0, solve for z0 from 0 = g(0, x0, z0). What’s the initial guess?

• ill-conditioning of iteration matrix

e.g. backward Euler method, iteration matrix

(

hn−1 I − fx − fz

− gx − gz

)

condition number O(hn−1). If hn small, Newton iteration fails?

• Error estimation for index-2 DAEs

22

Page 23: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Available codes

code method authors DAE index

DASSL/DASPK BDF Petzold 6 1

RADAU5 IRK Hairer, Wanner 6 3

MEBDF MEBDF Abdulla, Cash 6 3

Table 1. a list of available codes for DAEs

23

Page 24: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

Summary

• DAEs are generalizations of ODEs. The index indicates the distance fromits underlying ODE and thus the difficulty. We should be careful whenimposing initial conditions.

• Methods with stiff decay perform well for solving DAEs, e.g, BDF methodand the Radau collocation method.

24

Page 25: Differential-Algebraic Equations (DAEs) and numerical methods€¦ · Differential-Algebraic Equations (DAEs) and numerical methods by Sirui Tan. Definition of DAEs F(t, y, y ′)

References

• Uri M. Ascher and Linda R. Petzold, Computer Methods for OrdinaryDifferential Equations and Differential-Algebraic Equations.

• E. Hairer and G. Wanner, Solving Ordinary Differential Equations II:Stiff and Differential-Algebraic Equations.

• K. E. Brenan, S. L. Campbell and L. R. Petzold, Numerical Solution ofInitial-Value Problems in Differential-Algebraic Equations.

• Series of lectures on DAEs, URL:http://www.win.tue.nl/casa/meetings/seminar/previous/

25