Simulate closed-loop/open-loop response to arbitrary reference and disturbance signals for implicit or explicit MPC
sim(MPCobj,T,r)
sim(MPCobj,T,r,v)
sim(___,SimOptions)
[y,t,u,xp,xmpc,SimOptions]
= sim(___)
Use sim
to simulate the implicit (traditional) or explicit MPC
controller in closed loop with a linear time-invariant model, which, by default, is the
plant model contained in MPCobj.Model.Plant
. As an alternative,
sim
can simulate the open-loop behavior of the model of the
plant, or the closed-loop behavior in the presence of a model mismatch, when the
controller’s prediction model differs from the actual plant model.
sim(
simulates the closed-loop system formed by the plant model specified in
MPCobj
,T
,r
)MPCobj.Model.Plant
and by the MPC controller specified by the MPC
controller MPCobj
, in response to the specified reference signal,
r
. The MPC controller can be either a traditional MPC controller
(mpc
) or explicit MPC controller
(explicitMPC
). The simulation runs for the specified number of
simulation steps, T
. sim
plots the simulation
results.
sim(
also specifies the measured disturbance signal MPCobj
,T
,r
,v
)v
.
sim(___,
specifies
additional simulation options. This syntax allows you to alter the default simulation
options, such as initial states, input/output noise and unmeasured disturbances, plant
mismatch, etc. You can use SimOptions
)SimOptions
with any of the previous
input combinations.
[
suppresses plotting and instead returns the sequence of plant outputs
y
,t
,u
,xp
,xmpc
,SimOptions
]
= sim(___)y
, the time sequence t
(equally spaced by
MPCobj.Ts
), the manipulated variables u
generated by the MPC controller, the sequence xp
of states of the
model of the plant used for simulation, the sequence xmpc
of states
of the MPC controller (provided by the state observer), and the simulation options,
SimOptions
. You can use this syntax with any of the allowed input
argument combinations.
|
MPC controller containing the parameters of the Model Predictive Control
law to simulate, specified as either an implicit MPC controller ( |
|
Number of simulation steps, specified as a positive integer. If you omit Default: The largest row size of |
|
Reference signal, specified as an array. This array has
Default: |
|
Measured disturbance signal, specified as an array. This array has
Default: Corresponding entries from
|
|
Simulation options, specified as an Default: |
|
Sequence of controlled plant outputs, returned as a
|
|
Time sequence, returned as a |
|
Sequence of manipulated variables generated by the MPC controller,
returned as a |
|
Sequence of plant model states,
|
|
Sequence of MPC controller state estimates, returned as a
|
|
Simulation options used, returned as an |