% INIT_MPC3.M %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Initialize supervisory MPC made by use of MPC Toolbox

init;

load('mat-files/predmod_mpc3');

Model.Plant = linearsysforMPC;
Model.Noise = linearsysforMPC_noise;

Weights.MV = zeros(1,4);
Weights.MVRate = 0.01 * ones(1,4);
Weights.OV = [ones(1,4), zeros(1,4)];
Weights.ECR = 1e5;

MV = [];
OV = [
    struct('Min',-inf,'Max',inf)
    struct('Min',-inf,'Max',inf)
    struct('Min',-inf,'Max',inf)
    struct('Min',-inf,'Max',inf)
    struct('Min',-2.8492,'Max',0.1508)
    struct('Min',-0.2572,'Max',0.7428)
    struct('Min',-0.2494,'Max',0.7506)
    struct('Min',-0.2497,'Max',0.7503)
    ];

MPCobj = mpc(Model,10,50,50,Weights,MV,OV,[]);

clear Model Weights MV OV

mpc.on = 1;

if (mpc.on)
    disp('### MPC ON ###');
else
    disp('### MPC OFF ###');
end
