Define variable ocp.solver_options.tf

Hi everyone,

I am a new Acados user , and I use python programming language. I defined a MPC problem but based on the real data that I have my time step is variable and I want to know how I can define variable solving time for my ocp solver. If I am not mistaken in initialization we define time horizon via “” ocp.solver_option.tf “” , since my time step is changing the value for “ocp.solver_option.tf” should change each time step. how can I change this parameter after initialization ?

Hi Mohsen :wave:

tf is the total length of the prediction horizon.

Please check this example on how to set a nonuniform discretization grid:

Best, Katrin