Scaling of stage cost based on time step

Hi,

I was looking at the documentation and saw that the stage cost is scaled by the time step which isn’t the typical formulation. I was wondering what was the reason behind this? The only reason I can think of is that if the time step is changed while the prediction time/horizon time is set to the same value, then the cost values will be of similar scale and perhaps comparable.

From the documentation:
Note: by default the cost is scaled with the time step, and the terminal cost term scaled with 1. This can be overwritten by setting the ‘scaling’ field.

Thank you
Nico

Hi Nico,

the reasoning behind this is the fact the acados interface assumes you are specifying a continuous-time optimal control problem, cf. the acados problem formulation:

https://github.com/acados/acados/blob/main/docs/problem_formulation/problem_formulation_ocp_mex.pdf

acados then discretizes this continuous-time problem for you. By default the stage cost is integrated using a single Euler step which corresponds to a multiplication with the time step \Delta t. You can also integrate the stage cost with the same integrator used for the dynamics by setting the option cost_discretization to 'INTEGRATOR'.

Best, Katrin