Quantcast

Documentation Center

  • Trial Software
  • Product Updates

mpcsimopt

MPC simulation options

Syntax

SimOptions=mpcsimopt(mpcobj)

Description

mpcsimopt creates an mpcsimopt object for specifying additional parameters for simulation with sim.

SimOptions=mpcsimopt(mpcobj) creates an empty object SimOptions which is compatible with the MPC object mpcobj. You must use set / get to change simulation options.

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 columns as unmeasured disturbances.

InputNoise

Noise on manipulated variables.

An array with as many columns as manipulated variables. The last sample of the array is extended constantly over the horizon to obtain the correct size.

OutputNoise

Noise on measured outputs.

An array with as many columns as measured outputs. The last sample of the array is extended constantly over the horizon to obtain the correct size.

RefLookAhead

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

MDLookAhead

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

Constraints

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

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').

MVSignal

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

An array with as many columns as manipulated variables.

OpenLoop

Perform open-loop simulation.

Examples

We want to 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.

% 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;

% Closed-loop MPC simulation with model mismatch 
% and unforeseen unmeasured disturbance inputs

% Define plant model generating 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]);

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

options=mpcsimopt(mpcobj);
options.unmeas=dist;
options.model=psim;

sim(mpcobj,Tf,refs,options);

See Also

Was this topic helpful?