Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

mpcsimopt

MPC simulation options

Syntax

options = mpcsimopt(MPCobj)

Description

options = mpcsimopt(MPCobj) creates an set of options for specifying additional parameters for simulating an mpc controller, MPCobj, with sim. Initially, options is empty. Use dot notation to change the options as needed for the simulation.

Output Arguments

options

Options for simulating an mpc controller using sim. options has the following properties.

MPC Simulation Options Properties

Property

Description

PlantInitialState

Initial state vector of the plant model generating the data.

ControllerInitialState

Initial condition of the MPC controller. This must be a valid mpcstate object.

    Note   Nonzero values of ControllerInitialState.LastMove are only meaningful if there are constraints on the increments of the manipulated variables.

UnmeasuredDisturbance

Unmeasured disturbance signal entering the plant.

An array with as many rows as simulation steps, and as many columns as unmeasured disturbances. Default: 0

InputNoise

Noise on manipulated variables.

An array with as many rows as simulation steps, and as many columns as manipulated variables. The last sample of the array is extended constantly over the horizon to obtain the correct size. Default: 0

OutputNoise

Noise on measured outputs.

An array with as many rows as simulation steps, and as many columns as measured outputs. The last sample of the array is extended constantly over the horizon to obtain the correct size. Default: 0

RefLookAhead

Preview on reference signal ('on' or 'off'). Default: 'off'

MDLookAhead

Preview on measured disturbance signal ('on' or 'off').

Constraints

Use MPC constraints ('on' or 'off'). Default: 'on'

Model

Model used in simulation for generating the data.

This property is useful for simulating the MPC controller under model mismatch. The LTI object specified in Model can be either a replacement for Model.Plant, or a structure with fields Plant and Nominal. By default, Model is equal to MPCobj.Model (no model mismatch). If Model is specified, then PlantInitialState refers to the initial state of Model.Plant and is defaulted to Model.Nominal.x.

If Model.Nominal is empty, Model.Nominal.U and Model.Nominal.Y are inherited from MPCobj.Model.Nominal. Model.Nominal.X/DX is only inherited if both plants are state-space objects with the same state dimension.

StatusBar

Display the wait bar ('on' or 'off'). Default: 'off'

MVSignal

Sequence of manipulated variables (with offsets) for open-loop simulation (no MPC action).

An array with as many rows as simulation steps, and as many columns as manipulated variables. Default: 0

OpenLoop

Perform open-loop simulation ('on' or 'off'). Default: 'off'

Examples

collapse all

Simulate the MPC control of a multi-input, multi-output (MIMO) system with a mismatch between the predicted and actual plant models. The system has two manipulated variables, two unmeasured disturbances, and two measured outputs.

Define the predicted plant model.

p1 = tf(1,[1 2 1])*[1 1;0 1];
plantPredict = ss([p1 p1]);
plantPredict.InputName = {'mv1','mv2','umd3','umd4'};

Specify the MPC signal types.

plantPredict = setmpcsignals(plantPredict,'MV',[1 2],'UD',[3 4]);

Create the MPC controller.

mpcobj = mpc(plantPredict,1,40,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.

Define the unmeasured input disturbance model used by the controller.

distModel = eye(2,2)*ss(-0.5,1,1,0);
mpcobj.Model.Disturbance = distModel;

Define an actual plant model which differs from the predicted model and has unforeseen unmeasured disturbance inputs.

p2 = tf(1.5,[0.1 1 2 1])*[1 1;0 1];
plantActual = ss([p2 p2 tf(1,[1 1])*[0;1]]);
plantActual = setmpcsignals(plantActual,'MV',[1 2],'UD',[3 4 5]);

Configure the unmeasured disturbance and output reference trajectories.

dist = ones(1,3);
refs = [1 2];

Create and configure a simulation option set.

options = mpcsimopt(mpcobj);
options.UnmeasuredDisturbance = dist;
options.Model = plantActual;

Simulate the system.

sim(mpcobj,20,refs,options)
-->Converting model to discrete time.
-->Assuming output disturbance added to measured output channel #1 is integrated white noise.
-->Assuming output disturbance added to measured output channel #2 is integrated white noise.
-->The "Model.Noise" property of the "mpc" object is empty. Assuming white noise on each measured output channel.
-->Converting model to discrete time.
-->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.

Related Examples

See Also

Introduced before R2006a


Was this topic helpful?