•  Gurobi Staff

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

•   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_modelpi{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%primalconstr=[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];%dualconstr=[constr;omega1{q}>=0];constr=[constr;omega2{q}>=0];%slacknessfor l=1:2*(T+1)*dim_outputconstr=[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])];endfor 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%stationaryconstr=[constr;sum(omega1{q})==1];for l=1:2*dim_state+2*T*dim_mu+2*(T+1)*dim_etaconstr=[constr;omega1{q}'*H(:,l,q)+omega2{q}'*M(:,l,q)==0];endendobj=norm(u,2);options=sdpsettings('verbose',1,'debug',1,'solver','gurobi');sol=optimize(constr,obj,options);