# Course information, PhD course in simulation, 9 hp

# Contents

- Introduction to simulation
- Simulation of ordinary differential equations, including stiff problems
- Simulation of differential-algebraic equations
- Modelica and simulation of object-oriented models

# Examination

- Hand in of mandatory exercises in exercises (2022-01-27).
- For the DAE-part, mandatory participation in exercise solving classes, demonstrating your own solutions.
- Report of a mandatory mini-project in a topic related to the course. For examepl, choose a simulation model, possibly related to your research project, and demonstrate the correctness of the simulation.
- Oral examination: Exaplain and discuss theory and methods
- Extra work can merit extra credits

# Course plan

## Meeting 1 - Introduction/simulation of ordinary differential equations

**Course meeting**-
**Responsible**: Lars E **Contents**-
Basic ODE:

Problem formulations (some classic problems from Hairer-Norsett-Wanner), existance and uniqueness.

Simple one-step methods, implicit and explicit. **Course material**- Material covering existance and uniqueness from Hairer, Norsett and Wanner and from Dahlqvist och Björk.

## Meeting 2 - Introduction/simulation of ordinary differential equations

**Course meeting**-
**Responsible**: Lars E, OH **Contents**-
Concepts: Convergence, consistency, 0-stability, absolute stability. Stiff decay.

Explicit one step methods: Runge-Kutta family.

Step length control, parameters för step length control. **Course material**- First 4 chapters in Ascher-Petzold until page 95.

## Meeting 3 - Introduction/simulation of ordinary differential equations

**Course meeting**-
**Responsible**: Lars E, OH **Contents**- More on implicit and multi-step methods.

Steplength control, parameters for steplength control. Zero detection.

Start implementation of an explicit (or implicit) method with steplength control.

Continued work on implementation and exercises in the course. **Course material**-
- Ascher och Petzold, remaining parts of Chapter 4 and Chapter 5.
- Deuflhard och Bornemann,
*"Scientific Comupting with Ordniary Differential Equations"*. Chapter 5 on step length control. - John Mathews,
*"Computer Derivations of Numerical Differentiation Formulae (Classroom Notes)"*Int. J. of Math. Education in Sci. and Tech., V 34, No 2 (March-April 2003), pp.280-287.

## Meeting 4 - Introduction/simulation of ordinary differential equations

**Course meeting**-
**Responsible**: Lars E, OH **Contents**- A little on BVP.

Continued work on implementation and exercises.

Survey/review and analysis of Matlab's solvers.

Traps and pitfalls. **Course material**-
- Chapter 6-8 in Ascher and Petzold, with emphasis on Chapters 6-7.
- More material on stiff differential-equations from Shampine och Gear A User's View of Solving Stiff Ordinary Differential Equations.
- Kjell Gustafsson,
*"Traps and Pitfalls in Simulantion"*.

## Meeting 5 - Introduction/simulation of ordinary differential equations

**Course meeting**-
**Responsible**: Lars E **Contents**- Discussion about results from hand in assignments.
**Course material**

## Meeting 6 - Simulation of differential-algebraic equations

**Responsible**: Erik

**Contents**-
- Motivating examples, some models
- Existence conditions for solutions to DAE:S, what do they look like?
- What separates an ODE from a DAER and when can an ODE solver be used to integrate DAE:s?
- Index, what is it and what does it mean? Complications and different definitions.
- Initial conditions.
- Why are index-1 easy and index larger than 1 difficult to simulate?

**Course meeting**- OH
**Course material**-
- C.W. Gear and L. Petzold,
*"ODE methods for the solution of differential/algebraic systems"*, SIAM Journal on Numerical Analysis, Vol. 21, No. 4. (Aug., 1984), pp. 716-728. - Sid 372-381 samt 452-454 i Hairer del 2.
- L. Petzold,
*"Differential/Algebraic Equations are not ODE's"*, SIAM journal on scientific and statistical computing, vol. 3, no. 3, 367-384, 1982.

*"The index of general nonlinear DAEs"*, Numerische Mathematik, Vol 72, No. 2, 173-196, 1995 gives a thorough description of different index for anyone interested. - C.W. Gear and L. Petzold,
**Exercises**: 2.1-3, 2.5, 2.7, 2.10a, 2.11

## Meeting 7 - Simulation of differential-algebraic equations

**Responsible**: Erik

**Contents**-
- Introduction to method for semi-explicit index-1 DAE:s
- state-space
- epsilon-embedding + implicit Runge-Kutta
- BDF (DASSL)

- Pantelides algorithm for determination of consistent initial conditions
- Some methods for index reduction
- Problems with drift and possible solutions
- Baumgarte stabilization
- Projection methods

- Some about order and convergence with solvers, stiffly accurate methods
- ODE/DAE:er with invariants
- The unstructured problem F(y',y,x)=0 and overdetermined models

- Introduction to method for semi-explicit index-1 DAE:s
**Course meeting**- OH
**Course material**-
- pages 455-480 in Hairer part 2

**Exercises**: 2.26, 2.14-15, 2.18, 2.22, 2.33

## Meeting 8 - Modelica and simulation of object-oriented models

**Responsible**: Erik F

**Contents**-
- Adjoint sensitivity analysis
- Introduction to equation based models
- How to go from a Modelica model to simulation code in C
- Structural index
- How can you, in the model, give clues to the solver for choice of states and initial conditions.
- How to automatically generate crossing/event-functions

**Course meeting**- OH
**Course material**-
- If you want to known a lot on how DASSL/DASPK is
implemented, then I recommend Chapter 5 in K.E. Brenan,
S.L. Campbell and
L.R. Petzold,
*"Numerical Solution of Initial-Value Problems in Differential.Algebraic Equations"*, SIAM, 1996. Describes the solver in detail. - Cao, Yang, et al.
*"Adjoint sensitivity analysis for differential-algebraic equations: The adjoint DAE system and its numerical solution"*. SIAM journal on scientific computing 24.3 (2003): 1076-1089. Rather technical paper: I suggest to read and Section 1, 2.1, 4.1-4.2 in a first reading. - Kapitel 17,18 i
*"Principles of Object-Oriented Modeling and Simulation with Modelica 2.1"*av P. Fritzson. For those not familiar with Modelica, recommended reading in Chapter 2. - G. Reissig, W.S. Martinson, P.I. Barton,
*" Differential--Algebraic Equations of Index 1 May Have an Arbitrarily High Structural Index"*, SIAM Journal on Scientific Computing, Volume 21, Number 6, pp. 1987-1990, 2000. - For the interested, a brief, somewhat incomplete, but still interesting description of how OpenModelica goes from model to C code. Adrian Pop, OpenModelica Compiler Phases, Open Source Modelica Consortium, 2008-05-26.
- H. Elmqvist and
M. Otter,
*"Methods for tearing systems of equations in object-oriented modeling"*, Proceedings of the European Simulation Multiconference, pp. 326-332, Barcelona, Spain, 1994. - Examples for Sundials -- IDAS that compiles on charger (have a look at idasRoberts_ASAi_dns.c for adjoint sensitivity example). If you are interested, I recommend looking into the documentation, eg.., for the IDAS solver https://computing.llnl.gov/sites/default/files/public/idas_guide.pdf.

- If you want to known a lot on how DASSL/DASPK is
implemented, then I recommend Chapter 5 in K.E. Brenan,
S.L. Campbell and
L.R. Petzold,
**Exercises**: 2.9, 2.10b-d, 2.31

## Meeting 9 - Modelica and simulation of object-oriented models

**Responsible**: Erik F

**Contents**-
- Pantelides algorithm
- Finding consistent initial conditions
- Computing structural index
- Index reduction using dummy-derivatives

**Course meeting**- OH
**Course material**-
- Kapitel 17,18 i
*"Principles of Object-Oriented Modeling and Simulation with Modelica 2.1"*av P. Fritzson. For those not familiar with Modelica, recommended reading in Chapter 2. -
C.C. pantelides
*"The consistent initialization of differential-algebraic systems"*, SIAM Journal on scientific and statistical computing, Vol. 9, No. 2, pp. 213-231, March 1988.

The description of the graph theoretical algorith to find all MSS:s can be skipped - Mattias Krysanders Matlab-implementation of Pantelides algoritm [zip, tar.gz]
- S. Mattson and G. Söderlind,
*"Index reduction in differential-algebraic equations using dummy derivatives"*, SIAM Journal on Scientific Computing, vol. 14, No. 3, pp. 677-692. 1993.

- Kapitel 17,18 i
**Exercises**: 2.13, 2.29, 2.30

## Meeting 10 - DAE, exercise discussion 1

**Responsible**: Erik F

**Contents**- Presentations and discussion about mandatory exercises.
**Course meeting**

## Meeting 11 - DAE, exercise discussion 2

**Responsible**: Erik F

**Contents**- Presentations and discussion about mandatory exercises.
**Course meeting**

## Meeting 12 - DAE, exercise discussion 2

**Responsible**: Erik F

**Contents**- Presentations and discussion about mandatory exercises.
**Course meeting**

# Course material

- Huvudbok för delen om ordinära differentialekvationer är
*"Computer Methods for Ordinary Differential Equations and Differential-Algebraic Equations"*av U. Ascher och L. Petzold. - För delen om differential-algebraiska ekvationer kommer valda
delar av
*"Solving Ordinary Differential Equations II - Stiff and Differential-Algebraic Problems"*av E. Hairer och G. Wanner att användas. Avsnitt: VI.1, VII.1-VII.2. - För delen om simulering av objekt-orienterade modeller kommer
kapitel ur
*"Principles of Object-Oriented Modeling and Simulation with Modelica 2.1"*av P. Fritzson att kopieras upp.

- Deuflhard och Bornemann,
*"Scientific Comupting with Ordniary Differential Equations"*. Kapitel 5 om steglängdsreglering. - Kjell Gustafsson,
*"Traps and Pitfalls in Simulation"*. - L.F. Shampine and C.W. Gear (1979),
*"A User's View of Solving Stiff Ordinary Differential Equations"*, SIAM Review. - T. Malya and
L.R. Petzold,
*Numerical methods and software for sensitivity analysis of differential-algebraic systems*, Applied Numerical Mathematics Volume 20, Issues 1-2, Pages 57-79, 1996. - S.L. Campbell and C.W. Gear,
*"The index of general nonlinear DAEs"*, Numerische Mathematik, Vol 72, No. 2, 173-196, 1995. - L. Petzold,
*"Differential/Algebraic Equations are not ODE's"*, SIAM journal on scientific and statistical computing, vol. 3, no. 3, 367-384, 1982. - C.W. Gear and L. Petzold,
*"ODE methods for the solution of differential/algebraic systems"*, SIAM Journal on Numerical Analysis, Vol. 21, No. 4. (Aug., 1984), pp. 716-728. - G. Reissig, W.S. Martinson, P.I. Barton,
*"Differential--Algebraic Equations of Index 1 May Have an Arbitrarily High Structural Index"*, SIAM Journal on Scientific Computing, Volume 21, Number 6, pp. 1987-1990, 2000. - H. Elmqvist and M. Otter,
*"Methods for tearing systems of equations in object-oriented modeling"*, Proceedings of the European Simulation Multiconference, pp. 326-332, Barcelona, Spain, 1994. - C.C. pantelides
*"The consistent initialization of differential-algebraic systems"*, SIAM Journal on scientific and statistical computing, Vol. 9, No. 2, pp. 213-231, March 1988. - S. Mattson and G. Söderlind,
*"Index reduction in differential-algebraic equations using dummy derivatives"*, SIAM Journal on Scientific Computing, vol. 14, No. 3, pp. 677-692. 1993.Ett konferensbidrag med liknande innehåll som ovan

S. Mattson and G. Söderlind,*" A new technique for solving high-index differential-algebraic equations using dummy derivatives"*, IEEE Symposium on Computer-Aided Control System Design (CACSD). Napa, CA, USA. 218-224, 1992. - K.E. Brenan, S.L. Campbell and
L.R. Petzold,
*"Kapitel 5, Numerical Solution of Initial-Value Problems in Differential.Algebraic Equations"*, SIAM, 1996. - Adrian Pop, OpenModelica Compiler Phases, Open Source Modelica Consortium, 2008-05-26.
- H. Elmqvist, M. Otter, and
F.E. Cellier.
*"Inline Integration: A new mixed symbolic/numeric approach for solving differential-algebraic equation systems"*, In Proceedings of ESM'95, European Simulation Multiconference, 1995.

Page responsible: Erik Frisk

Last updated: 2022-01-27