I am working in pyomo, ipopt and python.
- I have a black box model that I believe gives correct solutions to my optimization problem. I tried warm-starting it with these solutions like so:
model.re_pwr_gen = Var(gen_list, within=Reals) #p^g_i for gen in gen_list: model.re_pwr_gen[gen].set_value(warm_data['re_pwr_gen'][gen])
To which I get the resulting:
EXIT: Converged to a point of local infeasibility. Problem may be infeasible. WARNING: Loading a SolverResults object with a warning status into
- To investigate this further I tried fixing the variables instead to look for infeasibilities:
model.re_pwr_gen = Var(gen_list, within=Reals) #p^g_i for gen in gen_list: model.re_pwr_gen[gen].fix(warm_data['re_pwr_gen'][gen]) #check if variable is infeasible with relevant constraints for g in gen_list: if model.gen_re_upper_constr[g]() > gen_dict[g]['p_max']: infeasible_constraints["gen_re_upper_constr"].append(g) print(str(model.gen_re_upper_constr[g]) + " " +str(model.gen_re_upper_constr[g]() - gen_dict[g]['p_max']))
And I found that sometimes the constraints are broken by very small amounts, for example:
gen_re_upper_constr['10'] over by: 1.9404932771749372e-08
- Finally I tried adding these tolerances to my constraints:
def gen_re_upper(model, g): return model.re_pwr_gen[g] <= gen_dict[g]['p_max'] + tol model.gen_re_upper_constr = Constraint(gen_list, rule=gen_re_upper)
And I still get local instabilities! Does anyone have a better idea on how ipopt and pyomo handles warm start values to help me understand what's going on here? Thanks!