I have assigned [0,0] to u_ini,y_ini, but why the result of u_ini,y_ini is not [0,0] but some other vectors?
回答済みdata = load('matrix.mat');
A = data.matrix;
u_ini = sdpvar(2,1,'full'); % u_ini is the initial input
y_ini = sdpvar(2,1,'full'); % y_ini is the initial output
u = sdpvar(10,1,'full');
y = sdpvar(10,1,'full');
g = sdpvar(89,1,'full');
slack_u = sdpvar(2,1,'full');
slack_y = sdpvar(2,1,'full');
b = [u_ini;y_ini;u;y];
constraint =[];
constraint = [constraint,A*g == b,-1<=u<=1];
constraint = [constraint,norm(slack_u,2)<=1e-32,norm(slack_y,2)<=1e-32];
y_ref = ones(size(y));
% Q & R are the weight matrix
objective = norm(y-y_ref, 2)^2;
assign(u_ini, [0;0]);
assign(y_ini, [0;0]);
options = sdpsettings('verbose', 1, 'solver', 'gurobi','debug',1,'gurobi.QCPDual', 1 ...
,'gurobi.TuneTimeLimit', 0);
result = optimize(constraint,objective,options);
g_value = value(g);
u_optimal = A(5:14,1:end)*g_value;
disp(u_optimal); MATLAB YALMIP
0
-
The same as https://support.gurobi.com/hc/en-us/community/posts/28822654654225. So closing for comments.
0
投稿コメントは受け付けていません。
コメント
1件のコメント