Questions about "EXTERNAL" cost function

Hi :waving_hand:

in general, your approach is correct. You need to put all CasADi symbolics of your parameters in model.p. The values in ocp.parameter_values define the initial value of the parameters for each stage. After solver creation you can update these parameters any time using solver.set(stage, "p", new_values). Note that the parameters might be different for each stage, i.e. you need to set them for all stages 0, …, N. You can get the current parameter values with solver.get(stage, "p").

Note that you do not need to set any of the dimensions in ocp.dims as they will be detected when creating the solver.

Hope this helps!
Katrin