Transformation to ODE System
This section provides utility functions to transform DAE to ODE systems. In particular,
- to find equations that need to be differentiated, in order to transform a Differential Algebraic Equations (DAEs) agebraically to Ordinary Differential Equations (ODEs),
- to differentiate relevant equations analytically,
Main Functions
ModiaBase.BLTandPantelides.pantelides!
— Functionfunction pantelides!(G, M, A)
Perform index reduction with Pantelides algorithm.
G
: bipartite graph (updated)M
: number of V-nodesA
: A[j] = if V[k] = der(V[j]) then k else 0return assign
: assign[j] contains the E-node to which V-node j is assigned or 0 if V-node j not assignedreturn A
: A[j] = if V[k] = der(V[j]) then k else 0return B
: B[i] = if E[l] = der(E[i]) then l else 0
Reference: Pantelides, C.: The consistent initialization of differential-algebraic systems. SIAM Journal of Scientific and Statistical Computing, 9(2), pp. 213–231 (1988).
ModiaBase.Differentiate.derivative
— Functionder = derivative(ex, timeInvariants=[])
Form the derivative of the expressions ex
with regards to time. Time derivative of variables are denoted der(v)
.
ex
: Expression to differentiatetimeInvariants
: Vector of time invariant variables, i.e. with time derivative equal to zero.return
der`: Time derivative of ex