We have symbolic multibody equations as internal model (floating offshore wind turbine). Everything works fine with all parameters being evaluated at compile time. Now that we want to share the code, we would like to keep the possibility of parameterizing the compiled MPC, meaning that all parameters are only known at runtime.
The model has ~100 parameters, hess file size is 50MB. We guess the problem is the symbolic calculation of Hessians. At compilation, we get a segmentation fault at build\sim_dyn_expl_ode_hess.c: In function ‘sim_dyn_expl_ode_hess_f0.isra.1’:
=> Is there a way to ease this calculation, i.e. by calculating hessians numerically?
We’re using the Matlab interface
I understand that the hessian of the dynamic system is quite complex.
Is the hessian of the dynamics actually used in your OCP?
I recently added a bit of documentation on how the OCP hessian is computed in acados, here: Algorithm overview — acados documentation
If the hessian is not needed, maybe some changes in the Matlab interface are needed to not generate it.
Another option would be to reduce the optimization flags in use to simplify the compilation.
I am not sure what you mean by calculating the hessian numerically, while having ~100 unknown parameters in your model. Maybe you can elaborate on this.
Thanks for your quick response!
We use ocp_opts.set(‘nlp_solver_exact_hessian’, ‘true’); I guess this means that we do use the hessians in the OCP. However, the issue occurs already when building the sim objects, meaning that the above ocp_opts setting does not affect it.
I guess we will then have to modify the interface as you say.
We were able to compile the source with mingw compiler after deleting nmpc_dyn_expl_ode_hess.c. However, it seems that the MSVC (VS 2017 - v15) compiler is much more capable with respect to large symbolic equations.