Convert system of first-order quasilinear differential algebraic equations to equivalent system of differential index 0
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
oldIndex] = daetools::reduceDAEToODE(
[newEqs,constraintEqs,oldIndex] := daetools::reduceDAEToODE(eqs,vars) converts
a high-index system of first-order semilinear algebraic equations
an equivalent system of ordinary differential equations,
It also returns a vector of constraint equations and the differential
oldIndex of the original system of semilinear
The differential index of the new system is
that is, the Jacobian of
newEqs with respect to
the derivatives of the variables in
vars is invertible.
The implementation of
based on Gaussian elimination. This algorithm is more reliable than
the Pantelides algorithm used by
but it can be much slower.
The number of equations
eqs must coincide
with the number of variables
Check if a DAE system has a low (
or high (
>1) differential index. If the index
is higher than
1, then first try to reduce the
index by using
daetools::reduceDAEIndex and then
Create the following system of differential algebraic equations.
state variables of the system. The system also contains the expressions
q3(t) that do not represent state variables.
eqs := [diff(x2(t),t) = q1(t) - x1(t), diff(x3(t),t) = q2(t) - 2*x2(t) - t*(q1(t)-x1(t)), q3(t) - t*x2(t) - x3(t) = 0]; vars := [x1(t), x2(t), x3(t)]
daetools::isLowIndexDAE to check the
differential index of the system. For this system,
This means that the differential index of the system is
daetools::reduceDAEIndex as your first
attempt to rewrite the system so that the differential index is
For this system,
a warning because it cannot reduce the differential index of the system
[newEqs, newVars, R, oldIndex] := daetools::reduceDAEIndex(eqs, vars): newEquations = newEqs; newVariables = newVars; relations = R; originalIndex = oldIndex
Warning: Index of reduced DAEs is larger than 1. [daetools::reduceDAEIndex]
daetools::reduceDAEIndex cannot reduce
the semilinear system so that the index is
daetools::reduceDAEToODE. This function
can be much slower, therefore it is not recommended as a first choice.
[newEqs, constraintEqs, oldIndex] := daetools::reduceDAEToODE(eqs, vars): ODEs = eqs; constraintEquations = constraintEqs; originalIndex = oldIndex
A list or a vector of equations or expressions in the state
A list or a vector of identifiers or expressions, such as
A nested list containing the following three outputs: a list of ordinary differential equations, a list of constraint equations encountered during system reduction, and the differential index of the original DAE system.