symbolicEquations

Method of symbolicUtilities.

Reconstruct the symbolic equations of an mdss (or mss) model.

Source: src/utilities/@symbolicUtilities/symbolicEquations.m

Syntax

eq              = symbolicUtilities.symbolicEquations(sys)
[eq, varNames]  = symbolicUtilities.symbolicEquations(sys)

Description

symbolicEquations rebuilds the model’s equations as symbolic expressions by expanding the CPN (or Tensor Train) tensor back into monomials. It is the inverse view of symbolicToMdss and is the easiest way to check that a model — however it was constructed — represents the intended equations.

For an mdss model the result is a symbolic column vector of the implicit equations: equality rows are returned as 0 == … and inequality rows as … <= 0, placed at their equalityIndex / inequalityIndex positions. The variables use the canonical symbols xp, x, u, y, z for state derivatives, states, inputs, algebraic and binary variables.

The optional second output varNames is a struct of the symbolic variable arrays (.stateDelta, .state, .input, .algebraic, .binary).

Note

Requires MATLAB’s Symbolic Math Toolbox.

Input arguments

Argument Description
sys An mdss or mss model.

Output arguments

Output Description
eq Symbolic column vector of the model equations.
varNames Struct of the symbolic variable arrays used in eq.

Example

sys = stringParser.symbolicToMdss(["0 = m*xp1 - y1 - u1"; ...
                                   "0 = y1 - k*x1"], 0, ...
                                  ["xp","x","u","y","z"], ["m","k"], [1200, 3]);

[eq, varNames] = symbolicUtilities.symbolicEquations(sys);
disp(eq)

See also

symbolicToMdss · mdss · mss


Authors: Enrico Uhlenberg, Marah Engels, Torben Warnecke, Harshith Gowda et al.


MyToolbox Documentation | Generated automatically by CI/CD pipeline