Show minor edits - Show changes to markup
Here, S
must be a structure with following fields: A, B1, B2, B3, B5, C, D1, D2, D3, D5, E1, E2, E3, E4, E5, nx, nu, ny, nz, nd
.
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
.
You can also import the MLD model from a structure generated by HYSDEL2 or HYSDEL3:
(:source lang=MATLAB -getcode:)mld = MLDSystem(S)
Here, S
must be a structure with following fields: A, B1, B2, B3, B5, C, D1, D2, D3, D5, E1, E2, E3, E4, E5, nx, nu, ny, nz, nd
.
{$ 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
{ A_1 x(t) + f_1 if [x(t); u(t)] \in R_1
x(t+Ts) = {
{ A_2 x(t) + f_2 if [x(t); u(t)] \in R_2
@] one would call (:source lang=MATLAB -getcode:) [@
{ A_1 x(t) + B_1 u(t) + f_1 if x(t) \in R_1 x(t+Ts) = { { A_M x(t) + B_M u(t) + f_M if x(t \in R_M { C_1 x(t) + D_1 u(t) + g_1 if x(t) \in R_1 y(t) = { { C_M x(t) + D_M u(t) + g_M if x(t) \in R_M
Here, the only difference to the above procedure is that you should use sys.setDomain('x', R)
when defining the individual affine models.
{$ \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.
{ A_1 x(t) + B_1 u(t) + f_1 if u(t) \in R_1 x(t+Ts) = { { A_M x(t) + B_M u(t) + f_M if u(t \in R_M { C_1 x(t) + D_1 u(t) + g_1 if u(t) \in R_1 y(t) = { { C_M x(t) + D_M u(t) + g_M if u(t) \in R_M
This is achieved by calling sys.setDomain('u', R)
when defining the domain of each local affine model.
{$ \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.
will create the system x(t+1) = A x(t) + f
.
will create the autonomous affine system {$ x(t+1) = A x(t) + f$}.
{ A_1 x(t) + B_1 u(t) + f_1 if [x(t); u(t)] \in R_1 x(t+Ts) = { { A_M x(t) + B_M u(t) + f_M if [x(t); u(t)] \in R_M { C_1 x(t) + D_1 u(t) + g_1 if [x(t); u(t)] \in R_1 y(t) = { { C_M x(t) + D_M u(t) + g_M if [x(t); u(t)] \in R_M
where R_1
, ..., R_M
are polyhedra and M
denotes the number of _modes_ of the PWA system.
{$ \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.
x(t+Ts) = A x(t) + B u(t) + f y(t) = C x(t) + D u(t) + g
where, in addition to LTI systems, we can also define the f
and g
affine terms in the state-update and output equations, respectively.
{$ \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.
{$ \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:
x(t+Ts) = A x(t) + B u(t)
y(t) = C x(t) + D u(t)
sys = LTISystem('A', A, 'B', B, 'C', C, 'D', D, 'Ts', Ts)
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 Ts
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:
sys = LTISystem('A', A, 'B', B, 'C', C, 'D', D, 'Ts', Ts)
sys = LTISystem('A', A, 'B', B)
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:
(:source lang=MATLAB -getcode:)sys = LTISystem('A', A, 'B', B)
Similarly, to define an autonomous system x(t+Ts) = A x(t)
, y(t) = C x(t)
, just call
Similarly, to define an autonomous system {$ x(t+\Delta t) = A x(t)$}, {$y(t) = C x(t)$}, just call
LTISystem
class,
LTISystem
class,
PWASystem
class,
MLDSystem
class.
LTISystem
class,
LTISystem
class,
PWASystem
class,
MLDSystem
class.
LTISystem
class,
LTISystem
class,
PWASystem
class,
MLDSystem
class.
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 @Ts@ represents the sampling time.
To define an LTI system, use the @LTISystem@ command and provide a list of system's parameters:
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 Ts
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.
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.
Similarly, to define an autonomous system @x(t+Ts) = A x(t)@, @y(t) = C x(t)@, just call
Similarly, to define an autonomous system x(t+Ts) = A x(t)
, y(t) = C x(t)
, just call
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:
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.:
Similarly as above, any parameter (except of the A
matrix) can be omitted, e.g.:
will create the system @x(t+1) = A x(t) + f@.
will create the system x(t+1) = A x(t) + f
.
where @R_1@, ..., @R_M@ are polyhedra and @M@ denotes the number of _modes_ of the PWA system.
where R_1
, ..., R_M
are polyhedra and M
denotes the number of _modes_ of the PWA system.
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:
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
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
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.,
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.,
Here, the only difference to the above procedure is that you should use @sys.setDomain('x', R)@ when defining the individual affine models.
Here, the only difference to the above procedure is that you should use sys.setDomain('x', R)
when defining the individual affine models.
This is achieved by calling @sys.setDomain('u', R)@ when defining the domain of each local affine model.
This is achieved by calling sys.setDomain('u', R)
when defining the domain of each local affine model.
To generate an MLD form from a model described by its HYSDEL file, use the @MLDSystem@ constructor:
To generate an MLD form from a model described by its HYSDEL file, use the MLDSystem
constructor:
Note that the HYSDEL compiler is already included in the MPT3 distribution package.
MPT3 support four classes of dynamical systems:
MPT3 allows to create models of linear time-invariant (LTI) models of the form
(:source lang=MATLAB -getcode:)x(t+Ts) = A x(t) + B u(t) y(t) = C x(t) + D u(t)
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 @Ts@ represents the sampling time.
To define an LTI system, use the @LTISystem@ command and provide a list of system's parameters:
(:source lang=MATLAB -getcode:)sys = LTISystem('A', A, 'B', B, 'C', C, 'D', D, 'Ts', Ts)
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:
(:source lang=MATLAB -getcode:)sys = LTISystem('A', A, 'B', B)
Similarly, to define an autonomous system @x(t+Ts) = A x(t)@, @y(t) = C x(t)@, just call
(:source lang=MATLAB -getcode:)sys = LTISystem('A', A, 'C', C, 'Ts', Ts)
Affine systems are represented by
(:source lang=MATLAB -getcode:)x(t+Ts) = A x(t) + B u(t) + f y(t) = C x(t) + D u(t) + g
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:
(:source lang=MATLAB -getcode:)sys = LTISystem('A', A, 'B', B, 'f', f, 'C', C, 'D', D, 'g', g, 'Ts', Ts)
Similarly as above, any parameter (except of the @A@ matrix) can be omitted, e.g.:
(:source lang=MATLAB -getcode:)sys = LTISystem('A', A, 'f', f)
will create the 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.,
(:source lang=MATLAB -getcode:){ A_1 x(t) + B_1 u(t) + f_1 if [x(t); u(t)] \in R_1 x(t+Ts) = { { A_M x(t) + B_M u(t) + f_M if [x(t); u(t)] \in R_M { C_1 x(t) + D_1 u(t) + g_1 if [x(t); u(t)] \in R_1 y(t) = { { C_M x(t) + D_M u(t) + g_M if [x(t); u(t)] \in R_M
where @R_1@, ..., @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:
(:source lang=MATLAB -getcode:)sys1 = LTISystem('A', A_1, 'B', B_1, 'C', C_1, 'D', D_1, 'f', f_1, 'g', g_1, 'Ts', Ts); ... sysM = LTISystem('A', A_M, 'B', B_M, 'C', C_M, 'D', D_M, 'f', f_M, 'g', g_M, 'Ts', Ts);
Then assign the region of validity of each local model:
(:source lang=MATLAB -getcode:)sys1.setDomain('xu', R_1) ... sysM.setDomain('xu', R_M)
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:
(:source lang=MATLAB -getcode:)pwa = PWASystem([sys1, ..., sysM])
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
(:source lang=MATLAB -getcode:){ A_1 x(t) + f_1 if [x(t); u(t)] \in R_1 x(t+Ts) = { { A_2 x(t) + f_2 if [x(t); u(t)] \in R_2
one would call
(:source lang=MATLAB -getcode:)sys1 = LTISystem('A', A_1, 'f', f_1, 'Ts', Ts) sys1.setDomain('xu', R_1) sys2 = LTISystem('A', A_2, 'f', f_2, 'Ts', Ts) sys2.setDomain('xu', R_2) pwa = PWASystem([sys1, sys2])
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.,
(:source lang=MATLAB -getcode:){ A_1 x(t) + B_1 u(t) + f_1 if x(t) \in R_1 x(t+Ts) = { { A_M x(t) + B_M u(t) + f_M if x(t \in R_M { C_1 x(t) + D_1 u(t) + g_1 if x(t) \in R_1 y(t) = { { C_M x(t) + D_M u(t) + g_M if x(t) \in R_M
Here, the only difference to the above procedure is that you should use @sys.setDomain('x', R)@ 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:
(:source lang=MATLAB -getcode:){ A_1 x(t) + B_1 u(t) + f_1 if u(t) \in R_1 x(t+Ts) = { { A_M x(t) + B_M u(t) + f_M if u(t \in R_M { C_1 x(t) + D_1 u(t) + g_1 if u(t) \in R_1 y(t) = { { C_M x(t) + D_M u(t) + g_M if u(t) \in R_M
This is achieved by calling @sys.setDomain('u', R)@ 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:
(:source lang=MATLAB -getcode:)mld = MLDSystem('my_file.hys')
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:
(:source lang=MATLAB -getcode:)parameters.first_symbolic_parameter = 1; parameters.second_symbolic_parameter = 1.2; ... mld = MLDSystem('my_file.hys', parameters)
Note that the HYSDEL compiler is already included in the MPT3 distribution package.