Solver.set stage

Hi! I want to know whether the method solver.set(i, 'yref', yref) sets from 0 to N - 1 or from 1 to N.
And also the p when to set i to 0? and when to N?

Hi,

In the code

i can take values 0, …, N.
The dimension of y at the first node 0 and the last node N, can be different from the intermediate nodes, depending on how you defined your cost terms.
See the examples and the properties yref_0, yref, yref_e, in the documentation.
On the other hand p has the same dimension for all nodes 0,…, N in a single-phase acados OCP.

Best
Jonathan