xmpc = mpcstate(MPCobj)
reates a controller state object compatible with the controller object, MPCobj,
in which all fields are set to their default values that are associated
with the controller's nominal operating point.

xmpc = mpcstate(MPCobj,xp,xd,xn,u,p) sets
the state fields of the controller state object to specified values.
The controller may be an implicit or explicit controller object. Use
this controller state object to initialize an MPC controller at a
specific state other than the default state.

xmpc = mpcstate returns an mpcstate object
in which all fields are empty.

mpcstate objects are updated by mpcmove through the internal state observer
based on the extended prediction model. The overall state is updated
from the measured output y_{m}(k)
by a linear state observer (see State Observer).

Input Arguments

MPCobj

MPC controller, specified as either a traditional MPC controller
(mpc) or explicit MPC controller
(generateExplicitMPC).

xp

Plant model state estimates, specified as a vector with N_{xp} elements,
where N_{xp} is the number
of states in the plant model.

xd

Disturbance model state estimates, specified as a vector with N_{xd} elements,
where N_{xd} is the total number
of states in the input and output disturbance models. The disturbance
model states are ordered such that input disturbance model states
are followed by output disturbance model state estimates.

xn

Measurement noise model state estimates, specified as a vector
with N_{xn} elements, where N_{xn} is
the number of states in the measurement noise model.

u

Values of the manipulated variables during the previous control
interval, specified as a vector with N_{u} elements,
where N_{u} is the number of
manipulated variables.

p

Covariance matrix for the state estimates, specified as an N-by-N matrix,
where N is the sum of N_{xp}, N_{xd} and N_{xn}).

Output Arguments

xmpc

MPC state object, containing the following properties.

Property

Description

Plant

Vector of state estimates for the controller's
plant model. Values are in engineering units and are absolute, i.e.,
they include state offsets.

If the controller's
plant model includes delays, the Plant field of
the MPC state object includes states that model the delays. Therefore length(Plant) >
order of undelayed controller plant model.

Default: controller's Model.Nominal.X property.

Disturbance

Vector of unmeasured disturbance model state estimates.
This comprises the states of the input disturbance model followed
by the states of the output disturbances model.

Disturbance
models may be created by default. Use the getindistand getoutdistcommands
to view the two disturbance model structures.

Default:
zero, or empty if there are no disturbance model states.

Noise

Vector of output measurement noise model state estimates.

Default: zero, or empty if there are no noise model
states.

LastMove

Vector of manipulated variables used in the previous
control interval, u(k–1).
Values are absolute, i.e., they include manipulated variable offsets.

Default: nominal values of the manipulated variables.

Covariance

n-by-n symmetrical
covariance matrix for the controller state estimates, where n is
the dimension of the extended controller state, i.e., the sum of the
number states contained in the Plant, Disturbance,
and Noise fields.

Default: If the
controller is employing default state estimation the default is the
steady-state covariance computed according to the assumptions in Controller State Estimation. See
also the description of the P matrix in the Control
System Toolbox kalmd command.
If the controller is employing custom state estimation, this field
is empty (not used).

Create a Model Predictive Controller for a single-input-single-output (SISO) plant. For this example, the plant includes an input delay of 0.4 time units, and the control interval to 0.2 time units.

H = tf(1,[10 1],'InputDelay',0.4);
MPCobj = mpc(H,0.2);

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

Create the corresponding controller state object in which all states are at their default values.

xMPC = mpcstate(MPCobj)

-->Converting the "Model.Plant" property of "mpc" object to state-space.
-->Converting model to discrete time.
-->Converting delays to states.
-->Integrated white noise added on measured output channel #1.
-->The "Model.Noise" property of the "mpc" object is empty. Assuming white noise on each measured output channel.
MPCSTATE object with fields
Plant: [0 0 0]
Disturbance: 0
Noise: [1x0 double]
LastMove: 0
Covariance: [4x4 double]

The plant model, H, is a first-order, continuous-time transfer function. The Plant property of the mpcstate object contains two additional states to model the two intervals of delay. Also, by default the controller contains a first-order output disturbance model (an integrator) and an empty measured output noise model.