When generating C code using the MPC module in Simulink, is it necessary to configure an external solver separately?
3 次查看(过去 30 天)
显示 更早的评论
When generating C code using the MPC module in Simulink, is it necessary to configure an external solver separately?
0 个评论
回答(1 个)
Aravind
2025-4-9
No, when generating C code using the MPC module in Simulink, you do not need to configure an external solver separately. The MPC block automatically includes the necessary QP solver in the generated code. Specifically, the MPC block uses KWIK, a built-in active-set QP solver optimized for embedded applications. This solver is automatically included with the generated C code, and the solver parameters are configured directly within the MPC block settings.
If you wish to use a custom QP solver, then you would need to configure the MPC Controller to call this solver instead of the default one. This requires some external configuration. More information about using custom QP solvers for the MPC controller can be found on the following documentation page: https://www.mathworks.com/help/mpc/ug/qp-solver.html#bu7wrmu.
I hope this answers your question.
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!