New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage_invest example does not work for a fixed storage #27

Closed
uvchik opened this Issue Dec 9, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@uvchik
Copy link
Member

uvchik commented Dec 9, 2015

If you switch the investment option to False the example raises an error.

- transformer.Storage.optimization_options.update({'investment': True})
+ transformer.Storage.optimization_options.update({'investment': False})

storage = transformer.Storage(uid='sto_simple',
                              inputs=[bel],
                              outputs=[bel],
                              eta_in=1,
                              eta_out=0.8,
                              cap_loss=0.00,
                              opex_fix=35,
                              opex_var=10e10,
                              capex=1000,
-                             cap_max=0,
+                             cap_max=1000,
                              cap_initial=0,
                              c_rate_in=1/6,
                              c_rate_out=1/6)
Traceback (most recent call last):
  File "/home/uwe/rli-lokal/git_home/oemof_base/examples/storage_optimization/storage_invest.py", line 155, in <module>
    energysystem.optimize()
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/core/energy_system.py", line 89, in optimize
    self.optimization_model = OM(energysystem=self)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 114, in __init__
    assembler.registry[cls](e=None, om=self, block=block)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 551, in _
    om.default_assembler(block)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 162, in default_assembler
    block.optimization_options[option](self, block)
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/optimization_model.py", line 532, in linear_constraints
    var.set_bounds(om, block, side='output')
  File "/home/uwe/rli-lokal/git_home/oemof_base/oemof/solph/variables.py", line 144, in set_bounds
    model.w[e1, e2, t].setub(out_max[e1][0])
TypeError: 'NoneType' object is not subscriptable

@uvchik uvchik added the bug label Dec 9, 2015

@uvchik uvchik added this to the December 2015 release milestone Dec 9, 2015

@uvchik uvchik added the urgent label Dec 9, 2015

@simnh

This comment has been minimized.

Copy link
Member

simnh commented Dec 9, 2015

I think you will need to set out_max, and in_max as list (the max. power for charging and discharging)
usually i should be calculated automatically, if not set in the init of transformers.Storage() class.
for you:

out_max = [1/6*1000]
in_max = [1/6*1000]
@simnh

This comment has been minimized.

Copy link
Member

simnh commented Dec 9, 2015

I fixed it in the dev branch.

@simnh simnh closed this Dec 9, 2015

@uvchik

This comment has been minimized.

Copy link
Member Author

uvchik commented Dec 9, 2015

That's smart. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment