Hello Aidan here
I have an energy system designed using oemof solph and it can be optimized successfully and I have no problem extracting most of the results besides the dual variables. My code runs completely without errors if I comment out the ‘model.recieve_duals()’, but when I include this line, I get the following error when I run ‘processing.results(model)’:
File "C:\Optimisation.py", line 858, in <module>
main(input_file)
File "C:\Optimisation.py", line 827, in main
energysystem.results = processing.results(model)
File "c:\Users\ahbil\energyCoding\june\juneEnv\lib\site-packages\oemof\solph\processing.py", line 279, in results
duals = [
File "c:\Users\ahbil\energyCoding\june\juneEnv\lib\site-packages\oemof\solph\processing.py", line 280, in <listcomp>
model.dual[model.BusBlock.balance[bus, p, t]]
File "c:\Users\ahbil\energyCoding\june\juneEnv\lib\site-packages\pyomo\common\collections\component_map.py", line 102, in __getitem__
raise KeyError(f"{obj} (key={_id})") from None
KeyError: 'BusBlock.balance[bus_electricity-env_None,0,0] (key=BusBlock.balance[bus_electricity-env_None,0,0])'
Thank you for any advice!
Side note: the dual_variables.py example runs on my environment
Aidan