Documentation Center 
Optimal control action
u = mpcmove(MPCobj,x,ym,r,v)
[u,Info] = mpcmove(MPCobj,x,ym,r,v)
[u,Info] = mpcmove(MPCobj,x,ym,r,v,Options)
u = mpcmove(MPCobj,x,ym,r,v) computes the optimal manipulated variable moves, u(k). u(k) is calculated given the current estimated extended state, x(k), the measured plant outputs, y_{m}(k), the output references, r(k), and the measured disturbances, v(k), at time k. Call mpcmove repeatedly to simulate closedloop model predictive control.
[u,Info] = mpcmove(MPCobj,x,ym,r,v) returns additional information regarding the model predictive controller in the second output argument Info.
[u,Info] = mpcmove(MPCobj,x,ym,r,v,Options) overrides default constraints and weights settings in MPCobj with the values specified by Options, an mpcmoveopt object. Use Options to provide runtime adjustment in constraints and weights during the closedloop simulation.
MPCobj 
mpc object that defines the model predictive controller. 
x 
mpcstate object that contains the following:
To initialize x, use x = mpcstate(MPCobj) and modify default properties as needed. You may need to change the value of x before using it at the next time step under certain circumstances. Suppose that the optimal value for u calculated in the previous call to mpcmove was not used in the plant for some reason (e.g., saturation). You must replace LastMove with the values actually used. mpcmove updates all four properties of x to prepare for an mpcmove call at the next time step. For example, it copies the recommended u values into the LastMove field. To retain the original contents of x, create a copy of it before calling mpcmove. 
ym 
1byn_{ym} vector of current measured output values at time k. n_{ym} is the number of measured outputs. 
r 
pbyn_{y} array of future reference values for the outputs, where p is the prediction horizon and n_{y} is the number of outputs. The i^{th} row of r defines the reference values at time k+i, for i = 1,...,p. The first row must contain the reference signal at time k+1. Additional rows represent known future references and are optional (future values are unknown in most applications). If you supply fewer than p rows of data, mpcmove duplicates the last row to fill the array. You cannot preview the reference signal (also referred to as lookahead and anticipation) if r contains a single row. To support reference previewing, supply at least two rows of data for r. 
v 
pbyn_{md} array of current and future measured disturbance, where p is the prediction horizon and n_{md} is the number of measured disturbances used in feedforward control. The i^{th} row of v defines the measured disturbance values at time k+i1, for i = 1,...,p. The first row must contain the current measured disturbance values. Additional rows represent known future values and are optional (future values are unknown in most applications). If you supply fewer than p rows of data, mpcmove duplicates the last row to fill the array. You cannot preview the measured disturbance signal (also referred to as lookahead and anticipation) if v contains a single row. To support disturbance previewing, supply at least two rows of data for v. 
Options 
mpcmoveopt object that overrides constraints and weights in MPCobj. This approach is computationally efficient to simulate runtime changes in controller tuning and limit values. The same behavior can be found in a Simulink^{®} MPC Controller block when supplied with controller tuning and limit input signals. 
u 
1byn_{u} array of optimal manipulated variable moves, where n_{u} is the number of manipulated variables. mpcmove holds u at its most recent successful solution if the QP solver fails to find a solution for the current time k. 
Info 
Information regarding the model predictive controller. Info is a structure with the following fields:

Use sim for plant mismatch and noise simulation when not using runtime constraints or weight changes.
Use mpctool to graphically and interactively combine model predictive design and simulation.
Use the MPC Controller block in Simulink and for code generation.
getestim  mpc  mpcmoveopt  mpcstate  review  setestim  sim