How can I get the 'y_hat' and 'u' prediction values from my Model Predictive Controller in Simulink in Model Predictive Control Toolbox 3.1.1 (R2009b)?
I have designed my MPC object using the MPC toolbox. I can simulate this with the command SIM but I would like the y_hat and u prediction values at each step along the way.
NOTE:-
It is not possible to get the 'y_hat' and 'u' prediction values from the MPC controller block in Simulink. This functionality is not available in Model Predictive Control Toolbox 3.1.1 (R2009b). You can, however, get this information via simulation in MATLAB using the MPCMOVE function in a step by step method as outlined below:
% Open-loop system parameters % True plant and true initial state sys = ss(tf({1,1,1},{[1 .5 1],[1 1],[.7 .5 1]})); x0 = [0 0 0 0 0]'; % MPC object setup Ts = 0.2; % sampling time % Define type of input signals sys.InputGroup=struct('Manipulated',1,'Measured',2,'Unmeasured',3); % Define constraints on manipulated variable MV = struct('Min', 0, 'Max', 1); Model = []; % Reset structure Model Model.Plant = sys; % Integrator driven by white noise with variance=1000
Comments
Post a Comment