## Differential Variables

## Main.DifferentialVariables History

Hide minor edits - Show changes to markup

## Differential Variables

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)

(:table border=1 width=100% align=left bgcolor=#EEEEEE cellspacing=0:)

! x is the first order lag of parameter u with time constant tau

! x is the first order lag of parameter u ! with time constant tau

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 form allows dynamic problems to be solved by nonlinear programming (NLP) solvers.

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.

Differential states are variables that have the differential operator ($) applied in at least one equation. These differential states are declared in the variables section as any other variable.

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 form allows dynamic problems to be solved by nonlinear programming (NLP) solvers.

### Consistent Initial Conditions

Forward stepping algorithms such as DASSL, DASPK, or CVODE generally require ordinary differential equations (ODEs) or index-1 differential algebraic equations (DAEs) and consistent initial conditions. This is not a restriction with simultaneous methods as used by APMonitor. Also, ODEs or DAEs of any index can be solved.

## 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 as any other variable.

### 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

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:) (:cellnr:)

! 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

(:tableend:)

### Consistent Initial Conditions

Forward stepping algorithms such as DASSL, DASPK, or CVODE generally require ordinary differential equations (ODEs) or index-1 differential algebraic equations (DAEs) and consistent initial conditions. This is not a restriction with simultaneous methods as used by APMonitor. Also, ODEs or DAEs of any index can be solved.