Computationally tractable learning-based nonlinear tube MPC using difference of convex neural network dynamic approximation
Input-Convex Neural Network architecture whose kernel weights
Learning-based robust tube-based MPC of dynamic systems approximated by difference-of-convex (DC) Neural Network models. Successive linearisations of the learned dynamics in DC form are performed to express the MPC scheme as a sequence of convex programs. Convexity in the learned dynamics is exploited to bound successive linearisation errors tightly and treat them as bounded disturbances in a robust MPC scheme. Application to a PVTOL aircraft model. This novel computationally tractabe tube-based MPC algorithm is presented in the paper "Computationally tractable nonlinear robust MPC via DC programming" by Martin Doff-Sotta and Mark Cannon. It is an extension of our previous work here and here
In order to derive a sequence of convex programs, the dynamics are learned in DC form using DC Neural Network models. These are obtained by stacking two Input-Convex Neural Networks models whose kernel weights are constrained to be non-negative and activation functions are convex non-decreasing (e.g. ReLU).
- Python 3
- CVXPY
- MOSEK
- Keras
You need to install the following:
- numpy
- matplotlib
- pydot
- tensorflow / keras
- CVXPY
- MOSEK
In a terminal command line, run the following to install all modules at once
pip3 install numpy matplotlib tensorflow cvxpy Mosek
Using solver Mosek
requires a license. Follow the instructions here to obtain it.
-
To clone the repository in the current location, run the following in the terminal
git clone https://github.com/martindoff/DC-NN-MPC.git
-
Go to directory
cd DC-NN-MPC
-
Run the program
python3 main.py
- To load an existing model, set the
load
variable inmain.py
toTrue
load = True
Set the variable to False
if the model has to be (re)trained.
-
The tube parameterisation can be chosen via the
set_param
variable inmain.py
. For a tube cross section parameterised by means of elementwise bounds, setset_param = 'elem'
For a tube parameterised by means of simplex sets:
set_param = 'splx'
The DC decomposition of the system dynamics
DC decomposition with DC Neural Networks
The closed-loop solution is presented below
Closed-loop tube MPC solution