mdss

Multilinear descriptor state-space model (implicit MTI).

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

An mdss object stores an implicit multilinear time-invariant (iMTI) model: a set of implicit differential-algebraic equations whose right-hand side is a purely multilinear function of the state derivatives, states, inputs, algebraic variables and (optionally) binary variables. It is the descriptor counterpart of the explicit mss model.

The model tensor lives in an mtiTensor (a CPNTensor (default) or a TTTensor), and the signals are described by explicit index vectors rather than fixed blocks.

Description

An iMTI model consisting of NN implicit multilinear equations

๐ŸŽ=๐ก(ฮด๐ฑ,๐ฑ,๐ฎ,๐ฒ,๐ณ) \mathbf{0} = \mathbf{h}(\delta\mathbf{x}, \mathbf{x}, \mathbf{u}, \mathbf{y}, \mathbf{z})

can be represented by a contracted tensor product

๐ŸŽ=โŸจ๐™ทโˆฃ๐™ผ(๐ฏ)โŸฉ. \mathbf{0} = \left\langle \mathtt{H} \mid \mathtt{M}(\mathbf{v})\right\rangle .

Here, the signal vector ๐ฏโˆˆโ„nv\mathbf{v}\in\mathbb{R}^{n_v} collects the state change ฮด๐ฑโˆˆโ„nx\delta\mathbf{x}\in\mathbb{R}^{n_{x}}, the states ๐ฑโˆˆโ„nx\mathbf{x}\in\mathbb{R}^{n_{x}}, the inputs ๐ฎโˆˆโ„nu\mathbf{u}\in\mathbb{R}^{n_{u}}, the algebraic variables ๐ฒโˆˆโ„ny\mathbf{y}\in\mathbb{R}^{n_{y}} and the binary variables ๐ณโˆˆโ„nz\mathbf{z}\in\mathbb{R}^{n_{z}}:

๐ฏ=[ฮด๐ฑโŠค,๐ฑโŠค,๐ฎโŠค,๐ฒโŠค,๐ณโŠค]โŠค,nv=2nx+nu+ny+nz. \mathbf{v} = \left[\delta\mathbf{x}^\top,\ \mathbf{x}^\top,\ \mathbf{u}^\top,\ \mathbf{y}^\top,\ \mathbf{z}^\top\right]^\top, \qquad n_v = 2n_{x}+n_{u}+n_{y}+n_{z}.

The state change ฮด๐ฑ\delta\mathbf{x} is the state derivative in continuous time and the state prediction in discrete time,

ฮด๐ฑ={๐ฑฬ‡(t)๐š๐š’๐š–๐šŽ๐š‚๐š๐šŽ๐š™๐š‚๐š’๐šฃ๐šŽ=0(continuous-time)๐ฑ(k+1)๐š๐š’๐š–๐šŽ๐š‚๐š๐šŽ๐š™๐š‚๐š’๐šฃ๐šŽ>0(discrete-time). \delta\mathbf{x} = \begin{cases} \dot{\mathbf{x}}(t) & \texttt{timeStepSize} = 0 \quad\text{(continuous-time)}\\ \mathbf{x}(k+1) & \texttt{timeStepSize} > 0 \quad\text{(discrete-time).} \end{cases}

The model tensor ๐™ทโˆˆโ„ร—(nv)2ร—N\mathtt{H}\in\mathbb{R}^{\times^{(n_v)}2\times N}, with ร—(nv)2{\times^{(n_v)}2} denoting nvn_v dimensions of length 2, contains the parameters of the NN implicit equations. While ๐™ท\mathtt{H} can have an arbitrary rank, the tensor ๐™ผ(๐ฏ)\mathtt{M}(\mathbf{v}) is always rank 1 with a canonical polyadic (CP) decomposition

๐™ผ(๐ฏ)=[(1โˆ’bv1v1),โ€ฆ,(1โˆ’bvnvvnv)]. \mathtt{M}(\mathbf{v})=\left[\left(\begin{matrix}1-bv_1\\ v_1\end{matrix}\right),\dots,\left(\begin{matrix}1-bv_{n_v}\\ v_{n_v}\end{matrix}\right)\right].

The variable bโˆˆ{0,1}b\in\{0,1\} depends on the model base; see the explicit model mss for the base convention. The model class mdss currently only supports the monomial base (b=0b=0).

An equivalent representation of the full model tensor can be achieved with a CP-decomposed parameter tensor

๐™ท=[๐‡1,โ€ฆ,๐‡nv,๐‡ฮฆ], \mathtt{H}= {\left[{\mathbf{H}_{1},\dots,\mathbf{H}_{n_v}, \mathbf{H}_{\Phi}}\right]},

with factor matrices ๐‡iโˆˆโ„2ร—R\mathbf{H}_i\in\mathbb{R}^{2\times R} for i=1,โ€ฆ,nvi=1,\dots,n_v and a parameter matrix ๐‡ฮฆโˆˆโ„Nร—R\mathbf{H}_{\Phi}\in\mathbb{R}^{N\times R}, where RR is the number of product terms.

Exploiting that the first dimension of every factor matrix is of length 2, the model tensor can be stored in the more compact Canonical Polyadic Normalized (CPN) representation implemented in the MTI-Toolbox. Normalizing every factor matrix column with the 1-norm collapses each column to a single degree of freedom, so the model tensor is represented by a structure matrix ๐’โˆˆ[โˆ’1,1]nvร—R\mathbf{S}\in[-1,1]^{n_v \times R} (rows = signals, columns = terms), which holds the second rows of the normalized factor matrices, and a parameter matrix ๐šฝโˆˆโ„Nร—R\mathbf{\Phi}\in\mathbb{R}^{N \times R} (rows = equations, columns = terms), which absorbs the column scalings. See CPNTensor for the tensor container that stores these matrices.

In CPN representation, an iMTI model is written as

๐ŸŽ=โŸจ[[๐’,๐šฝ]]|[(1โˆ’bv1v1),โ€ฆ,(1โˆ’bvnvvnv)]โŸฉ. \mathbf{0} = \left\langle {\left[{\!\left[{\mathbf{S},\mathbf{\Phi}}\right]\!}\right]}\bigg | {\left[ \left(\begin{matrix}1-bv_1\\ v_1\end{matrix}\right), \dots, \left(\begin{matrix}1-bv_{n_v}\\ v_{n_v}\end{matrix}\right) \right] } \right\rangle .

The evaluation of the individual model equations is equivalent to a sum of products

0=โˆ‘r=1Rฯ•j,rโˆi=1nvpb(si,r,vi),j=1,โ€ฆ,N, 0 = \sum_{r=1}^{R} \phi_{j,r} \prod_{i=1}^{n_v} p_{b}\!\left(s_{i,r}, v_{i}\right), \qquad j = 1,\dots,N,

where the structure matrix ๐’\mathbf{S} selects which signals enter each product term and the parameter matrix ๐šฝ\mathbf{\Phi} holds the weight of the terms. In the monomial base (b=0b=0) supported by mdss, the scalar factor function is

p0(s,v)=1โˆ’|s|+sv. p_{0}(s,v) = 1-\lvert s\rvert + s\,v .

Which row of ๐’\mathbf{S} is which signal โ€” and which row of ๐šฝ\mathbf{\Phi} is which equation โ€” is recorded by the index vectors below, so mdss never assumes a fixed signal ordering.

Construction

From structure and parameter matrices

Build the model directly from its CPN matrices and index vectors. Take the continuous-time Sprottย B attractor (3 states, no inputs):

0=โˆ’xฬ‡1+ax2x30=โˆ’xฬ‡2+x1โˆ’bx20=โˆ’xฬ‡3+cโˆ’x1x2 \begin{aligned} 0 &= -\dot{x}_1 + a\,x_2 x_3\\ 0 &= -\dot{x}_2 + x_1 - b\,x_2\\ 0 &= -\dot{x}_3 + c - x_1 x_2 \end{aligned}

The structure matrix has one row per signal (here 3 state derivatives then 3 states) and one column per term; the parameter matrix has one row per equation. Each column of structureMatrix selects the signals in that term, and the same column of parameterMatrix gives its coefficient:

a = 0.4;  b = 1.2;  c = 1;

%                  xp1 xp2 xp3  x2x3  x1   x2  const x1x2
structureMatrix = [ 1   0   0    0    0    0    0    0 ;   % xp1
                    0   1   0    0    0    0    0    0 ;   % xp2
                    0   0   1    0    0    0    0    0 ;   % xp3
                    0   0   0    0    1    0    0    1 ;   % x1
                    0   0   0    1    0    1    0    1 ;   % x2
                    0   0   0    1    0    0    0    0 ];  % x3

parameterMatrix = [-1   0   0    a    0    0    0    0 ;   % eq1
                    0  -1   0    0    1   -b    0    0 ;   % eq2
                    0   0  -1    0    0    0    c   -1 ];  % eq3

sys = mdss(structureMatrix, parameterMatrix, ...
           [1;2;3], ...   % stateDeltaIndex  (rows of xp1..xp3)
           [4;5;6], ...   % stateIndex       (rows of x1..x3)
           [], [], [], ... % inputIndex, algebraicIndex, binaryIndex
           0, ...         % timeStepSize (0 = continuous-time)
           [1;2;3], []);  % equalityIndex, inequalityIndex

When every signal/equation count is a scalar and the matrix row counts match, the index vectors are auto-expanded to sequential [1..n], which is handy via the nameโ€“value form:

sys = mdss(structureMatrix = structureMatrix, parameterMatrix = parameterMatrix, ...
           amountStateDelta = 3, amountState = 3, amountInput = 0, ...
           amountAlgebraic = 0, amountBinary = 0, ...
           timeStepSize = 0, amountEquality = 3, amountInequality = 0);

Important: Auto-expansion assumes a fixed row order

Passing counts instead of explicit index vectors commits the matrices to a defined layout. The structure matrix rows must be ordered [stateDelta; state; input; algebraic; binary] and the parameter matrix rows [equality; inequality], each block filled sequentially. If your rows follow a different order, pass explicit index vectors instead.

Syntax Result
sys = mdss() Empty object with an empty mtiTensor.
sys = mdss(structureMatrix, parameterMatrix, stateDeltaIndex, stateIndex, inputIndex, algebraicIndex, binaryIndex, timeStepSize, equalityIndex, inequalityIndex) Build from CPN matrices + index vectors. All ten arguments are required.
sys = mdss(mtiTensor, stateDeltaIndex, stateIndex, inputIndex, algebraicIndex, binaryIndex, timeStepSize, equalityIndex, inequalityIndex) Build from an existing tensor + index vectors. All nine arguments are required.
sys = mdss(Name, Value, ...) Nameโ€“value form; accepts explicit index vectors or scalar amountโ€ฆ counts.

From symbolic or string equations

The same model can be parsed from equations with symbolicToMdss, which builds the matrices for you. Symbolic parameters and their numeric values are passed inline:

eq = ["xp1 = a*x2*x3"; ...
      "xp2 = x1 - b*x2"; ...
      "xp3 = c - x1*x2"];

sys = stringParser.symbolicToMdss( ...
        eq, 0, ["xp","x","u","y","z"], ...
        sym(["a","b","c"]), [0.4, 1.2, 1]);

Properties

Model tensor

Property Description
mtiTensor Model tensor, an mtiTensor (default CPNTensor or TTTensor).
mtiBase The model class mdss currently only supports 0 (monomial base). The construction of models with 1 (literal base) is not yet supported.
lowerBoundary, upperBoundary Per-equation bounds lb โ‰ค h โ‰ค ub; equal โ†’ equality, unequal โ†’ inequality.
timeStepSize 0 continuous-time, >0 discrete-time sample time.
discretizationType Method used by c2d/d2d ("none" if continuous).

Signal names / units

stateName, stateUnit, algebraicName, algebraicUnit, inputName, inputUnit, binaryName, binaryUnit โ€” string vectors sized to the corresponding signal count. stateIsOutput, algebraicIsOutput, binaryIsOutput mark which signals are outputs. manipulatedVariable, measuredDisturbance, unmeasuredDisturbance index the input columns by role.

Index vectors (read-only)

Set at construction; each maps a matrix row to a signal or equation: stateDeltaIndex, stateIndex, inputIndex, algebraicIndex, binaryIndex (rows of the structure matrix) and equalityIndex, inequalityIndex (rows of the parameter matrix). The counts nState, nInput, nAlgebraic, nBinary, nEquality, nInequality are derived from them.

Simulation

Simulate with msim. The full call is msim(sys, inputTrajectory, inputTime, x0, algebraicGuess, binaryGuess) and it returns [y, tsim, x, z, tEvents]. The two guesses are optional; the [] in the call below is the input trajectory:

t  = [0 1000];
x0 = [0.1 0 0];
[~, tsim, x] = msim(sys, [], t, x0);

plot3(x(:,1), x(:,2), x(:,3)); grid on

For discrete-time models the input time vector must use the modelโ€™s sample time.

Object functions

Function Purpose
msim Simulate the time response to arbitrary inputs.
symbolicToMdss Build an mdss from symbolic/string equations.
symbolicEquations Recover the model as symbolic equations.
c2d / d2c / d2d Discretize, continualize, resample.
append Stack component models diagonally.
connect Connect inputs to signals by name or index.
jacobian Jacobian of the equation system.
incidenceMatrix Structural incidence of equations vs.ย variables.
linearize Linearize around an operating point (LTI/descriptor).
algebraicElimination Remove algebraic equalities/variables while preserving structure.
normalizeParameterMatrix Rescale the parameter matrices.
trivialReduction Drop trivial equations/variables (run automatically by connect).

References

  1. G. Lichtenberg et al., โ€œImplicit multilinear modeling,โ€ at โ€“ Automatisierungstechnik, vol.ย 70, no. 1, pp.ย 13โ€“30, Jan.ย 2022. doi:10.1515/auto-2021-0133
  2. N. Jรถres et al., โ€œReduced CP representation of multilinear models,โ€ Proc. 12th SIMULTECH, 2022. doi:10.5220/0011273100003274
  3. T. Warnecke and G. Lichtenberg, โ€œHybrid implicit multilinear simulation using difference algebraic equations reordering by sparsity patterns,โ€ 2024 10th CoDIT, Valletta, Malta, 2024.

See also

mss ยท msim ยท symbolicToMdss ยท CPNTensor ยท TTTensor ยท mtiTensor ยท connect ยท append


MyToolbox Documentation | Generated automatically by CI/CD pipeline