Skip to content

The continuation/GMRES method (C/GMRES) based numerical solvers for nonlinear model predictive control (NMPC) and an automatic code generator for NMPC

License

Notifications You must be signed in to change notification settings

jnswx/CGMRES

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This project provides the continuation/GMRES method (C/GMRES method) based solvers for nonlinear model predictive control (NMPC) and an automatic code generator for NMPC, called AutoGenU.

The following C/GMRES based solvers are provided:

  • The original C/GMRES method (single shooting)
  • The multiple shooting based C/GMRES method
  • The multiple shooting based C/GMRES method with condensing of variables with respect to the constraints on the saturation function on the control input

Requirement

  • C++11 (MinGW and PATH to it are required for Windows users)
  • CMake
  • Python 3, Jupyter Lab or Jupyter Notebook, SymPy (to generate nmpc_model.hpp, nmpc_model.cpp, main.cpp, and CMakeLists.txt by AutoGenU.ipynb)
  • Python 3, NumPy, seaborn (to plot simulation data on AutoGenU.ipynb)

Usage

AutoGenU

AutoGenU.ipynb generates following source files under your setting state equation and cost function:

  • nmpc_model.hpp
  • nmpc_model.cpp
  • main.cpp
  • CMakeLists.txt

You can also build source files for numerical simulation, execute numerical simulation, and plot or save simulation result on AutoGenU.ipynb.

C/GMRES based solvers of NMPC

The C/GMRES based solvers in src/solver directory can be used independently of AutoGenU.ipynb. You are then required the following files:

  • nmpc_model.hpp: write parameters in your model
  • nmpc_model.cpp: write equations of your model
  • main.cpp: write parameters of solvers

In addition to these files, you have to write CMakeLists.txt to build source files.

Demos

  • Inverting a pendubot using the multiple shooting based C/GMRES method pendubot_multiple_shooting_gif pendubot_multiple_shooting_png

  • Inverting a pendubot using the multiple shooting based C/GMRES method with condensing of variables with respect to the constraints on the saturation function on the control input pendubot_with_saturation_gif pendubot_with_saturation_png

License

MIT

References

  1. T. Ohtsuka A continuation/GMRES method for fast computation of nonlinear receding horizon control, Automatica, Vol. 40, No. 4, pp. 563-574 (2004)
  2. C. T. Kelly, Iterative methods for linear and nonlinear equations, Frontiers in Apllied Mathematics, SIAM (1995)
  3. Y. Shimizu, T. Ohtsuka, M. Diehl, A real‐time algorithm for nonlinear receding horizon control using multiple shooting and continuation/Krylov method, International Journal of Robust and Nonlinear Control, Vol. 19, No. 8, pp. 919-936 (2008)

About

The continuation/GMRES method (C/GMRES) based numerical solvers for nonlinear model predictive control (NMPC) and an automatic code generator for NMPC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 70.4%
  • Python 20.8%
  • Jupyter Notebook 8.8%