I like to create an MPC using a vector with discrete constraints and do not know how to implement this using casadi.Opti().
(In my MPC I have hourly values for set points and boundary conditions as solar radiation and outdoor temperatures).
opti = casadi.Opti(); % Optimization problem
limit = @(pos) 1-sin(2*pi*pos)/2;
opti.subject_to(speed<=limit(pos)); % track speed limit
opti.subject_to(0<=U<=1); % contr
Dear all,
Here the speed limit is a function of position (pos).
My question is how can I replace this function with a vector with discrete values in the time horizon.
And how can I do the same in the cost function.
Thanks in advance for answering my question.
Leo Bakker