Set yref at node 0

Hi :wave:

I’m using the python interface of Acados for an MHE problem and I try to add mayer terms only on node 0. So the size of yref will not be the same at node 0 and node [1:N-1]. I know it’s allowed to have different sizes for node N and [1:N-1] but I’m not sure for node 0.

When I try to set yref (see code below) for node 0 I have an error message saying that the shape is different between yref and yref_0

ocp_solver.cost_set(0, "yref", yref_0)

Is it possible in another way or do Acados not let set yref at different sizes?

Thanks a lot.

Amedeo

Hi,

you need to define the cost at stage 0 separately I think.
I suggest you go through this MHE example:

Cheers!