Debug log Dec. 25, 2023——MATLAB+Yalmip/GUROBI solution error, solution result NaN

Use Yalmip/GUROBI to solve the MIP problem in the MATLAB environment and set the solver parameters:

ops = sdpsettings('verbose',2,'solver','gurobi');

Optimization solution:

result = optimize(C,F_es,ops);
if result.problem == 0
    disp('求解成功!')
else
    disp('其他求解错误!')
end

If you get "other solution errors", you need to get the result.problem result. You can refer to the official yalmiperror error reporting rules provided by yalmip: yalmiperror - YALMIP

result.problem

On December 25, 2023, the error result was 9, which is an unknown error (if other errors occur, you can find the corresponding document for debugging)

Add debug in sdpsettings ( debug unknown errors - YALMIP )

ops = sdpsettings('verbose',2,'solver','gurobi','debug',1);

Error code: 10009, view GUROBI Error Codes ( Error Codes - Gurobi Optimization )

It was clear that the solution error was caused by the expiration of the license. I re-obtained the license from the GUROBI official (the previous one was only for 6 months: June 2023-December 2023). Anyway, just pay attention to the environment configuration, re-solve the model, and the solution was successful.

Guess you like

Origin blog.csdn.net/HISJJ/article/details/135205136