laurent90git / DAE-Scipy

Modifications of Scipy's implicit solvers for the solution of differential-algebraic equations (DAEs)
12 stars 2 forks source link
dae differential-algebraic differential-algebraic-equations differential-equations mass-matrix radau scipy

DAE integrator for Scipy

This repository is based on Scipy's integrate module. The Radau method implemented in Scipy for solving ordinary differential equations (ODEs) is adapted to allow for the solution of differential-algebraic equations (DAEs) up to index 3.

This is done by introducing a mass matrix M and solving the following equation:

M dX/dt = f(t,X)

To use this package, execute the following command :

python setup.py develop

which will install the package as a development package, i.e. directly referring to the You can also install it as a normal package :

python setup.py install

But you loose the ability to modify the code on the fly without reinstalling the package...

To use the modified integrator:

from scipyDAE.radauDAE import RadauDAE

scipy.integrate.solve_ivp(..., method=RadauDAE)

Refer to the examples and to the documentation for more information.

Various test problems are given:

The latter may be used to simulate simple ropes, for example:

Hanging rope index-3 DAE animated

or even compute the "free falling chain" problem.

This modification of Radau will hopefully be pushed to Scipy after some further testing :)

Further DAE integrators with time adaptation (ESDIRKs) will be implemented based on Scipy's solver class. A test case with a DAE from a discretised PDE will also be added.

A very good reference to read: E. Hairer and G. Wanner, Solving Ordinary Differential Equations II: Stiff and Differential-Algebraic Equations 2nd Revised Edition 1996