Implementing MPC in the new API v0.6 #404
-
|
Hi, I'm going around the new API and the JuMP-dev talk and the new API for warmstarting and updating parameters. In the talk it presents: for i in 1:N
optimize!(model)
warmstart_backend_start_value(model)
set_parameter_value(x0, value(0))
set_parameter_value(setpoint, set[i])
endA couple of doubts/questions:
t = model[:t];
Dt = supports(t);
t0 = supports(t)[1]; Δt=supports(t)[2]-supports(t)[1];
# make new time window
it0 = round(Int,(t0/Δt));
itend = it0+length(supports(t))-1;
measurement = MPPTData[it0:itend];
@parameter_function(model, Ppv == (t) -> measurement[zero_order_time_index(Dt, t)])could i just update
great new update, really excited to put it in production. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Thanks for reaching out, we are currently making an extensive tutorial and FAQ on MPC to make the new interface more clear, so keep an eye out for that. In the mean time, I am happy to answer questions.
Correct, we leave the domain of
Correct, we can update finite parameters and parameter functions using
This shouldn't be an issue, if you run into any problems, let me know. Just keep in mind that the persistent interface only supports warmstarts and parameter updates at the moment, other changes will cause the backend to be rebuilt (increasing the computational cost). |
Beta Was this translation helpful? Give feedback.
Hi @DarioSlaifsteinSk,
Thanks for reaching out, we are currently making an extensive tutorial and FAQ on MPC to make the new interface more clear, so keep an eye out for that.
In the mean time, I am happy to answer questions.
Correct, we leave the domain of
talone. Just keep in mind that for@infinite_parameter(model, t in [0, tf]), the current time is treated ast=0andtfis the final time of the time horizon for the controller and will shift by one time step on each MPC iteration.Correct, we can update f…