Multilinear explicit state-space model (eMTI).
Source: src/model/@mss/mss.m
An mss object stores an explicit multilinear
time-invariant (eMTI) model: a state equation and an output equation
whose right-hand sides are multilinear functions of the states and
inputs. It is the explicit counterpart of the descriptor model mdss.
The model tensor is stored as an mtiTensor ( CPNTensor (default) or
TTTensor), and the
assignment to signals and equations is performed by explicit index
vectors.
An eMTI model consisting of explicit multilinear functions can be represented by contracted tensor products
Here, , and denotes the state change,
In an eMTI model the signal vector of length contains the states and the inputs :
The model tensors and , with denoting dimensions of length 2, contain the model parameters. While and can have an arbitrary rank, the tensor is always rank 1 with a canonical polyadic (CP) decomposition
The variable depends on the model base. For models in the monomial base it has the value , and in the literal base .
An equivalent representation of the full model tensors can be achieved with CP decomposed parameter tensors, e.g.ย for the state equation tensor as
with factor matrices for and a parameter matrix . The second matrix dimension denoted as is the number of product terms in the state equation.
Exploiting the dimensions of MTI models, the model tensors can be stored using the more compact Canonical Polyadic Normalized (CPN) representation, which is implemented in the MTI-Toolbox. This representation is based on normalization of the factor matrix columns such that
Because for multilinear models the first dimension of the factor matrices is always of length 2, knowing only one row of each normalized factor matrix is enough to reconstruct the other row. This allows representing the model tensor through a so-called structure matrix , which contains the second rows of the normalized factor matrices, and a parameter matrix , which absorbs the scaling factors for the normalized multilinear polynomials.
In CPN representation, an eMTI model is written as
The evaluation of the individual model equations is equivalent to a sum of products
where the structure matrices select which signals enter each product term, and the parameter matrices hold the weight of the terms.
The scalar factor function changes with the model base . For models in the monomial base (), it is
and for models in the literal base (), it evaluates as
The value of therefore has a different meaning in each base:
| monomial factor | literal factor | |
|---|---|---|
| โ variable absent from the term | ||
| โ variable absent from the term | ||
Another way to store the model parameters of MTI models is provided by the Tensor Train (TT) representation, which stores the model tensor through the TT-cores:
Here the TTTensor
approximates a tensor of order
by a product of
third order tensors, known as TT-cores, where the first and the last
TT-cores have a degenerated dimension of 1 and thus can be represented
as matrices. The middle dimensions connecting the core tensors are known
as the TT-ranks of the decomposition and if it is exact, they are the
TT-ranks of the original tensor.
Elements of the full tensor can be computed by the so-called contraction
In TT representation, an eMTI model is written as
The evaluation of the individual model equations in TT representation is equivalent to a product of sums
All these representations are equivalent representations of the same model tensor:
An mss stores the model parameters either as a CPNTensor or as a TTTensor.
The CPNTensor is
stored as one structure matrix and one
parameter matrix for the whole model:
structureMatrix
is
โ one row per signal, one column per term.parameterMatrix
is
โ one row per equation, one column per term.columnIndexStateEq and
columnIndexOutputEq say which terms each equation block
uses. They may be disjoint or shared, which is why
.Which row is which signal, and which row is which equation, is
recorded by the index vectors stateIndex,
inputIndex, stateEquationIndex and
outputEquationIndex, so an mss never assumes a
fixed row ordering. The column sets are not passed:
they are derived at construction from the nonzero pattern of the
parameter rows.
Because the state and output equation share the structure matrix,
their columns also carry a row for every input. To keep for example the output equation
independent of the inputs, set those entries to the neutral element of the
base โ 0 in the monomial base, 0.5 in the literal base.
A model is not portable between bases by flipping
mtiBase: that changes the function the same matrices
represent. A closed-form transformation of
and
between the two bases can be performed using mss2mss.
The mtiBase applies to the continuous structure entries
of a model where mtiTensor is a CPNTensor.
The TTTensor is
stored through the TT-cores for the whole model where the number of
cores exceeds the number of system variables by one due to the parameter
matrix - First TT-core,
is the parameter matrix with dimensions
where
โ one row per equation - Middle TT-cores,
are 3D tensors with dimensions
where
โ one 3D tensor per signal - Last TT-core,
is a matrix with dimensions
where
โ Represents the first signal
Analogous relations can be inferred for the output TTTensor
as well.
The mtiBase of the TTTensor should always
be set to 0, the monomial base, as the literal base construction for the
TTTensor is still
under development.
Take the discrete-time bilinear model
in the monomial base. It has three distinct terms in total โ , and, for the output, again โ but the output can reuse the first column, so :
% x1 x1*u1
structureMatrix = [ 1 1 ; % x1
0 1 ]; % u1
parameterMatrix = [ 0.9 0.1 ; % x1(k+1)
2 0 ]; % y1
sys = mss(structureMatrix, parameterMatrix, ...
1, ... % stateIndex (1st row of the structure matrix)
2, ... % inputIndex (2nd row of the structure matrix)
1, ... % timeStepSize (>0 = discrete-time)
1, ... % stateEquationIndex (1st row of the parameter matrix)
2); % outputEquationIndex (2nd row of the parameter matrix)A monomial-base structure entry of 0 means the variable
is absent from that term, so column 1 is
and column 2 is
.
Since the output row is nonzero only in column 1, the constructor
derives
sys.columnIndexStateEq % [1 2]
sys.columnIndexOutputEq % 1 -- a shared columnEvaluate the model directly with functionValue,
outputValue
sys.functionValue(2,3) % 2.4
sys.outputValue(2,3) % 4The mss does not store structureMatrix and
parameterMatrix internally, but instead a CPNTensor, which holds
the structure split into
structureMatrix{True,False,Continuous} and the parameters
split into parameterMatrix{One,MinusOne,Continuous} over
disjoint supports.
An mss can also be built around a CPNTensor that already
exists โ one returned by an identification, produced by another model
operation, or assembled by hand. The tensor then replaces the two
matrices and the constructor takes six positional arguments:
sys = mss(mtiTensor, stateIndex, inputIndex, timeStepSize, ...
stateEquationIndex, outputEquationIndex);The CPNTensor
can for example be constructed through the six split channels in the
order structure {True, False, Continuous}, parameter
{One, MinusOne, Continuous}. The four
True/False/One/MinusOne
arguments are masks โ only their nonzero pattern matters, the values are
converted to logical โ while the two
Continuous arguments carry the actual numbers. Within each
triple the supports must be disjoint.
Take the discrete-time model
whose three terms use all six channels โ a True factor
,
a False factor
together with a True factor
,
and a Continuous factor for the output, weighted by a
Continuous, a MinusOne and a One
parameter:
% x1 (1-x1)*u1 x1(cont.)
structureMatrixTrue = [ 1 0 0 ; % x1
0 1 0 ]; % u1
structureMatrixFalse = [ 0 1 0 ;
0 0 0 ];
structureMatrixContinuous = [ 0 0 0.3 ;
0 0 0 ];
parameterMatrixOne = [ 0 0 0 ; % x1(k+1)
0 0 1 ]; % y1
parameterMatrixMinusOne = [ 0 1 0 ;
0 0 0 ];
parameterMatrixContinuous = [ 0.9 0 0 ;
0 0 0 ];
mtiTensor = CPNTensor(structureMatrixTrue, structureMatrixFalse, structureMatrixContinuous, ...
parameterMatrixOne, parameterMatrixMinusOne, parameterMatrixContinuous);
sys = mss(mtiTensor, ...
1, ... % stateIndex
2, ... % inputIndex
1, ... % timeStepSize
1, ... % stateEquationIndex
2); % outputEquationIndexEverything else behaves exactly as on the matrix path โ the column sets are derived the same way, and the model evaluates as written:
sys.columnIndexStateEq % [1 2]
sys.columnIndexOutputEq % 3
sys.functionValue(2,3) % 4.8
sys.outputValue(2,3) % 1.3Passing a cell array of TT cores instead of a tensor
object selects a TTTensor model, which
is always monomial.
The structure and parameter matrix are not explicitly stored in the
mss, but they can be obtained by
sys.structureMatrix and
sys.parameterMatrix.
The two getters return the canonical form, for which in each model base a special case is considered. That involves a per-column rescaling of , because the special-cased channels leave a constant factor behind:
| base | structure special case | canonical |
|---|---|---|
| monomial | a False entry denotes
,
i.e.ย the factor
|
folded scaled by per column |
| literal | a donโt-care is not stored in any channel, and its factor is | folded scaled by per column |
Looking back at our example:
The channels hold the folded values, so a
False entry is the plain factor
rather than the canonical
.
The canonical getters undo that difference โ reading them back gives the
matrices the previous section would have been given, with the parameter
of column 2 scaled by
for its one False factor:
full(sys.structureMatrix)
ans =
1.0000 -0.5000 0.3000
0 1.0000 0
full(sys.parameterMatrix)
ans =
0.9000 -2.0000 0
0 0 1.0000Constructing a literal-base model through mss performs
the folding for you.
The same constructor builds a literal-base model when
mtiBase is set. Here the state equation is the exclusive-or
of a state and an input, evaluated in the relaxed, continuous
domain:
% (1-x1)*u1 x1*(1-u1) x1
structureMatrix = [ 0 1 1 ; % x1
1 0 0.5 ]; % u1
parameterMatrix = [ 1 1 0 ; % x1(k+1)
0 0 2 ]; % y1
sys = mss(structureMatrix, parameterMatrix, 1, 2, 1, 1, 2, mtiBase = 1);Two conventions of the literal base show up in column 3, the output term:
u1 entry is the donโt-care 0.5, the
neutral element, so the output stays independent of the input.2, not 1. The canonical
0.5 contributes a factor
that has to be compensated; the tensor stores the folded value
1. This is only needed where a donโt-care appears โ the
state columns need no correction.Here the two equation blocks use disjoint columns
(columnIndexStateEq = [1 2],
columnIndexOutputEq = 3). Evaluated on the Boolean corners
the model reproduces the truth table of the XOR, and it is defined in
between:
sys.functionValue(0, 1) % 1
sys.functionValue(1, 1) % 0
sys.functionValue(0.3, 0.7) % 0.58Consider the continuous-time multilinear model in the monomial base.
The equation consists of three system variables โ
and the outputs of the equation are equal to its states. An
mss model can be built around a TTTensor that can be
obtained by system identification, produced by another model operation,
or assembled by hand. The model can also be converted to discrete-time
by using the c2d
function with the TTTensor.
F_x_1(:,:,1) = [ 0.4 0 ; % x_1 TT-core
0 0.6 ];
F_x_2(:,1,:) = [ 0.8 0 ; % x_2 TT-core
0.3 0.5 ];
F_x_2(:,2,:) = [ 0.1 0 ;
0 0.7 ];
F_u(:,1,:) = [ 0 0 ; % u TT-core
0.9 0 ];
F_u(:,2,:) = [ 0.25 0 ;
0 0.65 ];
F_phi(1,:,:) = [ 1 0 ; % phi TT-core
0 1 ];
T = TTTensor({F_phi, F_u, F_x_2, F_x_1});
sys = mss(T, [1 2], 1, 0, [1 2], []);Simulate with msim.
k = (0:5)';
u = double(k >= 3); % step at k = 3
[y, t, x] = msim(sys, u, k, 1); % sys: the bilinear model above, x0 = 1| Syntax | Result |
|---|---|
sys = mss() |
Empty object with an empty mtiTensor. |
sys = mss(structureMatrix, parameterMatrix, stateIndex, inputIndex, timeStepSize, stateEquationIndex, outputEquationIndex) |
Build from the canonical CPN matrices + index vectors. |
sys = mss(mtiTensor, stateIndex, inputIndex, timeStepSize, stateEquationIndex, outputEquationIndex) |
Build from an existing tensor (or a cell array of TT cores) + index vectors. |
sys = mss(structureMatrixTrue, structureMatrixFalse, structureMatrixContinuous, parameterMatrixOne, parameterMatrixMinusOne, parameterMatrixContinuous, stateIndex, inputIndex, timeStepSize, stateEquationIndex, outputEquationIndex) |
Build from the six split channels + index vectors. |
sys = mss(Name, Value, ...) |
Nameโvalue form; accepts explicit index vectors or scalar
amountโฆ counts. |
Model tensor โ give either the canonical
pair or the six split channels. If structureMatrix
or parameterMatrix is present, the canonical pair is used
and the channel arguments are ignored:
| Name | Description |
|---|---|
structureMatrix |
Canonical . |
parameterMatrix |
Canonical . |
structureMatrixTrue |
Mask of the factors. |
structureMatrixFalse |
Mask of the factors. |
structureMatrixContinuous |
The remaining structure values. |
parameterMatrixOne |
Mask of the parameters. |
parameterMatrixMinusOne |
Mask of the parameters. |
parameterMatrixContinuous |
The remaining parameter values. |
Rows โ row assignment are given either as index vectors or as scalar counts:
| Index vector | Scalar count |
|---|---|
stateIndex |
amountState |
inputIndex |
amountInput |
stateEquationIndex |
amountStateEquation |
outputEquationIndex |
amountOutputEquation |
Model options:
| Name | Default | Description |
|---|---|---|
timeStepSize |
[] |
0 continuous-time, >0 discrete-time
sample time. |
mtiBase |
0 |
0 monomial base, 1 literal base. |
Every name defaults to [] except mtiBase,
which defaults to 0.
Leaving timeStepSize out is accepted but leaves the
property empty, so a model that is to be simulated should always set
it.
Passing counts instead of index vectors commits the matrices to a
defined layout: the structure-matrix rows must be ordered
[state; input] and the parameter-matrix rows
[state equations; output equations], each block filled
sequentially. If the rows follow a different order, pass explicit index
vectors.
mss| Function | Purpose |
|---|---|
ss2mss |
Convert a MATLAB ss/dss model into an
equivalent mss. |
mlgreyest |
Identify an mss from measured data (structure and/or
parameters) where the mtiTensor is a CPNTensor. |
rmss |
Random monomial base mss of a given size โ handy for
tests and examples. |
c2d |
Discretize a continuous-time mss. |
| Property | Description |
|---|---|
mtiTensor |
Model tensor, an mtiTensor (CPNTensor(default) or
TTTensor). |
mtiBase |
Base of the continuous structure entries: 0 monomial,
1 literal. CPN only. |
structureMatrix |
Dependent, hidden. Canonical , , reassembled from the tensor channels. |
parameterMatrix |
Dependent, hidden. Canonical , , base-rescaled per column. |
cores |
Dependent, hidden. TT cores, for a TTTensor model. |
timeStepSize |
0 continuous-time, >0 discrete-time
sample time. |
discretizationType |
Method used by c2d/d2c ("none"
if never discretized). |
lowerBoundary, upperBoundary |
Optional per-equation bounds on the model functions. |
stateName, stateUnit,
inputName, inputUnit, outputName,
outputUnit โ string vectors that must match the
corresponding signal count (nState, nInput,
nOutput). manipulatedVariable,
measuredDisturbance and unmeasuredDisturbance
index the inputs by role.
Set at construction; each maps a matrix row, column or TT-cores to a signal or equation:
| Property | Indexes | Meaning |
|---|---|---|
stateIndex, inputIndex |
rows of structureMatrix / cores of TTTensor |
which structure row / TT-core refers to / . |
stateEquationIndex,
outputEquationIndex |
rows of parameterMatrix |
which parameter row / first TT-core row refers to a state equation
/ an output
.
nOutput follows from the latter. |
columnIndexStateEq,
columnIndexOutputEq |
columns of both matrices (relevant only for CPNTensor) |
which terms each equation block uses (relevant only for CPNTensor). |
An empty outputEquationIndex gives a model with a state
equation only.
| Function | Purpose |
|---|---|
msim |
Simulate the time response to an input trajectory. |
functionValue |
Evaluate the state equation at . |
outputValue |
Evaluate the output equation at . |
stateJacobian /
outputJacobian |
Analytic Jacobians , . |
linearize |
Linearize around an operating point, returning an ss
object or the raw A,B,C,D. |
c2d / d2c |
Discretize / continualize (forward Euler stays mss and
preserves the mtiBase; backward Euler and Tustin yield an
mdss and convert the
model to monomial base if the provided model was in literal base). |
mss2mss |
Linear state transformation (scaling and permutation) and/or conversion between monomial and literal model base. |
mss2mdss |
Convert to the descriptor form. Also converts the model to monomial base if the provided model was in literal base. |
trivialReduction |
Merge duplicate and drop unused monomial columns without changing the function. |
checkIndexDimensions |
Assert that the index vectors cover the tensor exactly. |
allSignalScalarIndices
/ allEquationScalarIndices |
Predicates used by the constructorโs auto-expansion. |
A function is multilinear if every variable appears with a maximum degree of one in each of its terms; multilinear functions are therefore a superclass of linear and of Boolean functions, and a subclass of the polynomial functions. A multilinear function of variables is the inner product of a coefficient vector with a basis vector that collects all multilinear combinations of the variables,
Two choices of that basis vector are in use, and they are what the
mtiBase of an mss selects between:
where
denotes the Kronecker product. The monomial base lists the monomials
;
the literal base lists the products in which each variable occurs either
negated
()
or non-negated
().
In the literal base, the terminology is related to that of mathematical
logic, where a literal is an occurrence of a variable in
negated or non-negated form. It is therefore the natural one for the
representation of functions that originate from Boolean logic.
Both bases span the same function space, so every multilinear function
can be written in either one; only the coefficients differ.
The parameter tensor
of a multilinear vector function
has a CP-decomposition
where for and a parameter matrix .
Normalizing every factor-matrix column with the 1-norm gives the CPN1 (canonical polyadic norm-1) representation [2] used throughout this toolbox. After the normalization the -th column of the -th factor matrix is and , so each column carries a single degree of freedom. Because of this, the second rows of all factor matrices can be stacked into one structure matrix , and the column scalings are absorbed into the parameter matrix :
with the broadcast (element-wise Hadamard) product.
Contracting the normalized factor column with the two-element basis vector of a variable gives the scalar factor function , and the model base decides which basis vector is used:
which written out is
[1] Lichtenberg, Gerwald; Pangalos, Georg; Cateriano Yรกรฑez, Carlos; Luxa, Aline; Jรถres, Niklas; Schnelle, Leona; Kaufmann, Christoph (2022): Implicit multilinear modeling. In at - Automatisierungstechnik 70 (1), pp.ย 13โ30. DOI: 10.1515/auto-2021-0133.
[2] N. Jรถres, C. Kaufmann, L. Schnelle, C. Yรกรฑez, G. Pangalos, and G. Lichtenberg, Reduced CP representation of multilinear models. In Proceedings of the 12th International Conference on Simulation and Modeling Methodologies, Technologies and Applications, Lisbon, Portugal, Jul.ย 2022, pp.ย 252โ259, DOI: 10.5220/0011273100003274.
[3] J.Cherian, E.UhIenberg, H.G.S.Maregowda, L.S.VaIIejos, T.Warnecke, and G. Lichtenberg (2026). Tensor train based explicit multilinear modeling and control of heating systems. CoDIT Conference. DOI: 10.1109/CoDIT70676.2026.11631280.
mdss ยท msim ยท ss2mss ยท mlgreyest ยท mlinearize ยท CPNTensor ยท TTTensor ยท mss2mdss
MyToolbox Documentation | Generated automatically by CI/CD pipeline