What does constraints.idxbu mean and how to set it appropriately

Hi :wave:

A basic question. I’m just after clarification on what ocp.constraints.idxbu actually specifies and how to set it for a multi input control with constant bounds.
eg
I have 4 control inputs:

    ocp.constraints.lbu = np.array([-uMax, -uMax, -uMax, 0.])
    ocp.constraints.ubu = np.array([uMax, uMax, uMax, 1.0])

    #My guess is we are indexing to the controls? Or are we indexing the controls to the bounds or something else?
    ocp.constraints.idxbu = np.array([0,1,2,3])

My guess is we are indexing to the controls? Or are we indexing the controls to the bounds or something else? Any clarification on what the numbers in the array mean would be appreciated.

Hi,

I see that the docstring might be confusing:
https://docs.acados.org/python_interface/#acados_template.acados_ocp.AcadosOcpConstraints.idxbu

Maybe it should be:
Indices of u that are bounded.

If you change the order in idxbu you would also need to change the order in lbu, ubu.

It is lbu <= u[idxbu] <= ubu.

Cheers!

Okay thanks! Is there anytime this won’t be a list of incrementing integers such as provided by range(nu), Where nu is the number of control variables?

Yes, you might want to formulate problems without bounds on the controls.
E.g, in MHE problems, the noise is are represented by u and typically unconstrained.

1 Like