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

Simulate MPC Control Under Plant Model Mismatch

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

Define the plant and create the MPC controller.

% Open-loop system parameters 
p1 = tf(1,[1 2 1])*[1 1; 0 1];
plant = ss([p1 p1]);

% Define I/O types
plant=setmpcsignals(plant,'MV',[1 2],'UD',[3 4]);

% Define I/O names (optional)
set(plant,'InputName',{'mv1','mv2','umd3','umd4'});

% Model for unmeasured input disturbances
distModel = eye(2,2)*ss(-.5,1,1,0); 

% Create MPC object
mpcobj = mpc(plant,1,40,2);
mpcobj.Model.Disturbance = distModel;

Perform the closed-loop MPC simulation with model mismatch and unforeseen unmeasured disturbance inputs. First, define the plant model that generates the data.

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

Set up the simulation parameters and the options. Create the options set, and then set the relevant options.

dist = ones(1,3); % Unmeasured disturbance trajectory
refs = [1 2];     % Output reference trajectory
Tf = 100; % Total number of simulation steps

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

Simulate the system.

sim(mpcobj,Tf,refs,options);

See Also

Was this topic helpful?