Can't get the result of optimization problem in an acceptable time(more than 10 hours).
OngoingThe above message is provided by matlab2022a with gurobi10.0. Now I have some questions. Firstly, I think that I don't set any quadratic constraint but the log shows that there is a quadratic constraint. I want to konw why dose this happen. Secondly, My problem is big in the number of constaints, but at the last time, It takes me 10 hours and still doesn't get the result. The nodes that are not searched are more and more, and I can't get the Gap. I sincerely hope that you can help me and tell me the reason. If you need more details about the program or the code, I will sent it as soon as possible.
-
Hi Songtao,
Thanks for the log output, but it will be hard to help without seeing the code, or math formulation, you used to produce your model.
If you send it through, then someone may be able to provide you advice.
- Riley
0 -
My code is consist of three fuctions, and most of them have more than 100 rows. So I want to send the constraints and objective firstly. Hoping to get your instruction.
u=sdpvar(T*dim_input,1,'full');
constr=[Pu_bar*u<=pu_bar];
for q=1:num_model
pi{q}=sdpvar(size(K(:,:,q),1),size(M(:,:,q),1),'full');
delta{q}=sdpvar(1,1,'full');
z{q}=sdpvar(2*dim_state+2*T*dim_mu+2*(T+1)*dim_eta,1,'full');
omega1{q}=sdpvar(2*(T+1)*dim_output,1,'full');
omega2{q}=sdpvar(size(M(:,:,q),1),1,'full');
g1{q}=sdpvar(2*(T+1)*dim_output,1,'full');
g2{q}=sdpvar(size(M(:,:,q),1),1,'full');
constr=[constr;pi{q}*m(:,:,q)<=k(:,:,q)-Px_title(:,:,q)*Gammaxu_title(:,:,q)*u];
constr=[constr;pi{q}*M(:,:,q)==K(:,:,q)];
constr=[constr;pi{q}>=0];
constr=[constr;delta{q}>=xi];
%KKT condition
%primal
constr=[constr;H(:,:,q)*z{q}+C_title(:,:,q)*Gammaxu_title(:,:,q)*u+C_title(:,:,q)*Gammax_title(:,:,q)-delta{q}*ones(size(H(:,:,q),1),1)<=0];
constr=[constr;M(:,:,q)*z{q}-m(:,:,q)<=0];
%dual
constr=[constr;omega1{q}>=0];
constr=[constr;omega2{q}>=0];
%slackness
for l=1:2*(T+1)*dim_output
constr=[constr;g1{q}(l)==H(l,:,q)*z{q}+C_title(l,:,q)*Gammaxu_title(:,:,q)*u+C_title(l,:,q)*Gammax_title(:,:,q)-delta{q};sos1([g1{q}(l),omega1{q}(l)],[1,10])];
end
for l=1:size(M(:,:,q),1)
constr=[constr;g2{q}(l)==M(l,:,q)*z{q}-m(l,:,q);sos1([g2{q}(l),omega2{q}(l)],[1,10])];
end
%stationary
constr=[constr;sum(omega1{q})==1];
for l=1:2*dim_state+2*T*dim_mu+2*(T+1)*dim_eta
constr=[constr;omega1{q}'*H(:,l,q)+omega2{q}'*M(:,l,q)==0];
end
end
obj=norm(u,2);
options=sdpsettings('verbose',1,'debug',1,'solver','gurobi');
sol=optimize(constr,obj,options);0
Please sign in to leave a comment.
Comments
2 comments