Hi,
I would like to constrain the input rate for an NMPC problem using a direct collocation method.
My NLP control variable is defined as:
Uk = MX.sym(['U_' num2str(k)]);
w = {w{:}, Uk};
lbw = [lbw; -0.5];
ubw = [ubw; 0.5];
w0 = [w0; 0];
I figured that I could define another control variable 'Uk1' vector that stores the control inputs one step ahead such that:
Uk =
and
Uk1 =
U_1
|
U_20
for N = 20
and then implement a constraint:
g = {g{:}, Uk1 - Uk};
lbg = [lbg; -1];
ubg = [ubg; 1];
But this results in the following error:
Error using main (line 6)
.../casadi/core/nlpsol.cpp:120: Cannot create 'solver' since [U_1, U_2, U_3, U_4, U_5, U_6, U_7,
U_8, U_9, U_10, U_11, U_12, U_13, U_14, U_15, U_16, U_17, U_18, U_19, U_20] are free.
Is there another way of constraining the rate of input?