Does Simulink Coder support code generation of custom solver functions for Nonlinear MPC blocks?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Arnold Sterle
el 16 de En. de 2023
Comentada: Arnold Sterle
el 30 de En. de 2023
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 comentarios
Respuesta aceptada
Emmanouil Tzorakoleftherakis
el 27 de En. de 2023
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
Más respuestas (0)
Ver también
Categorías
Más información sobre Model Predictive Control Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!