OSeMOSYS / OSeMOSYS_GNU_MathProg

The GNU MathProg implementation of OSeMOSYS
Apache License 2.0
9 stars 14 forks source link

Constrain storage balance #51

Open FraGard opened 4 years ago

FraGard commented 4 years ago

It has happened in a few cases that some storage was charged one year and discharged the years after. This because storage losses as a function of time are not introduced (it would be nonlinear) and because nothing else prevents very long term storage, be it by a battery, a dam or anything else. In this version of OSeMOSYS, I'd suggest to introduce constraints to avoid such behaviour, e.g. (some suggested by @tniet before, as well):

s.t. SCX_WeeklyBalance{r in REGION, s in STORAGE, ls in SEASON, y in YEAR: StorageTag[r,s] = 2}: sum{ld in DAYTYPE, lh in DAILYTIMEBRACKET}NetChargeWithinDay[r,s,ls,ld,lh,y]*DaysInDayType[ls,ld,y] = 0;
s.t. SCX_YearlyBalance{r in REGION, s in STORAGE, y in YEAR: StorageTag[r,s] =1}: sum{ls in SEASON, ld in DAYTYPE, lh in DAILYTIMEBRACKET} NetChargeWithinYear[r,s,ls,ld,lh,y] = 0;
s.t. SCX_PeriodBalance{s in STORAGE, r in REGION}: sum{y in YEAR, l in TIMESLICE, ls in SEASON, ld in DAYTYPE, lh in DAILYTIMEBRACKET} NetChargeWithinYear[r,s,ls,ld,lh,y] = 0;
tniet commented 4 years ago

@FraGard - This is a potentially challenging issue. As I found in [1], assuming refilling of storage and/or different storage operating strategies/models impacts the results from the model. So, implementing a weekly balance requirement would likely significantly change the way storage works. And, how does one deal with the ends/beginnings of weeks? Does every week have to start and end at the same level of storage? The constraints you propose (and I may have discussed in the past) might be sensible for certain storage cases, but definitely not all. I would not be in favour of adding these in the base storage equations in OSeMOSYS, but could be noted somewhere as options for investigating storage operation under different assumptions.

[1] T. Niet, “Storage end effects: An evaluation of common storage modelling assumptions,” Journal of Energy Storage, vol. 27, p. 101050, Feb. 2020, doi: 10.1016/j.est.2019.101050.

FraGard commented 4 years ago

@tniet , I see your points and they are valid. Do you think there is any other way of dealing with the problem of multi-year storage cycles in this version of OSeMOSYS? It seems to me it may invalidate results of models with storage

tniet commented 4 years ago

@FraGard - Great question. Storage is complicated. I don't think there is a one size fits all solution for how to model storage - it depends on what specific question(s) you are asking. Once you understand the question(s) and the implications of different ways of modelling storage you can choose which assumptions are reasonable. The more I work with storage modelling the more skeptical I am becoming about any work that uses storage but does not include a detailed and careful description of their storage assumptions/model structure, and ideally an investigation into how those assumptions impact their results...

So I don't think we can (maybe ever) say we have 'solved' the multi-year storage cycles issue. We can highlight that there are challenges with modelling storage in different ways, and give examples of different constraints that may allow one to model storage more (or less) effectively, depending on the question being asked.

One thing that might help would be to clearly define what type(s) of storage the base OSeMOSYS model wants to be able to represent. For my work with large hydro, multi-year storage is definitely feasible (at least in British Columbia), so the existing equations are acceptable for that work...

FraGard commented 3 years ago

Thanks @tniet, that makes sense. We could decide 1) what types of storage the base model can represent and how well (e.g. hydro good, electricity-battery so-and-so for the following reasons...) and also 2) make sure that all alternative storage formulations are properly stored on the GitHub with description of where they are applicable. I could add there the equations and a description in the same

tniet commented 3 years ago

Hey @FraGard - Yes, but it will take quite a bit of work to clearly define that, and the caveats would be lengthy. Even defining 'good' for a model of hydro isn't entirely clear... I have lots of questions, but unfortunately few good answers...

Kimsley97 commented 1 year ago

hello all , im Kimsley i dont mean to be forward but i find myself in a predicament where i have modelled storage on osemosys the model does run properly but storage or rather my battery does not seem to be giving me any results , may i get assistance with this .. ive attached the txt file and model below thanks in advance ATC_JHB_JHB_Kim_17_04_23_Rev[a03].txt osemosys_code_cloud.txt