Does Simulink Coder support code generation of custom solver functions for Nonlinear MPC blocks?
9 ビュー (過去 30 日間)
古いコメントを表示
Arnold Sterle
2023 年 1 月 16 日
コメント済み: Arnold Sterle
2023 年 1 月 30 日
I have designed a nonlinear model predictive controller using
MpcObj = nlmpc(nx,ny,nu);
Since I want to use my own solver I have set the according property, i.e.,
MpcObj.Optimization.CustomSolverFcn = "CustomSolverInterface"
Using MpcObj, I prepared a Simulink model calling this object via the Nonlinear MPC block. When running in Simulink, the outputs are as expected.
So I built C-code using the Simulink Coder add-on. Doing so yields an executable which generats a logging file where I can inspect the outputs. However, they now have the same trajectory as if I had used fmincon instead of my custom solver.
So I am wondering whether Simulink Coder supports code generation with custom solvers. If yes, what are the limitations for that?
Best,
Arnold
0 件のコメント
採用された回答
Emmanouil Tzorakoleftherakis
2023 年 1 月 27 日
Hi Arnold,
Unfortunately, right now you can only generate code using 'fmincon'. Custom nlp solvers can currently only be used for simulation. I have let the development team know about this and we will take a look at a future release.
Thanks for bringing this workflow to our attention
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Code Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!