Linear programming for simulink code generation
7 次查看(过去 30 天)
显示 更早的评论
I'm trying to do TSP problem in simulink and use it to generate a ROS package. However, when I calculating minimum weight perfect matching, I use linear programming to find the best prefect match, but linprog function is not supported for code generation. I tried with a few other ways such as OPTI tool box and fminsearchcon but none of them works, the first one also not supporting code generation and the second one can't give me a proper result when there is more than 16 nodes and cost too much time. (BTW all the block in my simulink models are matlab function blocks)
So how should I fix the problem? I can't use linprog as an external function since I have to pack it into a ROS package so everything in my model should be able to generate code.
I'm thinking about using C++ to add another block solving the minimum weight perfect matching and transfer the data back to matlab function blocks. Will that works? Is there any better option that I could do? Or is there any tutorial vedio for similar problem that I can go through?
Thanks.
2 个评论
johnnynoc4sh
2021-8-24
I´m also confronted with solving an optimization problem in Simulink RT and I had the same experience as you @zihui lang: No information on the WWW about this topic at all. Very disapointing, I guess it is because the needed optimization time during runtime can vary and since can not be estimated by time of compilation. This kills all hard realtime conditions. I will try to implement C++ version of OR Tools by Google. If I suceed, I will report.
Have you done any approaches so far? I wish you good luck, stay in touch.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Publishers and Subscribers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!