Declare three output arguments when calling reduceRedundancies
to simplify a system of equations and return information about the eliminated equations.
Create the following system of five differential algebraic equations (DAEs) in four state variables x1(t)
, x2(t)
, x3(t)
, and x4(t)
. The system also contains symbolic parameters a1
, a2
, a3
, a4
, b
, c
, and the function f(t)
that are not state variables.
Call reduceRedundancies
with three output arguments.
newEqs =
newVars =
R = struct with fields:
solvedEquations: [2x1 sym]
constantVariables: [1x2 sym]
replacedVariables: [1x2 sym]
otherEquations: [1x1 sym]
The function reduceRedundancies
returns information about eliminated equations to R
. Here, R
is a structure array with four fields.
The solvedEquations
field contains the equations that are eliminated by reduceRedundancies
. The eliminated equations contain those state variables from vars
that do not appear in newEqs
. The right side of each eliminated equation is equal to zero.
R1 =
The constantVariables
field contains a matrix with two columns. The first column contains those state variables from vars
that reduceRedundancies
replaced by constant values. The second column contains the corresponding constant values.
R2 =
The replacedVariables
field contains a matrix with two columns. The first column contains those state variables from vars
that reduceRedundancies
replaced by expressions in terms of other variables. The second column contains the corresponding values of the eliminated variables.
R3 =
The otherEquations
field contains those equations from eqs
that do not contain any of the state variables vars
.
R4 =