This enhancement has been incorporated in Release 2008a (R2008a). For previous product releases, read below for any possible workarounds:
The reason why we have "Model.Nominal.U = [0 0 u];" instead of "Model.Nominal.U = up;" is that the first 2 plant inputs are designated as unmeasured disturbance to the Model Predictive Control (MPC) Toolbox by the following structure in the example code:
Plant.InputGroup.UnmeasuredDisturbances = [1 2];
This implies that the Model Predictive Control (MPC) toolbox doesn’t know the values of those 2 plant inputs during its optimization calculation. Therefore, by design, nominal values for all the unmeasured disturbance variables to the Model Predictive Control (MPC) toolbox have to be 0. In other words, if we have
Plant.InputGroup.UnmeasuredDisturbances = [1];
Plant.InputGroup.MeasuredDisturbances = [2];
Plant.InputGroup.ManipulatedVariables = [3];
Then we will see:
Model.Nominal.U = [0 up(2) up(3)];
Note that those two values are used by the plant itself in the closed loop simulation.
Best Answer