MATLAB/Simulink code update
This commit is contained in:
parent
d2179071db
commit
d6b69acb17
28 changed files with 956 additions and 266 deletions
|
@ -133,14 +133,17 @@ classdef gp_mpc_system < matlab.System & matlab.system.mixin.Propagates
|
|||
real_p = vertcat(vec(DM(w)), vec(DM([obj.u_lags obj.y_lags])));
|
||||
disp("Starting optimization")
|
||||
tic
|
||||
%res = obj.casadi_solver('p', real_p, 'ubx', obj.ubx, 'lbx', obj.lbx);
|
||||
res = obj.casadi_solver('p', real_p, 'ubx', obj.ubx, 'lbx', obj.lbx);
|
||||
t = toc;
|
||||
disp(t)
|
||||
u = obj.Pel * full(res.x(1));
|
||||
u = 15000 * (20 - x);
|
||||
|
||||
% Update the u lags
|
||||
obj.u_lags = [u, obj.u_lags(2:end-1)];
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
function resetImpl(obj)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue