Differential Variables

Differential states are variables that have the differential operator ($) applied in at least one equation. These differential states are declared in the variables section without the differential operator. For dynamic problems, the differential variables are converted to algebraic variables through orthogonal collocation on finite elements. This discretized form allows dynamic problems to be solved by nonlinear programming (NLP) solvers.

DAE Index Restrictions

Differential and algebraic equation (DAE) index is the number of times equations must be differentiated to restore them to an ODE form. Higher (>=2) index DAE problems are overcome with techniques used in this software. ODEs or DAEs of any index can be solved.

Consistent Initial Conditions for Dynamic Problems

Sequential ODE and DAE solution approaches require consistent initial conditions. This is not a restriction with APMonitor because of the simultaneous approach. The initial conditions do not have to be consistent to achieve a feabile solution. The time-shifting approach guarantees that the initial conditions are consistent after one cycle.

Example

 ! Example model with a differential equation
 Model example
   Parameters
     u = 1   ! input
     tau = 5 ! time constant
   End Parameters

   Variables
     x = 1   ! initial condition
   End Variables

   Equations
     ! x is the first order lag of parameter u
     !  with time constant tau
     tau * $x = -x + u
   End Equations
 End Model
💬