GepocUS / Spcies

Suite of Predictive Controllers for Industrial Embedded Systems. A Matlab toolbox for automatic code generation of solvers for MPC controllers.
Apache License 2.0
14 stars 2 forks source link

Code generation is slow for large prediction horizons #26

Closed pablokrupa closed 2 years ago

pablokrupa commented 2 years ago

This should be fixed. My guess is that it is taking a long time because Matlab is appending characters to very long strings. We should segment the strings so that they do not become too large.

A possible solution is to create a separate string/file for each constant variable of the code.

pablokrupa commented 2 years ago

Performance has been significantly improved in 06e4f8af60e5c7c967c1b2b5025c36ed264f87bd. Its still somewhat slow for large problems, but it might be the best we can do with Matlab unless major changes are made, so I will close this issue for now.