Main Content

generateExplicitOptions

Optimization options for explicit MPC generation

Description

example

opt = generateExplicitOptions(MPCobj) creates a set of options to use when converting a traditional MPC controller, MPCobj, to explicit form using generateExplicitMPC. The options set is returned with all options set to default values. Use dot notation to modify the options.

Examples

collapse all

Generate an explicit MPC controller based upon a traditional MPC controller for a double-integrator plant.

Define the double-integrator plant.

plant = tf(1,[1 0 0]);

Create a traditional (implicit) MPC controller for this plant, with sample time 0.1, a prediction horizon of 10, and a control horizon of 3.

Ts = 0.1;
p = 10;
m = 3;
MPCobj = mpc(plant,Ts,p,m);
-->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.

To generate an explicit MPC controller, you must specify the ranges of parameters such as state values and manipulated variables. To do so, generate a range structure. Then, modify values within the structure to the desired parameter ranges.

range = generateExplicitRange(MPCobj);
-->Converting the "Model.Plant" property of "mpc" object to state-space.
-->Converting model to discrete time.
   Assuming no disturbance added to measured output channel #1.
-->The "Model.Noise" property of the "mpc" object is empty. Assuming white noise on each measured output channel.
range.State.Min(:) = [-10;-10];
range.State.Max(:) = [10;10];
range.Reference.Min = -2;
range.Reference.Max = 2;
range.ManipulatedVariable.Min = -1.1;
range.ManipulatedVariable.Max = 1.1;

Use the more robust reduction method for the computation. Use generateExplicitOptions to create a default options set, and then modify the polyreduction option.

opt = generateExplicitOptions(MPCobj);
opt.polyreduction = 1;

Generate the explicit MPC controller.

EMPCobj = generateExplicitMPC(MPCobj,range,opt)
 
Explicit MPC Controller
---------------------------------------------
Controller sample time:    0.1 (seconds)
Polyhedral regions:        1
Number of parameters:      4
Is solution simplified:    No
State Estimation:          Default Kalman gain
---------------------------------------------
Type 'EMPCobj.MPC' for the original implicit MPC design.
Type 'EMPCobj.Range' for the valid range of parameters.
Type 'EMPCobj.OptimizationOptions' for the options used in multi-parametric QP computation.
Type 'EMPCobj.PiecewiseAffineSolution' for regions and gain in each solution.

Input Arguments

collapse all

Traditional MPC controller, specified as an MPC controller object. Use the mpc command to create a traditional MPC controller.

Output Arguments

collapse all

Options for generating explicit MPC controller, returned as a structure. When you create the structure, all the options are set to default values. Use dot notation to modify any options you want to change. The fields and their default values are as follows.

Zero-detection tolerance used by the NNLS solver, specified as a positive scalar value.

Redundant-inequality-constraint detection tolerance, specified as a positive scalar value.

Flat region detection tolerance, specified as a positive scalar value.

Constraint normalization tolerance, specified as a positive scalar value.

Maximum number of NNLS solver iterations, specified as a positive integer.

Maximum number of QP solver iterations, specified as a positive integer.

Maximum number of bisection method iterations used to detect region flatness, specified as a positive integer.

Method used to remove redundant inequalities, specified as either 1 (robust) or 2 (fast).

Introduced in R2014b