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!
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With