Check if the following DAE system has a low (0
or 1
) or high (>1
) differential index. If the index is higher than 1
, first try to reduce the index by using reduceDAEIndex
and then by using reduceDAEToODE
.
Create the system of differential algebraic equations. Here, the functions x1(t)
, x2(t)
, and x3(t)
represent the state variables of the system. The system also contains the functions q1(t)
, q2(t)
, and q3(t)
. These functions do not represent state variables. Specify the equations as a vector of symbolic equations and the variables as a vector of symbolic function calls.
Use isLowIndexDAE
to check the differential index of the system. For this system, isLowIndexDAE
returns 0
(false
). This means that the differential index of the system is 2
or higher.
Use reduceDAEIndex
as your first attempt to rewrite the system so that the differential index is 1
. For this system, reduceDAEIndex
issues a warning because it cannot reduce the differential index of the system to 0
or 1
.
Warning: Index of reduced DAEs is larger than 1.
newEqs =
If reduceDAEIndex
cannot reduce the semilinear system so that the index is 0
or 1
, try using reduceDAEToODE
. This function can be much slower, therefore it is not recommended as a first choice. Use the syntax with two output arguments to also return the constraint equations.
newEqs =
constraintEqs =
Use the syntax with three output arguments to return the new equations, constraint equations, and the differential index of the original system, eqs
.
newEqs =
constraintEqs =