MATLAB/Simulink code update

This commit is contained in:
Radu C. Martin 2021-06-02 10:43:38 +02:00
parent d2179071db
commit d6b69acb17
28 changed files with 956 additions and 266 deletions

View file

@ -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)