mpcmove
Compute optimal control action and update controller states
Syntax
Description
Use this command to simulate an MPC controller in closed-loop with a plant model.
Call mpcmove repeatedly in a for-loop to calculate the
manipulated variable and update the controller states at each time step.
Classical MPC
returns the optimal move mv = mpcmove(mpcobj,xc,ym,r,v)mv and updates the states
xc of the classical MPC controller
mpcobj.
The manipulated variable mv at the current time is calculated given:
Classical MPC controller object,
mpcobjState object pointing to the current estimated extended state,
xcMeasured plant outputs,
ymOutput references,
rMeasured disturbance input,
v
If ym, r, or v is
specified as [], or if it is missing as a last input argument,
mpcmove uses the appropriate
mpcobj.Model.Nominal value instead.
When you use default state estimation, mpcmove also updates the
controller state referenced by the handle object xc. Therefore, when
you use default state estimation, xc always points to the updated
controller state. When you use custom state estimation, update xc
prior to each mpcmove call.
[___] = mpcmove(___,
overrides default constraints and weights in options)mpcobj with the values
specified in options, an mpcmoveopt object. Use this syntax with any of the input or output arguments
in the previous syntaxes. Use options to provide run-time adjustment
of constraints and weights during the closed-loop simulation.
Data-Driven MPC
returns the optimal move mv = mpcmove(ddobj,xc,uk1,yk1,r)mv and updates the states
xc of the data-driven MPC controller
ddobj.
The manipulated variable mv at the current time is calculated given:
Data-driven MPC controller object,
ddobjState object pointing to the past trajectory,
xcPlant input measured at the previous control interval,
uk1Plant output measured at the previous control interval,
yk1Output reference data
rfor the control intervals from the current time k to the time k +ddobj.FutureSteps-1.rmust be a matrix withddobj.FutureStepsrows and as many columns as the number of outputs. It defaults to zero if omitted. Use this syntax with any of the input or output arguments in the previous syntaxes.
[___] = mpcmove(___,MVTarget=
additionally specifies the input reference data dataUref)dataUref for the
control intervals from the current time k to the time
k + ddobj.FutureSteps - 1. It
must be a matrix with ddobj.FutureSteps rows and as many columns as
the number of inputs. It defaults to zero if omitted.
Examples
Input Arguments
Output Arguments
Tips
mpcmoveupdatesxc, even though it is an input argument.If
ym,r, orvis specified as[], or if it is missing as a last input argument,mpcmoveuses the appropriatempcobj.Model.Nominalvalue instead.To view the predicted optimal behavior for the entire prediction horizon, plot the appropriate sequences provided in
Info.To determine the optimization status, check
Info.IterationsandInfo.QPCode.
Alternatives
Use
simfor plant mismatch and noise simulation when not using run-time constraints or weight changes.Use the MPC Designer app to interactively design and simulate model predictive controllers.
Use the MPC Controller block in Simulink and for code generation.
Use
mpcmoveCodeGenerationto simulate an MPC controller prior to code generation.
Version History
Introduced before R2006a
See Also
Functions
review|cloffset|buildMEX|mpcmoveCodeGeneration|mpcmoveAdaptive|mpcmoveMultiple|mpcmoveExplicit|sim
Objects
mpc|mpcstate|mpcmoveopt|mpcsimopt|explicitMPC|DataDrivenMPC


