Method of mdss.
Evaluate the Jacobian of the model’s equations with respect to all signals.
Source: src/model/@mdss/jacobian.m
jacobianMatrix = jacobian(sys, stateDeltaVector, stateVector, inputVector, algebraicVector, binaryVector)jacobian returns the matrix of partial derivatives of
every equation with respect to every signal, evaluated at the supplied
point. With each equation written as
,
the result is
with one row per equation and one column per signal (in structure-matrix row order).
The six signal vectors are assembled into the full signal vector via
the model’s index vectors, and the evaluation is delegated to the
underlying tensor. For a CPNTensor the unified
jacobian
kernel is called; for a TTTensor the
tensor-train path computeJacobianMatrixMdss
is used.
| Argument | Description |
|---|---|
sys |
The mdss model. |
stateDeltaVector |
State-derivative values
(nState entries). |
stateVector |
State values
(nState entries). |
inputVector |
Input values
(nInput entries). |
algebraicVector |
Algebraic values
(nAlgebraic entries). |
binaryVector |
Binary values
(nBinary entries; [] if none). |
| Output | Description |
|---|---|
jacobianMatrix |
Jacobian matrix, rows = equations, columns = signals. |
sys = stringParser.symbolicToMdss(["0 = m*xp1 - y1 - u1"; ...
"0 = y1 - k*x1"], 0, ...
["xp","x","u","y","z"], ["m","k"], [1200, 3]);
% Jacobian at xp1 = 0, x1 = 0, u1 = 1, y1 = 0 (no binaries)
J = jacobian(sys, 0, 0, 1, 0, []);The equations here are
and
.
J has one row per equation and one
column per signal. As with incidenceMatrix,
slice it with the index vectors to get a labelled view — the two
equalities against [xp1 x1 u1 y1]:
cols = [sys.stateDeltaIndex; sys.stateIndex; sys.inputIndex; sys.algebraicIndex];
block = full(J(sys.equalityIndex, cols))which yields
xp1 x1 u1 y1
eq1 -> 1200 0 -1 -1
eq2 -> 0 -3 0 1
Each entry is
.
Because both equations are linear, these derivatives are constant; for
nonlinear (multilinear) terms the entries depend on the operating point
passed to jacobian.
mdss · functionValue
· incidenceMatrix
· msim · CPNTensor · TTTensor
MyToolbox Documentation | Generated automatically by CI/CD pipeline