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
Thanks!

Hi,
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.

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.
Thanks again!

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.