Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Compute optimal control action for nonlinear MPC controller

`mv = nlmpcmove(nlmpcobj,x,lastmv)`

`mv = nlmpcmove(nlmpcobj,x,lastmv,ref)`

`mv = nlmpcmove(nlmpcobj,x,lastmv,ref,md)`

`mv = nlmpcmove(nlmpcobj,x,lastmv,ref,md,options)`

`[mv,opt] = nlmpcmove(___)`

`[mv,opt,info] = nlmpcmove(___)`

During closed-loop simulations, it is best practice to *warm start* the
nonlinear solver by using the predicted state and manipulated variable trajectories from the
previous control interval as the initial guesses for the current control interval. To use
these trajectories as initial guesses:

Return the

`opt`

output argument when calling`nlmpcmove`

. This`nlmpcmoveopt`

object contains any run-time options you specified in the previous call to`nlmpcmove`

, along with the initial guesses for the state (`opt.X0`

) and manipulated variable (`opt.MV0`

) trajectories.Pass this object in as the

`options`

input argument to`nlmpcmove`

for the next control interval.

These steps are a best practice, even if you do not specify any other run-time options.