Non robust results

Hi all,

I am facing a problem to get robust results using oemof-solph 0.5.2 and gurobi 11.0.1 on Windows via WinPyhton, but also have the problem via Anaconda. I have a fairly large energy model with the following components:

  • 4x buses, like electricity, CH4, FT, H2
  • 13x flexible sources (dispatch), like gas power plants
  • 15x fixed sources (dispatch), like pv
  • 8x converters (dispatch), like electrolysis
  • 5x flexible sinks (dispatch), like export
  • 123x fixed sinks (dispatch), like various industrial processes
  • 4 storages (invest for input-power, capacitiy and output-power in combination with exist), like H2-, CH4, FT, battery storage

Running the energy model in Spyder gives me some results, running it again in Spyder without closing it before gives me the same results. However, if I close Spyder and open it again I get slightly different results. I have already tried setting the gurobi parameter “seed”, but it did not help.

I am solving the energy model with following code line:

modell.solve(solver="gurobi", solve_kwargs={"tee": True, "logfile": os.path.join(os.getcwd(), modell_logfile)}, cmdline_options={"Seed": 123})

Has anyone else experienced this problem?

Thanks in advance for any help!

Kind regards,
Alex

Hi @Alexander,

What does “slightly different” mean? If I understand the Gurobi documentation correct, is stops if it approaches the optimum to 0.1 % (see MIPGap - Gurobi Optimization). Is this the order of magnitude of the differences you observe?

Cheers,
Patrik

Hi @pschoen,

Thanks for your reply. Indeed, it is less than 0.1%. But why do I only get this difference when I close and open Spyder? How can I adjust it to get reproducible results? I do not change any input data. The idea is that I want to use these optimisation results for another run with oemof. So with each iteration, the overall magnitude of the differences would increase.

By the way, if I don’t take energy storages into account, then I don’t have any differences.

Best regards,
Alex

Another interesting point is that the optimal objective value is always the same. However, the use of the components is slightly different. It seems that there are more minima. Can I tell gurobi to use the same method/starting points to find the same minima even after restarting spyder?

Maybe, it is a single wide minimum. (This is more likely for a linear problem. But with integer variables I won’t exclude more than one minimum.) However, I’m sorry but I have no idea. I never really used Gurobi.