stateJacobian

Method of mss.

Compute the Jacobian of the state equations at an operating point.

Source: src/model/@mss/stateJacobian.m

Syntax

J = stateJacobian(sys, stateVector, inputVector)
J = sys.stateJacobian(x, u)

Description

stateJacobian returns the first-order derivatives of the state equation

ẋ=f(x,u)(or xk+1=f(xk,uk) for a discrete model) \dot x = f(x,u) \qquad\text{(or } x_{k+1} = f(x_k,u_k) \text{ for a discrete model)}

with respect to the states and the inputs, evaluated at (x,u)(x,u):

J=[fxfu]nstate×(nstate+ninput). J = \left[\ \frac{\partial f}{\partial x}\ \ \frac{\partial f}{\partial u}\ \right] \in \mathbb{R}^{\,n_\text{state}\times(n_\text{state}+n_\text{input})}.

The two blocks are the AA and BB matrices of a local linearization; splitting J at column nState is exactly what linearize does. The operating point need not be an equilibrium.

The method assembles the full signal vector by scattering xx and uu through stateIndex and inputIndex, and reorders the resulting columns into the same signal order — column kk is the derivative with respect to state kk, followed by the inputs. Both are needed for a model whose structure-matrix rows are not in the natural [x; u] order: the tensor returns one column per structure-matrix row, in row order, so without the reorder splitting J at column nState (which linearize does) would mix states and inputs. For a natural layout both steps are the identity.

The evaluation then dispatches on the tensor:

Input arguments

Argument Description
sys The mss model.
stateVector State operating point xx (sys.nState × 1).
inputVector Input operating point uu (sys.nInput × 1; [] if the model has no inputs).

Output arguments

Output Description
jacobianMatrix nState × (nState + nInput) Jacobian [f/xf/u][\,\partial f/\partial x\ \ \partial f/\partial u\,] at (x,u)(x,u).

Example

sys = rmss(3,1,1,4);
J = sys.stateJacobian([1; 0; -1], 0.5);

A = J(:, 1:sys.nState);        % state matrix
B = J(:, sys.nState+1:end);    % input matrix

See also

outputJacobian · linearize · functionValue · jacobian · mss


MyToolbox Documentation | Generated automatically by CI/CD pipeline