-
Notifications
You must be signed in to change notification settings - Fork 126
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
Multi-period investment optmization: no investment in first period #1029
Comments
Ouch, that's quite bad, I have to admit. Thanks for pointing this out, @SabineHaas! I haven't come across this issue, yet, as I have been working with brownfield scenarios, mostly. I am pretty sure that it relates to the multi-period storage implementation and the definition of the 0th storage state, to be more precise, this code section. My idea here was to force storage levels to equal 0 until an investment happens. But what the rule effectively does is to prevent storage investments for the 0th (i.e. the very first TIMESTEP). I commented out the lines mentioned above and the optimization yielded results as you'd have expected them, i.e. no shortage is activated and investment results for both cases are identical. I haven't given it enough thought yet, but my gut feeling is that the respective rule might be safely removed. @nailend: Would you second that opinion of mine? |
I tried to wrap my head around, but I didn't really understand why this constraint doesn't work. But this is a direct consequence of #1030 isn't it? In multi-period, the distinction between TIMESTEPS and TIMEPOINTS don't exist? |
Yes, you are right. The two issues are interrelated and there only is the TIMESTEPS set for multi-period models.
As I see it, there would be three options:
I think option 3 is clearly preferrable. In that course, also the investment storage implementation in general should be revised, see #1030. |
In fact, the assumption that a newly installed storage is always empty is not valid in all cases. Think of rechargeable batteries: If receive them at 0 % capacity, they are probably broken. |
Thanks, @p-snft. You are totally right about this. I also thought about pumped storage which will probably come with some filling level initially. @nailend and @SabineHaas: Look what I found: #965 @nailend I also had some trouble with proper storage roundtrip conditions (there actually are none yet), but that was before your sophisticated lifetime tracking thing. It might be worth a shot tackling this as well - maybe in a dedicated issue/PR. |
Not sure, what's the better solution to be honest, but I prefer to set the initial content per component.
well I confirmed, haha
you mean roundtrips within a period? At the dev-meeting, we shared the common interest to somehow replace single-period with multi-period. For this to happen, there are a few things to be done before. I will open an issue, where we can collect the necessary changes/improvements. |
Describe the bug
Multi-period investment optimization does not solve as expected. There's no investment into wind and storage in the first period, while the expensive shortage is used to cover the demand. In the second period investment is done as expected into wind and storage, no shortage is used.
Checkout my small example: multi_period.txt
Energy system consists of: el-bus, wind source, el-demand, el-storage, excess, shortage
Also interesting: in the example I run the optimization twice:
--> the result is as described above:
--> result as I would expect it: in first and second period investment into wind and storage and no usage of shortage
To Reproduce
Rund the example code, multi_period.txt
Expected behavior
Investment into wind and storage also in the first period and avoidance of expensive shortage (as in case 2, wind profile = [0, 1, 0]).
Screenshots
Results:
Desktop (please complete the following information):
Linux Mint 20.3
Python version 3.9
oemof.solph version 0.5.2.dev0
@jokochems do you know this behaviour?
This might be interesting for you, @nailend
The text was updated successfully, but these errors were encountered: