Closed ccebinger closed 2 years ago
Try adding these two options:
m.solver_options = ['minlp_integer_tol 1.0e-6']
m.options.SOLVER=1
Switch to the MINLP solver APOPT
. The default solver (IPOPT
) doesn't not calculate integer solutions. The minlp_integer_tol
is the tolerance for a value to be considered an integer. The default is 0.01 so if x1=0.001 then it is rounded to 0 and accepted as an integer solution.
Please post future questions to Stack Overflow with tag [gekko]: https://stackoverflow.com/questions/tagged/gekko
If you are still getting non-optimal results, try decreasing the minlp_gap_tol
. The default is 1.0e-2
. This can greatly increase the solution time, however.
minlp_gap_tol 1.0e-2
- gap is the spread between the lowest candidate leaf (obj_r=non-integer solution) and the best integer solution (obj_i). When the gap is below the minlp_gap_tol, the best integer solution is returned. The gap is defined as shown here: https://apmonitor.com/wiki/index.php/Main/OptionApmSolver
Thank You!
How do i can free the temporary space after one execution.
I searched for "close", "disconnect", "free", "temporary" in documentation and I found nothing
Error: forrtl: No space left on device forrtl: severe (38): error during write, unit 10, file /tmp/tmpmcc83qssgk_model94342/APOPT.out Stack trace terminated abnormally. Error: 'results.json' not found. Check above for additional error details
Try the m.cleanup()
function. Here is a link to the documentation. You can also reduce the temporary directory size with m.options.DIAGLEVEL=0
.
I have troubles with a Integer Linear Programm. Is it a bug, or do I miss some parameters.
for i 1-10 i would expect [0,0,1] instead of [0,0,0].