setterminal

Terminal weights and constraints

Syntax

setterminal(MPCobj,Y,U)
setterminal(MPCobj,Y,U,Pt)

Description

setterminal(MPCobj,Y,U) specifies diagonal quadratic penalty weights and constraints at the last step in the prediction horizon. The weights and constraints are on the terminal output y(t+p) and terminal input u(t+p – 1), where p is the prediction horizon of the MPC controller MPCobj.

setterminal(MPCobj,Y,U,Pt) specifies diagonal quadratic penalty weights and constraints from step Pt to the horizon end. By default, Pt is the last step in the horizon.

Input Arguments

MPCobj

MPC controller, specified as an MPC controller object

Y

Terminal weights and constraints for the output variables, specified as a structure with the following fields:

Weight1-by-ny vector of nonnegative weights
Min1-by-ny vector of lower bounds
Max1-by-ny vector of upper bounds
MinECR1-by-ny vector of constraint-softening Equal Concern for the Relaxation (ECR) values for the lower bounds
MaxECR1-by-ny vector of constraint-softening ECR values for the upper bounds

ny is the number of controlled outputs of the MPC controller.

If the Weight, Min or Max field is empty, the values in MPCobj are used at all prediction horizon steps including the last. For the standard bounds, if any element of the Min or Max field is infinite, the corresponding variable is unconstrained at the terminal step.

Off-diagonal weights are zero (as described in Standard Cost Function). To apply nonzero off-diagonal terminal weights, you must augment the plant model. See Provide LQR Performance Using Terminal Penalty Weights.

By default, Y.MinECR = Y.MaxECR = 1 (soft output constraints).

Choose the ECR magnitudes carefully, accounting for the importance of each constraint and the numerical magnitude of a typical violation.

U

Terminal weights and constraints for the manipulated variables, specified as a structure with the following fields:

Weight1-by-nu vector of nonnegative weights
Min1-by-nu vector of lower bounds
Max1-by-nu vector of upper bounds
MinECR1-by-nu vector of constraint-softening Equal Concern for the Relaxation (ECR) values for the lower bounds
MaxECR1-by-nu vector of constraint-softening ECR values for the upper bounds

nu is the number of manipulated variables of the MPC controller.

If the Weight, Min or Max field is empty, the values in MPCobj are used at all prediction horizon steps including the last. For the standard bounds, if individual elements of the Min or Max fields are infinite, the corresponding variable is unconstrained at the terminal step.

Off-diagonal weights are zero (as described in Standard Cost Function). To apply nonzero off-diagonal terminal weights, you must augment the plant model. See Provide LQR Performance Using Terminal Penalty Weights.

By default, U.MinECR = U.MaxECR = 0 (hard manipulated variable constraints)

Choose the ECR magnitudes carefully, accounting for the importance of each constraint and the numerical magnitude of a typical violation.

Pt

Step in the prediction horizon, specified as an integer between 1 and p, where p is the prediction horizon. The terminal values are applied to Y and U from prediction step Pt to the end.

Default: Prediction horizon p

Examples

collapse all

Create an MPC controller for a plant with three output variables and two manipulated variables.

plant = rss(3,3,2);
plant.D = 0;
MPCobj = mpc(plant,0.1);
-->The "PredictionHorizon" property of "mpc" object is empty. Trying PredictionHorizon = 10.
-->The "ControlHorizon" property of the "mpc" object is empty. Assuming 2.
-->The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000.
-->The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000.
-->The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000.
   for output(s) y1 y2 and zero weight for output(s) y3 

Specify a prediction horizon of 8.

MPCobj.PredictionHorizon = 8;

Define the following penalty weights and constraints:

  • Diagonal penalty weights of 1 and 10 on the first two output variables

  • Lower bounds of 0 and -1 on the first and third outputs respectively

  • Upper bound of 2 on the second output

  • Lower bound of 1 on the first manipulated variable

Y = struct('Weight',[1,10,0],'Min',[0,-Inf,-1],'Max',[Inf,2,Inf]);
U = struct('Min',[1,-Inf]);

Specify the constraints and penalty weights at the last step of the prediction horizon.

setterminal(MPCobj,Y,U)

Create an MPC controller for a plant with three output variables and two manipulated variables.

plant = rss(3,3,2);
plant.D = 0;
MPCobj = mpc(plant,0.1);
-->The "PredictionHorizon" property of "mpc" object is empty. Trying PredictionHorizon = 10.
-->The "ControlHorizon" property of the "mpc" object is empty. Assuming 2.
-->The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000.
-->The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000.
-->The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000.
   for output(s) y1 y2 and zero weight for output(s) y3 

Specify a prediction horizon of 10.

MPCobj.PredictionHorizon = 10;

Define the following terminal constraints:

  • Lower bounds of 0 and -1 on the first and third outputs respectively

  • Upper bound of 2 on the second output

  • Lower bound of 1 on the first manipulated variable

Y = struct('Min',[0,-Inf,-1],'Max',[Inf,2,Inf]);
U = struct('Min',[1,-Inf]);

Specify the constraints beginning at step 5 and ending at the last step of the prediction horizon.

setterminal(MPCobj,Y,U,5)

Tips

  • Advanced users can impose terminal polyhedral state constraints:

    K1HxK2.

    First, augment the plant model with additional artificial (unmeasured) outputs, y = Hx. Then specify bounds K1 and K2 on these y outputs.

Introduced in R2011a