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

Solver compilation error if `N < 3` #29

Open pablokrupa opened 1 year ago

pablokrupa commented 1 year ago

The issue comes from the use of different variables for the first prediction step, the last one, and the rest (e.g. Hi_0, Hi and Hi_N). I believe that, if N is too small, then Hi is declared as a vector, but the code still expects it to be a matrix.

Also, this might not work (period) if N = 2, since in that case there is no use for Hi, for example. The solution might simply be to check that N > 3, setting this as a requirement of the solvers generated by the toolbox.