Main Content

simplify

Reduce explicit MPC controller complexity and memory requirements

Description

example

EMPCreduced= simplify(empcobj,'exact')attempts to reduce the number of piecewise affine (PWA) regions in an explicit MPC controller by merging regions that have identical controller gains and whose union is a convex set. Reducing the number of PWA regions reduces memory requirements of the controller. This command returns a reduced controller,EMPCreduced. If the second argument is omitted then it is assumed to be 'exact'.

EMPCreduced= simplify(empcobj,'exact',uniteeps)specifies the tolerance for identifying regions that can be merged.

EMPCreduced= simplify(empcobj,'radius',r)retains only regions whose Chebyshev radius (the radius of the largest ball contained in the region) is larger thanr.

EMPCreduced= simplify(empcobj,'sequence',index)eliminates all regions except those specified in an index vector.

simplify(empcobj,___)applies the reduction to the explicit MPC controllerempcobj, rather than returning a new controller object. You can use this syntax with any of the previous reduction options.

Examples

collapse all

Define a plant model. For this example, define the plant model as a double integrator.

plant = tf(1,[1 0 0])% plant model
plant = 1 --- s^2 Continuous-time transfer function.

Create an MPC controller with a sampling time of 0.1 seconds, a prediction horizon or 10 steps, and a control horizon of 3 steps. Also define a constraint on the manipulated variable.

mpcobj = mpc(plant, 0.1, 10, 3);% MPC controller
-->"Weights.ManipulatedVariables" is empty. Assuming default 0.00000. -->"Weights.ManipulatedVariablesRate" is empty. Assuming default 0.10000. -->"Weights.OutputVariables" is empty. Assuming default 1.00000.
mpcobj.ManipulatedVariables = struct('Min',-1,'Max',1);% hard constraint on manipulated variable

Create a range structure to specify the ranges for input, state, and reference signals.

range.ManipulatedVariable.Min = -1.1;% input signal minrange.ManipulatedVariable.Max = 1.1;% input signal maxrange.State.Min(:) = [-10;-10];% states minrange.State.Max(:) = [10;10];% states maxrange.Reference.Min = -2;% reference minrange.Reference.Max = 2;% reference max

Generate an explicit MPC controller with the specified signal ranges using thegenerateExplicitMPCfunction, and display the resulting controller.

mpcobjExplicit = generateExplicitMPC(mpcobj,range)
-->Converting the "Model.Plant" property to state-space. -->Converting model to discrete time. Assuming no disturbance added to measured output #1. -->"Model.Noise" is empty. Assuming white noise on each measured output. Regions found / unexplored: 19/ 0 Explicit MPC Controller --------------------------------------------- Controller sample time: 0.1 (seconds) Polyhedral regions: 19 Number of parameters: 4 Is solution simplified: No State Estimation: Default Kalman gain --------------------------------------------- Type 'mpcobjExplicit.MPC' for the original implicit MPC design. Type 'mpcobjExplicit.Range' for the valid range of parameters. Type 'mpcobjExplicit.OptimizationOptions' for the options used in multi-parametric QP computation. Type 'mpcobjExplicit.PiecewiseAffineSolution' for regions and gain in each solution.

Note that the resulting explicit controller has 19 polyhedral regions.

Usesimplifyto simplify the explicit MPC controller, and display the resulting controller.

reducedEMPC = simplify(mpcobjExplicit)
Regions to analyze: 15/ 15 Explicit MPC Controller --------------------------------------------- Controller sample time: 0.1 (seconds) Polyhedral regions: 15 Number of parameters: 4 Is solution simplified: Yes State Estimation: Default Kalman gain --------------------------------------------- Type 'reducedEMPC.MPC' for the original implicit MPC design. Type 'reducedEMPC.Range' for the valid range of parameters. Type 'reducedEMPC.OptimizationOptions' for the options used in multi-parametric QP computation. Type 'reducedEMPC.PiecewiseAffineSolution' for regions and gain in each solution.

Note that the simplified explicit controller has 15 polyhedral regions.

Input Arguments

collapse all

Explicit MPC controller to reduce, specified as an Explicit MPC controller object. UsegenerateExplicitMPCto create an explicit MPC controller.

Tolerance for joining PWA regions, specified as a positive scalar.

最低切比雪夫半径retaining PWA regions, specified as a nonnegative scalar. When you use the'radius'option,simplifykeeps only the regions whose Chebyshev radius is larger thanr. The default value is 0, which causes all regions to be retained.

Indices of PWA regions to retain, specified as a vector. The default value is[1:nr], wherenris the number of PWA regions inempcobj. Thus, by default, all regions are retained. You can obtain a sequence of regions to retain by performing simulations usingempcobjand recording the indices of regions actually encountered.

Output Arguments

collapse all

Reduced MPC controller, returned as an Explicit MPC controller object.

Version History

Introduced in R2014b