Define MPC controller state
xmpc = mpcstate(MPCobj)
xmpc = mpcstate(MPCobj,xp,xd,xn,u,p)
xmpc = mpcstate
xmpc = mpcstate(MPCobj) creates a controller
state object compatible with the controller object,
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
ym(k) by a linear
state observer (see State Observer).
Plant model state estimates, specified as a vector with Nxp elements, where Nxp is the number of states in the plant model.
Disturbance model state estimates, specified as a vector with Nxd elements, where Nxd 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.
Measurement noise model state estimates, specified as a vector with Nxn elements, where Nxn is the number of states in the measurement noise model.
Values of the manipulated variables during the previous control interval, specified as a vector with Nu elements, where Nu is the number of manipulated variables.
Covariance matrix for the state estimates, specified as an N-by-N matrix, where N is the sum of Nxp, Nxd and Nxn).
MPC state object, containing the following properties.
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. -->Assuming output disturbance added to measured output channel #1 is integrated white noise. -->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.
View the default covariance matrix.
ans = 4×4 0.0624 0.0000 0.0000 -0.0224 0.0000 1.0000 -0.0000 -0.0000 0.0000 -0.0000 1.0000 0.0000 -0.0224 -0.0000 0.0000 0.2301