Use existing solver in Matlab without recompilation

Hi,

sometimes I have to try different runtime parameters (via ocp.set('p', p)) with a solver whose structure remains the same. Currently, the solver is rebuilt every time I restart the simulation in Matlab. But in fact rebuilding is unnecessary in these cases and time consuming.

How can I obtain the OCP-object from existing MEX-files and the corresponding shared library?

BR
Martin

1 Like

Hi Martin,

to speed up the creation of the ocp solver in Matlab, you can set the following options to ‘false’:
compile_interface, codgen_model, compile_model

Moreover, you could just keep the ocp object, update the parameter values and run the simulation again.

Best,
Jonathan