First of all, I am grateful for the toolbox that the developers have made open source to everyone.
I have a regular set of ODEs, and I would like to solve over an NLP over a time/spatial horizon to find the optimal control input. However, my problem requires that the control input be constant throughout. I have tried setting the control input as a “parameter” but it seems like “parameters” must be set before solving for the optimisation problem.
I would suggest to use a time horizon of N=1, such that you only have one control input naturally.
In order to achieve good appropriate accuracy of your ODE, set the integrator settings, see Python API — acados documentation
Does that work for you?
If I understood you correctly, setting N=1 and changing the “time steps” property will allow me to have one control input with the integration over the shooting nodes (0, 0.01, 0.02, …, 0.5)?
I suggested to basically just use a single shooting interval (N=1).
If you need multiple shooting intervals (maybe that improves convergence) and need to constrain u to have only one value over the full horizon, I guess you can augment the state dynamics and use a 0 rate constraint, see here: