Modelling Physical Phenomena

Similar documents
Numerical Integration of Equations of Motion

Differential-Algebraic Equations (DAEs)

Index Reduction and Discontinuity Handling using Substitute Equations

An initialization subroutine for DAEs solvers: DAEIS

INRIA Rocquencourt, Le Chesnay Cedex (France) y Dept. of Mathematics, North Carolina State University, Raleigh NC USA

CHAPTER 10: Numerical Methods for DAEs

Differential Equation Types. Moritz Diehl

An Implicit Runge Kutta Solver adapted to Flexible Multibody System Simulation

The Plan. Initial value problems (ivps) for ordinary differential equations (odes) Review of basic methods You are here: Hamiltonian systems

Numerical integration of DAE s

Technische Universität Berlin

Four Point Gauss Quadrature Runge Kuta Method Of Order 8 For Ordinary Differential Equations

Semi-implicit Krylov Deferred Correction Methods for Ordinary Differential Equations

5. Coupling of Chemical Kinetics & Thermodynamics

MODELLING OF RECIPROCAL TRANSDUCER SYSTEM ACCOUNTING FOR NONLINEAR CONSTITUTIVE RELATIONS

Stabilität differential-algebraischer Systeme

Delay Differential-Algebraic Equations

Partitioned Methods for Multifield Problems

CS 257: Numerical Methods

A note on the uniform perturbation index 1

Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations

AIMS Exercise Set # 1

10.34: Numerical Methods Applied to Chemical Engineering. Lecture 19: Differential Algebraic Equations

A New Block Method and Their Application to Numerical Solution of Ordinary Differential Equations

Review: control, feedback, etc. Today s topic: state-space models of systems; linearization

Numerical Treatment of Unstructured. Differential-Algebraic Equations. with Arbitrary Index

Three-Tank Experiment

Modeling and Experimentation: Compound Pendulum

Научный потенциал регионов на службу модернизации. Астрахань: АИСИ, с.

Theoretical Models of Chemical Processes

On The Numerical Solution of Differential-Algebraic Equations(DAES) with Index-3 by Pade Approximation

Chapter 2 Optimal Control Problem

Numerical Methods for Engineers


ETNA Kent State University

ECE 422/522 Power System Operations & Planning/Power Systems Analysis II : 7 - Transient Stability

Ordinary Differential Equations (ODEs)

Computer Aided Design of Thermal Systems (ME648)

COMPARISON OF TWO METHODS TO SOLVE PRESSURES IN SMALL VOLUMES IN REAL-TIME SIMULATION OF A MOBILE DIRECTIONAL CONTROL VALVE

A relaxation of the strangeness index

The one-dimensional equations for the fluid dynamics of a gas can be written in conservation form as follows:

An Immersed Boundary Method for Restricted Diffusion with Permeable Interfaces

Finite Element Decompositions for Stable Time Integration of Flow Equations

Mathematical Models with Maple

Chapter 17. Finite Volume Method The partial differential equation

Various lecture notes for

Application of Dual Time Stepping to Fully Implicit Runge Kutta Schemes for Unsteady Flow Calculations

European Consortium for Mathematics in Industry E. Eich-Soellner and C. FUhrer Numerical Methods in Multibody Dynamics

c 2004 Society for Industrial and Applied Mathematics

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations

Efficient numerical methods for the solution of stiff initial-value problems and differential algebraic equations

Ordinary differential equations - Initial value problems

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

ODE - Problem ROBER. 0.04y y 2 y y y 2 y y y 2 2

SYMMETRIC PROJECTION METHODS FOR DIFFERENTIAL EQUATIONS ON MANIFOLDS

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

TAU Solver Improvement [Implicit methods]

Impact of the HP Preheater Bypass on the Economizer Inlet Header

NORGES TEKNISK-NATURVITENSKAPELIGE UNIVERSITET. Singly diagonally implicit Runge-Kutta methods with an explicit first stage

Initial value problems for ordinary differential equations

Research Article On the Numerical Solution of Differential-Algebraic Equations with Hessenberg Index-3

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester

Solution: In standard form (i.e. y + P (t)y = Q(t)) we have y t y = cos(t)

Modeling & Simulation 2018 Lecture 12. Simulations

Numerical Oscillations and how to avoid them

Development of Dynamic Models. Chapter 2. Illustrative Example: A Blending Process

Dynamic Process Models

Spectral Methods for Reaction Diffusion Systems

Time integration. DVI and HHT time stepping methods in Chrono

Chapter 3 Numerical Methods

Differential Equations

Newton s Method and Efficient, Robust Variants

Time-adaptive methods for the incompressible Navier-Stokes equations

Development of Dynamic Models. Chapter 2. Illustrative Example: A Blending Process

Finite volumes for complex applications In this paper, we study finite-volume methods for balance laws. In particular, we focus on Godunov-type centra

Butcher tableau Can summarize an s + 1 stage Runge Kutta method using a triangular grid of coefficients

Investigation on the Most Efficient Ways to Solve the Implicit Equations for Gauss Methods in the Constant Stepsize Setting

Use of Differential Equations In Modeling and Simulation of CSTR

16.7 Multistep, Multivalue, and Predictor-Corrector Methods

Dynamic Programming with Hermite Interpolation

Chapter 1. Introduction to Nonlinear Space Plasma Physics

Strategies for Numerical Integration of Discontinuous DAE Models

Applied Numerical Analysis

CS520: numerical ODEs (Ch.2)

Local Time Step for a Finite Volume Scheme I.Faille F.Nataf*, F.Willien, S.Wolf**

Solving Constrained Differential- Algebraic Systems Using Projections. Richard J. Hanson Fred T. Krogh August 16, mathalacarte.

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

The family of Runge Kutta methods with two intermediate evaluations is defined by

Numerical Solutions to Partial Differential Equations

COMP 558 lecture 18 Nov. 15, 2010

GEOMETRIC INTEGRATION OF ORDINARY DIFFERENTIAL EQUATIONS ON MANIFOLDS

E. KOFMAN. Latin American Applied Research 36: (2006)

Entrance Exam, Differential Equations April, (Solve exactly 6 out of the 8 problems) y + 2y + y cos(x 2 y) = 0, y(0) = 2, y (0) = 4.

Numerical Methods for the Solution of Differential Equations

AC&ST AUTOMATIC CONTROL AND SYSTEM THEORY SYSTEMS AND MODELS. Claudio Melchiorri

Solving PDEs with PGI CUDA Fortran Part 4: Initial value problems for ordinary differential equations

INTEGRATION OF THE EQUATIONS OF MOTION OF MULTIBODY SYSTEMS USING ABSOLUTE NODAL COORDINATE FORMULATION

A Stand Alone Quantized State System Solver. Part I

Numerical Analysis. A Comprehensive Introduction. H. R. Schwarz University of Zürich Switzerland. with a contribution by

Differential equations, comprehensive exam topics and sample questions

Transcription:

Modelling Physical Phenomena Limitations and Challenges of the Differential Algebraic Equations Approach Olaf Trygve Berglihn Department of Chemical Engineering 30. June 2010

2 Outline Background Classification DAE-types, index and stiffness Model examples Index reduction strategies Modeling guidelines Initialization Discontinuities Industry example Where DAEs do not fit Current research and outlook Conclusion

3 Differential Algebraic Equations Ordinary differential equations with algebraic constraints on the variables. (Drawing by K. Wanner.)

4 Solution approach I ẏ = f(y, x, t), G(y, x, t) = 0 Nested approach Given y n, t n, solve G(y n, x, t n ) = 0, and evolve y n+1 using ODE-methods. Required approach if only explicit integrator is available (Euler, Runge-Kutta, etc). Can be expensive due to inner iterations.

5 Solution approach II F (ẏ, y, x, t) = 0 Simultaneous approach Solve the implicit or semi-explicit form simultaneously using an implicit solver and evolve both x and y in time. Requires an implicit solver. Is much more efficient. Provides for more flexible problem specification. This talk will focus on the simultaneous approach.

6 Typical models using DAE-formulation Chemical engineering processes with equilibrium conditions. Constrained mechanical systems, robots. Electrical circuits and power grids. Heating, ventilating and air-conditioning of buildings.

7 Evolution of DAE-solvers Gear LSODI (Hindmarch) DASSL (Petzold) IDA (Hindmarch, Taylor) ode15s (Shampine, Reichelt) GELDA (Kunkel, Merhmann) MANPACK (Rheinboldt) ode15i (Shampine, Reichelt) RADAU5 (Hairer, Wanner), COLDAE (Ascher, Spiteri) BzzDae (Manca, Buzzi-Ferraris) GENDA (Kunkel, Mehrmann, Seufer) 1970 1980 1990 2000 2010 A selection of the more commonly cited solvers.

8 Papers published containing Differential Algebraic Equations Papers per year 160 140 120 100 80 60 40 20 0 1970 1980 1990 2000 2010 (Source: Scopus)

9 Papers published by discipline Engineering Mathematics Computer Science Other Chemistry Biochemistry, Genetics and Molecular Biology Environmental Science Energy Physics and Astronomy Materials Science Chemical Engineering (Source: Scopus)

10 Classification I DAEs are primarily classified by type, index and stiffness. DAE-types Fully implicit: F (ẏ, y, x, t) = 0. Linearly implicit: A(y, x)ẏ = f(y, x, t), 0 = g(y, x, t) Semi-explicit: ẏ = f(y, x, t), 0 = g(y, x, t)

11 Classification II Differentiation index F (ẏ, y, x, t) = 0 has differentiaion index v = Ind(F ) if v is the minimal number of analytical differentiations F (ẏ, y, x, t) = 0, F (ẏ, y, x, t) x = 0,..., v F (ẏ, y, x, t) x v = 0 (1) such that equations (1) allow us to extract by algebraic manipulations an explicit ordinary differential equations system. Initial conditions must satisfy all intermediate algebraic relations.

12 Classification III Stiffness If both fast and slow processes are included in the model, the model becomes stiff. Consider the following system: ẋ 1 = 10 2 x 1 ẋ 2 = 10 2 x 1 10 4 x 2 x 1 (0) = 1, x 2 (0) = 0 Reduction in x 2 is one million times faster than the reduction in x 1. Stability in integration is dictated by the fastest dynamics. Stiff systems require capable stiff solvers, or exceedingly small time stepping.

13 Hessenberg index 1-form ẏ = f(y, x) If g x is invertible, we can write ( ) x g 1 t = g x y f and have a system of only ODEs. (2a) 0 = g(y, x) (2b)

14 Hessenberg index 2-form I ẏ = f(y, x) (3a) 0 = g(y) (3b) We attempt to convert the set of equations to only ODEs by differentiation of (3b): 0 = g y y t = g y f (4) One differentiation does not do. We see that (4) is a hidden constraint of (3).

15 Hessenberg index 2-form II A second differentiation yields: 0 = 2 g y 2 f + g f y y f + g f x y x t (5) Assuming g y f x is invertible, this yields ( x g t = y ) f 1 ( 2 g x y 2 + g y ) f f. (6) y

16 Consequences of high index Index v > 1 imply constraints on the differential variables. Consider this semi-explicit index-2 system: ẏ = f(y, x) (7a) 0 = g(y) (7b) Initial conditions must satisfy g y f = 0 (8) Hidden constraints presents difficulties for DAE-solvers.

17 Example: Tank with overflow I ˆN (f), z i ˆN (o) N j, x j, v j ˆN Mole flow, f =feed, o=overflow N i Number of moles x i, z i Mole fractions v Molar specific volume i Component index, i {a, b} N a = ˆN (f) z a ˆN (o) x a N b = ˆN (f) z b ˆN (o) x b N = N a + N b N a = x a N N b = x b N v = v a x a + v b x b V = vn INDEX 2

18 Example: Tank with overflow II ˆN (f), z i N a = ˆN (f) z a ˆN (o) x a N b = ˆN (f) z b ˆN (o) x b N j, x j, v j ˆN (o) N = N a + N b N a = x a N N b = x b N v = v a x a + v b x b V = vn ˆN (o) v = ˆN (f) (v a z a + v b z b ) INDEX-1

19 Example: Tank with overflow III ˆN (f), z i N a = ˆN (f) z a ˆN (o) x a N b = ˆN (f) z b ˆN (o) x b N j, x j, v j ˆN (o) N = N a + N b N a = x a N N b = x b N v = v a x a + v b x b V = vn ˆN (o) v = ˆN (f) (v a z a + v b z b ) INDEX-1

20 Example: Pressure vessel with variable volume I ˆN, h x N, U, p, T Ṅ = ˆN U = p V + ˆNh pv = NRT U = Nc v T Linearly-implicit index-1. Requires implicit DAE solver. pa = F x V = Ax F x = kx

21 Example: Pressure vessel with variable volume II V = s ˆN, h x N, U, p, T Ṅ = ˆN U = ps + ˆNh pv = NRT U = Nc v T Introduce dummy variable s. Semi-explicit index-2. Requires index-2 capable DAE solver. pa = F x V = Ax F x = kx

22 Example: Pressure vessel with variable volume III Symbolic differentiation of volume and elimination yields: U = Ṅ = ˆN ( prax 2 ) 1 prax 2 + pc v Ax 2 + V c v k pv = NRT U = Nc v T pa = F x V = Ax F x = kx Semi-explicit index-1. Not intuitive how to do this! ˆNh

23 Causes of high index Imposing constraints on differential variables is the major problem. Assumption of infinitely fast dynamics Pseudo-steady state approximations and equilibrium conditions. Specification on derived states p = ( ) U V S,N If U is a differential variable (in energy balance), specifying impose constraint on U. p = p spec

24 How to handle high index and implicit systems Implicit Use implicit solvers or rewrite to semi-explicit form. High index Use high-index capable solver or reformulate and use symbolic differentiation. Pitfalls Exchanging an algebraic constraint with a differential equation can cause drift. High index capable solvers are very sensitive to scaling. Symbolic derivation and manipulation is error prone. The change from implicit to semi-explicit increases the index.

25 Index reduction strategies a) Remodeling Model round the index problem. Include fast dynamics. Makes the model stiff. Include rate equations for flows and reactions. Transform into other variables (x = r cos θ, y = r sin θ). b) Remove variables and equations or lump control volumes. Implies loss of detail. c) Reduce index by index reduction algorithms Involves symbolic differentiation and manipulation. Several strategies reported in the literature.

26 Modeling guidelines Procedure to reach index-1 models: a) Conservation equations: Formulate dynamic differential equations for the conserved quantities. b) Constitutive equations: Express dependent state variables from the conserved quantities. c) Rate equations: Express rates by difference in potential.

27 Modeling guidelines: Example I Calculate pressure and temperature in a perfectly insulated gas pipe: Assumptions: Ideal gas, constant heat capacity. Adiabatic pipe, neglect heat capacity of walls, constant volume. Sub-sonic, turbulent flow. Simple valve equation for flow. Uniform pressure and temperature in pipe segment.

28 Modeling guidelines: Example II Constitutive equations: express T : express p: N and U U = N Z T pv = NRT T ref c vdt express p: p = 1 (p + p1) 2 Conservation on the number of moles and internal energy: express N: Ṅ = ˆN (0) ˆN (1) express U: U = ˆN (0) h (0) ˆN (1) h (1) ˆN (1) express h 1: h 1 = Z T T ref c pdt Rate equations: express ˆN (1) : ˆN (1) = k 1 q p(p p (1) ) p, p and T

29 Initialization Finding consistent initial conditions is a major obstacle with index > 1 models. Some possible approaches: Structural Successive Linear Programming (SLP) Gauss-Newton-Maquardt methods using singular value decomposition.

30 Initialization: Structural approach Develop derivative array equations: F (ẏ, y, x, t) = 0, F (ẏ, y, x, t) x. = 0, v F (ẏ, y, x, t) x v = 0 Analyze variable occurrence of the complete system, choose pivoting variables among (ẏ, y, x) from among all equations, and solve this set at t(0).

31 Initialization: Successive Linear Programming Develop derivative array equations: Solve G(y, y t,, n y t n, t) = 0 ( min G y, y ) t,, n y t n, 0 1 using Successive Linear Program (SLP).

32 Initialization: Gauss-Newton-Maquardt Develop derivative array equations: Solve G(y, y t,, n y t n, t) = 0 ( min G y, y ) t,, n y t n, 0 2 using Singular Value Decomposition (SVD).

33 Discontinuities Consider this definition of mass m: m(t) = ρ(x, t)dv (9) We write the time differential dm dt = d ρ(x, t)dv dt Ω Equation (10) is only valid if ρ is continuous over Ω. Remedy: Locate discontinuities. Integrate over piecewise smooth segments. Use smooth transition (tanh) Ω? Ω ρ(x, t)dv (10) t Some solvers can locate and traverse discontinuities.

developing a model for predicting the pressure buildup, temperatures etc. in the pipe, such that 34 safe procedures for hydrate removal may be devised. This report documents the current status of the model (July 13, 2005), and documents the assumptions, model equations, numerics and Industry program structure. example: Direct electrical heating of gas hydrate plug Figure 1-1 shows the hydrate melting process schematically. There is a hydrate plug that blocks a pipe, and an external heat flux, Q 10 (t,x), is applied to the pipe in order to remove the plug. The external heat flux may vary with axial position and time. Model of direct heating of pipe line plugged by hydrate. r,z Q 10 θ x Figure 1-1. Melting hydrate plug Very stiff problem pipe elasticity. Discontinuous heating of hydrate vs. melting of hydrate. As a result of the external heating, the hydrate plug will start melting, and melted fluid leaves by axial flow in both directions. The present model assumes that all melted fluid leaves by flowing in the annular Assumptions gap that forms between can lead the pipe to high and the index. plug; i.e. there is no flow of melted fluid inside the plug (conservative assumption). Careful scaling is essential. As the plug is assumed to seal the pipe completely when the heating starts, there will be a

35 Industry example: results x 10 7 Pressure Pressure [Pa] 2.08 2.07 2.06 2.05 2.04 2.03 0 10.52632 21.05263 31.57895 42.10526 52.63158 63.15789 73.68421 84.21053 94.73684 105.2632 115.7895 126.3158 136.8421 147.3684 157.8947 168.4211 178.9474 189.4737 200 2.02 2.01 2 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 Time [s] x 10 4

36 Limitations of DAEs Where DAEs do not fit: Purely discrete systems. Time discrete event. Cellular automaton Game of Life. Stochastic systems. Can the system be made continuous? Can jumps be made continuous transitions? Model on the continuous parameters of a distribution?

37 Current research and outlook A lot of specialized solvers published in recent years. Focus on model building software to aid modeling. Validated numerics for DAEs: give guaranteed interval for solution. Interval integration: given input set, what is output set? Will the process be stable?

38 Conclusion Modeling dynamic systems with constraints is challenging. Great care must be taken to avoid index problems. A good modeling methodology is essential. Index reduction can be applied, but is not trivial.

39 Selected bibliography I K. E. Brenan, S. L. Campell, and L. R. Petzold. Numerical solution of initial-value problems in differential-algebraic equations. North-Holland, New York, 1989. Charles. W. Gear. Simultaneous numerical solution of differential-algebraic equations. IEEE Trans. Circuit Theory, CT-18:89 95, 1971. E. Hairer, Norsett S. P., and G. Wanner. Solving Ordinary, Differential Equations II. Stiff and Differential-Algebraic Problems, volume 2. 2Ed. Springer-Verlag, 2002, 2002. ISBN 3-540-60452-9. Index.

40 Selected bibliography II Peter Kunkel. Differential-algebraic equations: analysis and numerical solution. European Mathematical Society, 2006. Volker Mehrmann and Lena Wunderlich. Hybrid systems of differential-algebraic equations - analysis and numerical solution. Journal of Process Control, 19(8):1218 1228, 2009. ISSN 0959-1524. Special Section on Hybrid Systems: Modeling, Simulation and Optimization. Håvard Ingvald Moe. Dynamic Process Simulation, Studies on Modeling and Index Reduction. PhD thesis, University of Trondheim, 1995.

41 Selected bibliography III Linda Petzold. Differential/algebraic equations are not ode s. SIAM Journal on Scientific and Statistical Computing, 3(3):367 384, 1982.