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!Function
function pantelides!(G, M, A)

Perform index reduction with Pantelides algorithm.

  • G: bipartite graph (updated)
  • M: number of V-nodes
  • A: A[j] = if V[k] = der(V[j]) then k else 0
  • return assign: assign[j] contains the E-node to which V-node j is assigned or 0 if V-node j not assigned
  • return A: A[j] = if V[k] = der(V[j]) then k else 0
  • return 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).

source
ModiaBase.Differentiate.derivativeFunction
der = 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 differentiate
  • timeInvariants: Vector of time invariant variables, i.e. with time derivative equal to zero.
  • returnder`: Time derivative of ex
source