This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

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.

nlmpcmoveopt

Option set for nlmpcmove function

Description

To specify options for the nlmpcmove function, use an nlmpcmoveopt option set.

Using this option set, you can specify run-time values for a subset of controller properties, such as tuning weights and constraints. If you do not specify a value for one of the nlmpcmoveopt properties, the corresponding value defined in the nlmpc controller object is used instead.

Creation

Syntax

options = nlmpcmoveopt

Description

example

options = nlmpcmoveopt creates a default set of options for the nlmpcmove function. To modify the property values, use dot notation.

Properties

expand all

Output variable tuning weights that replace the Weights.OutputVariables property of the controller at run time, specified as a row vector or array of nonnegative values.

To use the same weights across the prediction horizon, specify a row vector of length Ny, where Ny is the number of output variables.

To vary the tuning weights over the prediction horizon from time k+1 to time k+p, specify an array with Ny columns and up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the output variable tuning weights for one prediction horizon step. If you specify fewer than p rows, the weights in the final row are used for the remaining steps of the prediction horizon.

Manipulated variable tuning weights that replace the Weights.ManipulatedVariables property of the controller at run time, specified as a row vector or array of nonnegative values.

To use the same weights across the prediction horizon, specify a row vector of length Nmv, where Nmv is the number of manipulated variables.

To vary the tuning weights over the prediction horizon from time k to time k+p-1, specify an array with Nmv columns and up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the manipulated variable tuning weights for one prediction horizon step. If you specify fewer than p rows, the weights in the final row are used for the remaining steps of the prediction horizon.

Manipulated variable rate tuning weights that replace the Weights.ManipulatedVariablesRate property of the controller at run time, specified as a row vector or array of nonnegative values.

To use the same weights across the prediction horizon, specify a row vector of length Nmv, where Nmv is the number of manipulated variables.

To vary the tuning weights over the prediction horizon from time k to time k+p-1, specify an array with Nmv columns and up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the manipulated variable rate tuning weights for one prediction horizon step. If you specify fewer than p rows, the weights in the final row are used for the remaining steps of the prediction horizon.

Slack variable tuning weight that replaces the Weights.ECR property of the controller at run time, specified as a positive scalar.

Output variable lower bounds, specified as a row vector of length Ny or an array with Ny columns, where Ny is the number of output variables. OutputMin(:,i) replaces the OutputVariables(i).Min property of the controller at run time.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k+1 to time k+p, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

Output variable upper bounds, specified as a row vector of length Ny or an array with Ny columns, where Ny is the number of output variables. OutputMax(:,i) replaces the OutputVariables(i).Max property of the controller at run time.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k+1 to time k+p, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

Manipulated variable lower bounds, specified as a row vector of length Nmv or an array with Nmv columns, where Nmv is the number of manipulated variables. MVMin(:,i) replaces the ManipulatedVariables(i).Min property of the controller at run time.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k to time k+p-1, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

Manipulated variable upper bounds, specified as a row vector of length Nmv or an array with Nmv columns, where Nmv is the number of manipulated variables. MVMax(:,i) replaces the ManipulatedVariables(i).Max property of the controller at run time.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k to time k+p-1, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

Manipulated variable rate lower bounds, specified as a row vector of length Nmv or an array with Nmv columns, where Nmv is the number of manipulated variables. MVRateMin(:,i) replaces the ManipulatedVariables(i).RateMin property of the controller at run time. MVRateMin bounds must be nonpositive.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k to time k+p-1, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

Manipulated variable rate upper bounds, specified as a row vector of length Nmv or an array with Nmv columns, where Nmv is the number of manipulated variables. MVRateMax(:,i) replaces the ManipulatedVariables(i).RateMax property of the controller at run time. MVRateMax bounds must be nonnegative.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k to time k+p-1, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

State lower bounds, specified as a row vector of length Nx or an array with Nx columns, where Nx is the number of states. StateMin(:,i) replaces the States(i).Min property of the controller at run time.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k+1 to time k+p, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

State upper bounds, specified as a row vector of length Nx or an array with Nx columns, where Nx is the number of states. StateMax(:,i) replaces the States(i).Max property of the controller at run time.

To use the same bounds across the prediction horizon, specify a row vector.

To vary the bounds over the prediction horizon from time k+1 to time k+p, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the bounds for one prediction horizon step. If you specify fewer than p rows, the final bounds are used for the remaining steps of the prediction horizon.

Manipulated variable targets, specified as a row vector of length Nmv or an array with Nmv columns, where Nmv is the number of manipulated variables.

To use the same manipulated variable targets across the prediction horizon, specify a row vector.

To vary the targets over the prediction horizon (previewing) from time k to time k+p-1, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the targets for one prediction horizon step. If you specify fewer than p rows, the final targets are used for the remaining steps of the prediction horizon.

Parameter values used by the prediction model, custom cost function, and custom constraints, specified as a cell vector with length equal to the Model.NumberOfParameters property of the controller. If the controller has no parameters, then Parameters must be {}.

The controller, nlmpcobj, passes these parameters to the:

  • Model functions in nlmpcobj.Model (StateFcn and OutputFcn)

  • Cost function nlmpcobj.Optimization.CustomCostFcn

  • Constraint functions in nlmpcobj.Optimization (CustomEqConFcn and CustomIneqConFcn)

  • Jacobian functions in nlmpcobj.Jacobian

The order of the parameters must match the order defined for these functions.

Initial guesses for the optimal state solutions, specified as a row vector of length Nx or an array with Nx columns, where Nx is the number of states.

To use the same initial guesses across the prediction horizon, specify a row vector.

To vary the initial guesses over the prediction horizon from time k+1 to time k+p, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the initial guesses for one prediction horizon step. If you specify fewer than p rows, the final guesses are used for the remaining steps of the prediction horizon.

If X0 is [], the default initial guesses are the current states of the prediction model (x input argument to nlmpcmove).

In general, during closed-loop simulation, you do not specify X0 yourself. Instead, when calling nlmpcmove, return the opt output argument, which is an nlmpcmoveopt object. opt.X0 contains the calculated optimal state trajectories as initial guesses. You can then pass opt 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.

Initial guesses for the optimal manipulated variable solutions, specified as a row vector of length Nmv or an array with Nmv columns, where Nmv is the number of manipulated variables.

To use the same initial guesses across the prediction horizon, specify a row vector.

To vary the initial guesses over the prediction horizon from time k to time k+p-1, specify an array with up to p rows. Here, k is the current time and p is the prediction horizon. Each row contains the initial guesses for one prediction horizon step. If you specify fewer than p rows, the final guesses are used for the remaining steps of the prediction horizon.

If MV0 is [], the default initial guesses are the control signals used in the plant at the previous control interval (lastmv input argument to nlmpcmove).

In general, during closed-loop simulation, you do not specify MV0 yourself. Instead, when calling nlmpcmove, return the opt output argument, which is an nlmpcmoveopt object. opt.MV0 contains the calculated optimal manipulated variable trajectories as initial guesses. You can then pass opt 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.

Initial guess for the slack variable at the solution, specified as a nonnegative scalar. If Slack0 is [], the default initial guess is 0.

In general, during closed-loop simulation, you do not specify Slack0 yourself. Instead, when calling nlmpcmove, return the opt output argument, which is an nlmpcmoveopt object. opt.Slack contains the calculated slack variable as an initial guess. You can then pass opt 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.

Object Functions

nlmpcmoveCompute optimal control action for nonlinear MPC controller

Examples

collapse all

Create a default nlmpcmoveopt option set.

options = nlmpcmoveopt;

Specify the run-time values for the controller prediction model parameters. For this example, assume that the controller has the following optional parameters, which are input arguments to all the prediction model functions and custom functions of the controller.

  • Sample time of the model, specified as a single numeric value. Specify a value of 0.25.

  • Gain factors, specified as a two-element row vector. Specify a value of [0.7 0.35].

The order in which you specify the parameters must match the order specified in the custom function argument lists. Also, the dimensions of the parameters must match the dimensions expected by the custom functions.

options.Parameters = {0.25,[0.7 0.35]};

To use these parameters when computing optional control actions for a nonlinear MPC controller, pass options to the nlmpcmove function.

Introduced in R2018b