These scripts set up and simulate Model Predictive Control of a general Multi-Input, Multi-Output (MIMO) Control system, when the linearized state-space model (or transfer function) is given as input to the functions. However, the plant model can be nonlinear in general.
Quadratic programming is used to make the input and output variables reach their set-points in the desired time horizon.
The description of the files is as follows:
run_MPC.m: The main file that sets up and runs the simulation.
MPC_simulation.m: Iterates through time and implements the present time input variables that are found at each iterate.
MPC_calculation: The MPC controller that solves the quadratic problem with looking at a forward time horizon based on the linearized model of the plant.
MPC_plant.m: Implements the present time input vector in the plant. In general, the plant model can be nonlinear.
Addnoise.m: A function to add noise to the main signal (output of the plant), based on the order of magnitude of the signal, and noise percentage (noise std)
The formulation and original code (for SISO systems) is by Elling W. Jacobsen from KTH university, Sweden. The formulation is included in the files. The code is modified and generalized for MIMO systems by Pooya Rezaei, University of Vermont, USA.
Thanks for your work!
But I got warning as:
"Warning: Trust-region-reflective algorithm does not solve this type of problem, using active-set
algorithm. You could also try the interior-point-convex algorithm: set the Algorithm option to
interior-point-convex and rerun. For more help, see Choosing the Algorithm in the documentation.
> In quadprog at 371
In MPC_calculation at 97
In MPC_simulation at 23
In run_MPC_old at 64
Could you solve it?
delta_u formulation (page 24 of pdf) is added (*_delta_u). The new obj func to be minimized is: f = 1/2*(y-yref)'*Qy*(y-yref)+1/2*delta_u'*Qu*delta_u
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.