2

i have some troubles with my objective in pyomo. I'm trying to minimize the difference between meassured value (parameter - which i import from a .txt) and the result for a variable from my optimization model.

Now my objective is:

def _obj_rule(mode):
    return pe.summation(model.T_vl_s_M,model.T_VL_s_dyn)
model.obj = pe.Objective(rule=_obj_rule, sense=pe.minimize)

so the first part is the meassurement (param) and the second is the variable of the optimization. I want to minimize the difference.

What shall i do? When i start the program like this, i get an error, that the maximum number of iterations is exceeded.

Thanks in advance!

IMParasharG
  • 1,869
  • 1
  • 15
  • 26
  • can you post the error message you get? Is it specifically about the creation of the objective function? At a first glance, it doesn't look like you are minimizing the difference between the parameter and the variable, but the dot product of the two. I'm not familiar with Ipopt, there is a tiny chance this is due to an unbounded objective. Is your variable constrained? – Giorgio Balestrieri Feb 15 '19 at 17:04

1 Answers1

1

Not sure what your problem is, but one thing you could try is to increase the maximum number of iterations (not sure what the default value is, somewhere between 200 and 100)

solver = SolverFactory('ipopt')
solver.options['max_iter']= 10000 #number of iterations you wish
solver.solve(YOURMODEL)