Convex over non linear cost type

Hi ,

  • I am using python interface in C++, want to achieve reference trajectory tracking of differential drive, in one of the github code for the differential drive , link : ocp_solver_benchmark/experiments/actuator_diff_drive.py at main · FreyJo/ocp_solver_benchmark · GitHub the author has set the cost type to convex over non linear, so does anyone know what is the reason behind this?
  • Another question is, the C generated code has a function , ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, “scaling”, &new_time_steps[i]); whose one of the parameter is related to scaling, can anyone tell me the information on this parameter, and what is the best value for it or how to figure what it should be set to , since its information is not available even in the acados official documentation, or maybe i am not able to find it.
    Thanks,
    Megha

Hi :waving_hand:

you would want to use the convex-over-nonlinear cost type whenever your objective function is given as the concatenation of an outer convex function with an inner nonlinear function and you would like to use the Generalized Gauss-Newton Hessian. For the mathematical background, cf. this paper

Regarding the scaling, the line
ocp_nlp_cost_model_set(nlp_config, nlp_dims, nlp_in, i, “scaling”, &new_time_steps[i]);
sets the scaling of the individual cost terms to the time steps. This corresponds to an Euler discretization of the Lagrange term in your continuous-time formulation of the optimal control problem. You may find this paper helpful on how to integrate the cost term.