I have the following boolean and continuous variables, where only some of the 'percents' have a status of 1.
status[i] = m.Array(m.Var, p, lb=0, ub=1, integer=True)
percent[i] = m.Array(m.FV, p, value=1, lb=0.6, ub=1.1)
I've used some intermediaries that use the min2 option that are fed into my contraint equation.
My objective is a linear summation of status, percent and a constant.
I am using the following solver options:
m = GEKKO(remote=False)
# Options
m.options.SOLVER = 1
m.options.LINEAR = 0
# optional solver settings with APOPT
m.solver_options = ['minlp_maximum_iterations 10000',
'minlp_max_iter_with_int_sol 500',
'minlp_gap_tol 0.01',
'nlp_maximum_iterations 500',
'minlp_as_nlp 0',
'minlp_interger_leaves = 0',
'minlp_branch_method 1',
'minlp_integer_tol 0.01',
'minlp_print_level 2'
]
My returned objective is: 2140.05, none of the constraints are violated and the solution is very good. However, by reducing the 'nlp_maximum_iterations' to 10, I can get an even better solution of 2138.67.
I would expect that my minimum would improve with increasing iterations. My plan was to find a balance between runtime and optimal cost, with the expectation that a long runtime would lead to a solution close to the global minimum, that I could use as a baseline.
In my testing of the problem, it seems that the nlp_max_iterations is the controlling factor on weather or not it finds the lower of the two costs. minlp_maximum_iterations, minlp_max_iter_with_int_sol,and minlp_gap_tol, did not seem to have an affect on the solution.
Any explanation of this behavior would be appreciated greatly.