MPT3 support four classes of dynamical systems:
LTISystem
class,
LTISystem
class,
PWASystem
class,
MLDSystem
class.
MPT3 allows to create models of linear time-invariant (LTI) models of the form
{$ \begin{align} x(t+\Delta t) = A x(t) + B u(t) \\ y(t) = Cx(t) + Du(t) \end{align}$}
where {$ x(t) $} is the state vector at time {$t$}, {$u(t)$} is the vector of control inputs, {$y(t)$} are the system's outputs, and {$\Delta t$} represents the sampling time.
To define an LTI system, use the LTISystem
command and provide a list of system's parameters:
All parameters, except of the A
matrix, are optional and can be omitted. If the sampling time is not given, Ts=1
will be assumed.
You can easily define an LTI system with zero outputs as follows:
Similarly, to define an autonomous system {$ x(t+\Delta t) = A x(t)$}, {$y(t) = C x(t)$}, just call
Affine systems are represented by
{$ \begin{align} x(t+\Delta t) = A x(t) + B u(t) + f\\ y(t) = Cx(t) + Du(t) + g \end{align}$}
where, in addition to LTI systems, we can also define the {$f$} and {$g$} affine terms in the state-update and output equations, respectively.
Affine systems are created by the LTISystem
command:
Similarly as above, any parameter (except of the A
matrix) can be omitted, e.g.:
will create the autonomous affine system {$ x(t+1) = A x(t) + f$}.
PWA systems are represented by a set of state-update and output equations, each valid in a polyhedral region of the state-input space, i.e.,
{$ \begin{align} x(t+\Delta t) & = \begin{cases} A_1 x(t) + B_1 u(t) + f_1 ~\text{if}~(x(t), u(t)) \in \mathcal{R}_1\\ \vdots \\ A_M x(t) + B_M u(t) + f_M ~\text{if}~(x(t), u(t)) \in \mathcal{R}_M \end{cases}\\ y(t) &= \begin{cases} C_1 x(t) + D_1 u(t) + g_1 ~\text{if}~(x(t), u(t)) \in \mathcal{R}_1\\ \vdots \\ C_M x(t) + D_M u(t) + g_M ~\text{if}~(x(t), u(t)) \in \mathcal{R}_M \end{cases} \end{align} $}
where {$\mathcal{R}_1, \ldots, \mathcal{R}_M $} are polyhedra and {$M$} denotes the number of modes of the PWA system.
The easiest way to define PWA systems in MPT3 is to first describe each local dynamics as an affine system:
Then assign the region of validity of each local model:
where R_1
, ..., R_M
must be polyhedra created by the Polyhedron
command.
Finally, we can create the PWA system by providing the list of local linear models to the PWASystem
constructor:
Note that you can omit all parameters except of the A
matrix when defining the local linear models. For instance, to define an autonomous system of the form
{$ x(t+\Delta t) = \begin{cases} A_1 x(t) + f_1 ~\text{if}~(x(t), u(t)) \in \mathcal{R}_1\\ A_2 x(t) + f_2 ~\text{if}~(x(t), u(t)) \in \mathcal{R}_2 \end{cases} $}
one would call
By default, MPT3 expects that the regions of validity of corresponding local affine models (i.e., regions R_1
, R_2
) are polyhedra in the state-input space. It is also possible to define PWA systems whose regions are only given in the state-space, i.e.,
{$ \begin{align} x(t+\Delta t) & = \begin{cases} A_1 x(t) + B_1 u(t) + f_1 ~\text{if}~x(t) \in \mathcal{R}_1\\ \vdots \\ A_M x(t) + B_M u(t) + f_M ~\text{if}~x(t) \in \mathcal{R}_M \end{cases}\\ y(t) &= \begin{cases} C_1 x(t) + D_1 u(t) + g_1 ~\text{if}~x(t) \in \mathcal{R}_1\\ \vdots \\ C_M x(t) + D_M u(t) + g_M ~\text{if}~x(t) \in \mathcal{R}_M \end{cases} \end{align} $}
Here, the only difference to the above procedure is that you should use sys.setDomain('x', Ri)
when defining the individual affine models.
Similarly, it is also possible to define PWA systems where switching of local models depends only on the value of the control vector:
{$ \begin{align} x(t+\Delta t) & = \begin{cases} A_1 x(t) + B_1 u(t) + f_1 ~\text{if}~u(t) \in \mathcal{R}_1\\ \vdots \\ A_M x(t) + B_M u(t) + f_M ~\text{if}~u(t) \in \mathcal{R}_M \end{cases}\\ y(t) &= \begin{cases} C_1 x(t) + D_1 u(t) + g_1 ~\text{if}~u(t) \in \mathcal{R}_1\\ \vdots \\ C_M x(t) + D_M u(t) + g_M ~\text{if}~u(t) \in \mathcal{R}_M \end{cases} \end{align} $}
This is achieved by calling sys.setDomain('u', Ri)
when defining the domain of each local affine model.
MLD models represent hybrid systems that can be generated using HYSDEL
To generate an MLD form from a model described by its HYSDEL file, use the MLDSystem
constructor:
You can also import the MLD model from a structure generated by HYSDEL2 or HYSDEL3:
Here, S
must be a structure with following fields: A, B1, B2, B3, B5, C, D1, D2, D3, D5, E1, E2, E3, E4, E5, xl, xu, ul, uu, yl, yu, dl, du, zl, zu, nx, nu, ny, nz, nd, nxb, nxr, nub, nur, nyb, nyr
.
If the source file contains symbolic parameters, it is necessary to provide values of such parameters, stored in a structure, as the second input argument: