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

Dimitri Boiroux, John Bagterp J⊘rgensen
{"title":"C code generation applied to nonlinear model predictive control for an artificial pancreas","authors":"Dimitri Boiroux, John Bagterp J⊘rgensen","doi":"10.1109/PC.2017.7976235","DOIUrl":null,"url":null,"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.","PeriodicalId":377619,"journal":{"name":"2017 21st International Conference on Process Control (PC)","volume":"20 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 21st International Conference on Process Control (PC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/PC.2017.7976235","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

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.
人工胰腺非线性模型预测控制的C代码生成
本文提出了一种由MATLAB代码生成C语言代码的方法,该方法应用于非线性模型预测控制算法。C代码生成使用MATLAB编码器工具箱。与手工将代码从MATLAB移植到C语言相比,它可以大大减少开发所需的时间,同时确保可靠且相当优化的代码。给出了代码生成在非线性最优控制问题(OCP)数值解中的应用。OCP采用顺序二次规划算法进行多次射击和灵敏度计算。我们考虑1型糖尿病患者的葡萄糖调节问题作为一个案例研究。使用生成C代码的平均计算时间为0.21 s (MATLAB: 1.5 s),使用生成C代码的最大计算时间为0.97 s (MATLAB: 5.7 s),与MATLAB实现相比,生成C代码的平均运行速度提高了7倍以上。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信