NREL / HOPP

BSD 3-Clause "New" or "Revised" License
21 stars 45 forks source link

cbc solver doesn't dispatch the battery #193

Open kbrunik opened 1 year ago

kbrunik commented 1 year ago
Simulating` system with dispatch optimization...
         0 % complete
ERROR: Solver (cbc) returned non-zero return code (-6)
Traceback (most recent call last):
  File "baseline.py", line 862, in <module>
    testing()
  File "baseline.py", line 817, in testing
    run_simulations(location=location, output_level=0, verbose=True, show_plots=False, save_plots=False)
  File "baseline.py", line 691, in run_simulations
    hopp_results =          run_hopp(hopp_site,
  File "baseline.py", line 384, in run_hopp
    hybrid_plant.simulate(hopp_scenario["Useful Life"])
  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/hybrid_simulation.py", line 720, in simulate
    self.simulate_power(project_life, lifetime_sim)
  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/hybrid_simulation.py", line 630, in simulate_power
    self.dispatch_builder.simulate_power()
  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/technologies/dispatch/hybrid_dispatch_builder_solver.py", line 387, in simulate_power
    self.simulate_with_dispatch(t)
  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/technologies/dispatch/hybrid_dispatch_builder_solver.py", line 475, in simulate_with_dispatch
    self.solve_dispatch_model(start_time, n_days)
  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/technologies/dispatch/hybrid_dispatch_builder_solver.py", line 117, in solve_dispatch_model
    solver_results = self.cbc_solve()
  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/technologies/dispatch/hybrid_dispatch_builder_solver.py", line 233, in cbc_solve
    return HybridDispatchBuilderSolver.cbc_solve_call(self.pyomo_model,
  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/technologies/dispatch/hybrid_dispatch_builder_solver.py", line 225, in cbc_solve_call
    results = solver.solve(pyomo_model, options=solver_options.constructed)
  File "/Users/kbrunik/opt/anaconda3/envs/storage/lib/python3.8/site-packages/pyomo/opt/base/solvers.py", line 627, in solve
    raise ApplicationError("Solver (%s) did not exit normally" % self.name)
pyomo.common.errors.ApplicationError: Solver (cbc) did not exit normally
kbrunik commented 1 year ago

Issue found on branch: https://github.com/NREL/HOPP/tree/feature/offshore-h2

dguittet commented 1 year ago

Can you run this with logging?

Modify the line

  File "/Users/kbrunik/github/forked/HOPP/hopp/simulation/technologies/dispatch/hybrid_dispatch_builder_solver.py", line 225, in cbc_solve_call
    results = solver.solve(pyomo_model, options=solver_options.constructed)

to

    results = solver.solve(pyomo_model, options=solver_options.constructed, tee=True)

You should see a bunch of text starting with:

Welcome to the CBC MILP Solver 
Version: 2.10.10 
Build Date: Jun  7 2023 
...
camirmas commented 11 months ago

Bringing this back up as I've just encountered it too, should we pin the version to 2.10.8 until we figure this out? We know that version works

dguittet commented 11 months ago

@camirmas can you share the error output?