Skip to content

PVDC-project/example-linear-mpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Linear MPC in MATLAB/Simulink using YALMIP

This example shows how to formulate a linear MPC problem using YALMIP. The simulation can be carried out in either MATLAB or Simulink.

A linear MPC formulation usually has a quadratic objective, linear system dynamics and simple bounds on states or inputs:

$$ \begin{aligned} \min_{x_{0:N}, u_{0:N-1}} \quad & (x_N-x_r)^\top Q_N(x_N-x_r) + \sum_{k=0}^{N-1}{ (x_k-x_r)^\top Q (x_k-x_r) + u_k^\top R u_k } \\ \textrm{subject to} \quad & x_{k+1} = A x_k + B u_k\\ & x_0 = \bar{x} \\ & x_{\text{min}} \leq x_k \leq x_{\text{max}} \\ & u_{\text{min}} \leq u_k \leq u_{\text{max}} \end{aligned} $$

Note: the simulation and MPC parameters are not necessarily realistic, they were chosen to be as simple as possible.

About

Linear MPC in MATLAB/Simulink using YALMIP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages