generateExplicitOptions
Optimization options for explicit MPC generation
Description
creates
a set of options to use when converting a traditional MPC controller, opt
= generateExplicitOptions(MPCobj
)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
Generate Explicit MPC Controller
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 is empty. Assuming default 0.00000. -->The "Weights.ManipulatedVariablesRate" property is empty. Assuming default 0.10000. -->The "Weights.OutputVariables" property 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 to state-space. -->Converting model to discrete time. Assuming no disturbance added to measured output channel #1. -->The "Model.Noise" property is empty. Assuming white noise on each measured output.
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
MPCobj
— Traditional MPC controller
MPC controller object
Traditional MPC controller, specified as an MPC controller object.
Use the mpc
command to create
a traditional MPC controller.
Output Arguments
opt
— Options for generating explicit MPC controller
structure
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.
zerotol
— Zero-detection tolerance
1e-8
(default) | positive scalar value
Zero-detection tolerance used by the NNLS solver, specified as a positive scalar value.
removetol
— Redundant-inequality-constraint detection tolerance
1e-4
(default) | positive scalar value
Redundant-inequality-constraint detection tolerance, specified as a positive scalar value.
flattol
— Flat region detection tolerance
1e-5
(default) | positive scalar value
Flat region detection tolerance, specified as a positive scalar value.
normalizetol
— Constraint normalization tolerance
0.01 (default) | positive scalar value
Constraint normalization tolerance, specified as a positive scalar value.
maxiterNNLS
— Maximum number of NNLS solver iterations
500 (default) | positive integer
Maximum number of NNLS solver iterations, specified as a positive integer.
maxiterQP
— Maximum number of QP solver iterations
200 (default) | positive integer
Maximum number of QP solver iterations, specified as a positive integer.
maxiterBS
— Maximum number of bisection method iterations
100 (default) | positive integer
Maximum number of bisection method iterations used to detect region flatness, specified as a positive integer.
polyreduction
— Method for removing redundant inequalities
2 (default) | 1
Method used to remove redundant inequalities, specified as either 1 (robust) or 2 (fast).
Version History
Introduced in R2014b
See Also
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)