C code generation applied to nonlinear model predictive control for an artificial pancreas

Research output: Chapter in Book/Report/Conference proceedingArticle in proceedingsResearchpeer-review

Abstract

This paper presents a method to generate C code from MATLAB code applied to a nonlinear model predictive control (NMPC) algorithm. The C code generation uses the MATLAB Coder Toolbox. It can drastically reduce the time required for development compared to a manual porting of code from MATLAB to C, while ensuring a reliable and fairly optimized code. We present an application of code generation to the numerical solution of nonlinear optimal control problems (OCP). The OCP uses a sequential quadratic programming algorithm with multiple shooting and sensitivity computation. We consider the problem of glucose regulation for people with type 1 diabetes as a case study. The average computation time when using generated C code is 0.21 s (MATLAB: 1.5 s), and the maximum computation time when using generated C code is 0.97 s (MATLAB: 5.7 s). Compared to the MATLAB implementation, generated C code can run in average more than 7 times faster.
Original languageEnglish
Title of host publicationProceedings of the 2017 21st International Conference on Process Control
PublisherIEEE
Publication date2017
Pages327-332
ISBN (Print)978-1-5386-4011-1
DOIs
Publication statusPublished - 2017
Event2017 21st International Conference on Process Control - Hotel SOREA TRIGAN Baník, Štrbské Pleso, Slovakia
Duration: 6 Jun 20179 Jun 2017

Conference

Conference2017 21st International Conference on Process Control
LocationHotel SOREA TRIGAN Baník
CountrySlovakia
CityŠtrbské Pleso
Period06/06/201709/06/2017
Series2017 21st International Conference on Process Control (pc)

Keywords

  • MATLAB
  • Sensitivity
  • Optimization
  • Diabetes
  • Sugar
  • Approximation algorithms
  • Mathematical model

Cite this

Boiroux, D., & Jørgensen, J. B. (2017). C code generation applied to nonlinear model predictive control for an artificial pancreas. In Proceedings of the 2017 21st International Conference on Process Control (pp. 327-332). IEEE. 2017 21st International Conference on Process Control (pc) https://doi.org/10.1109/PC.2017.7976235