functionValue

Method of mdss.

Evaluate the model’s equations at given signal values.

Source: src/model/@mdss/functionValue.m

Syntax

functionValues = functionValue(sys, stateDeltaVector, stateVector, inputVector, algebraicVector, binaryVector)

Description

functionValue evaluates every equality and inequality equation of the model at the supplied signal values. Each equation row is a multilinear expression in the signals (ẋ,x,u,y,z)(\dot{x}, x, u, y, z), and functionValue returns the vector of those values, one per equation row of the parameter matrix.

The six signal vectors are placed into the full signal vector using the model’s index vectors (stateDeltaIndex, stateIndex, inputIndex, algebraicIndex, binaryIndex) and the evaluation is delegated to the underlying tensor. For a CPNTensor the assembled signal vector is passed to computeFunctionValue; for a TTTensor the tensor-train path computeFunctionValueMdss is used.

Input arguments

Argument Description
sys The mdss model.
stateDeltaVector State-derivative values ẋ\dot{x} (nState entries).
stateVector State values xx (nState entries).
inputVector Input values uu (nInput entries).
algebraicVector Algebraic values yy (nAlgebraic entries).
binaryVector Binary values zz (nBinary entries; [] if none).

Output arguments

Output Description
functionValues Column vector, one entry per equation row: that row’s multilinear expression evaluated at the supplied values.

Example

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

% Residuals at xp1 = 0, x1 = 0, u1 = 1, y1 = 0 (no binaries)
fv = functionValue(sys, 0, 0, 1, 0, []);

See also

mdss · jacobian · incidenceMatrix · msim · CPNTensor · TTTensor


MyToolbox Documentation | Generated automatically by CI/CD pipeline