Input bounds depending on the state variable

Hi :wave:

I am new to Acados.
I’m trying to modify “acados/examples/acados_python/race_cars” for my project.

For this, I would like to set the input bounds that is dependent to the state variable.

Specifically, I want to set the upper and lower bounds (“tau_ub” and “tau_lb”) for the input variable “tau” according to

IF vx > vx_ub THEN  tau_ub = 0, tau_lb = 0
IF vx < vx_lb THEN  tau_ub = tau_max, tau_lb = tau_min
IF vx < vx_ub and vx > vx_lb THEN tau_ub = a vx + b, tau_lb = -a vx - b 

where “vx” is the state variable, and “vx_ub”, “vx_lb”, “a”, “b”, “tau_max”, and “tau_min” are all constants.

Unfortunately I can not find an example related this.

My questions are below.

  1. Is it possible to implement this type of constraints with Acados?
  2. If yes, give me some advice :pray:

Thanks for reading.


First of all, if conditions are not smooth and should not be used in SQP type methods.
You can try to put a smooth version of the constraint in the general constraints h though.