Rolling horizon and storage

421 views
Skip to first unread message

Luca Jansen

unread,
Oct 22, 2021, 9:11:08 AM10/22/21
to pypsa

Dear PyPSA team,

 

I would like to run a rolling horizon optimization, therefore I have to solve the issue with storages.

I am running a preceding simplified optimization for a year with weekly timesteps to determine the storage units' SOC, which I want to use as inputs for my weekly models.

 

I read in previous discussions in this list about how I can set the SOC at a certain time with storage_units_t.state_of_charge_set.

This, I would like to use to pass on SOCs from one weekly model to the next. However, for the beginning of week 1 and for the end of each week, I want to do something different:

 

In my network there are several storage units connected to 1 node and I would like to set the sum of those storage units' SOC at the beginning of the 1st week and end of each week to be equal to my previously determined SOC for that node from the annual run.

I wanted to do this through additional constraints implemented through extra_functionality.

 

Finally, my question: Do I understand correctly that I either need to set cyclic_state_of_charge to True; or I need to define the initial state of charge for each storage unit? Either one is not desirable for my purpose. Is there a way around it?

 

Thanks in advance for your help.

 

Best regards,

Luca

Fabian Neumann

unread,
Oct 22, 2021, 9:16:08 AM10/22/21
to py...@googlegroups.com
Hi Luca,

yes, I think so. Either cyclic or initial SOC must be given.

The way around would be to skip some constraints of these constraints
governing the "time borders" of storage units.

However, currently this is not easily possible with pyomo=False (we're
working on this in the linopy package). With pyomo=True, it is possible
to delete constraints after creation from the pyomo model.

Best wishes,

Fabian

On 22.10.21 15:11, 'Luca Jansen' via pypsa wrote:
> Dear PyPSA team,
>
> I would like to run a rolling horizon optimization, therefore I have to
> solve the issue with storages.
>
> I am running a preceding simplified optimization for a year with weekly
> timesteps to determine the storage units' SOC, which I want to use as
> inputs for my weekly models.
>
> I read in previous discussions in this list about how I can set the SOC
> at a certain time with storage_units_t.state_of_charge_set.
>
> This, I would like to use to pass on SOCs from one weekly model to the
> next. However, for the beginning of week 1 and for the end of each week,
> I want to do something different:
>
> In my network there are several storage units connected to 1 node and I
> would like to set the sum of those storage units' SOC at the beginning
> of the 1st week and end of each week to be equal to my previously
> determined SOC for that node from the annual run.
>
> I wanted to do this through additional constraints implemented through
> extra_functionality.
>
> Finally, my question: Do I understand correctly that I either need to
> set cyclic_state_of_charge to True; or I need to define the initial
> state of charge for _each_ storage unit? Either one is not desirable for
> my purpose. Is there a way around it?
>
> Thanks in advance for your help.
>
> Best regards,
>
> Luca
>
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/2aa455f3-a77f-460e-bb94-bdd7a5852db8n%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/2aa455f3-a77f-460e-bb94-bdd7a5852db8n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Matteo De Felice

unread,
Jan 14, 2022, 3:24:19 PM1/14/22
to pypsa
Dear Fabian,
does it mean that there isn't any 'official' implementation of the rolling horizon in PyPSA?
Cheers,

Fabian Neumann

unread,
Jan 17, 2022, 3:47:44 AM1/17/22
to Matteo De Felice, pypsa
Hi Matteo,

there's no frontend function like n.rolling_horizon_lopf() if that's
what you thought of.

But it's viable to do a rolling horizon optimisation in a loop around
n.lopf(snapshots).

There's an example in cell [9] of

https://pypsa.readthedocs.io/en/latest/examples/scigrid-lopf-then-pf.html

This example has no overlaps between snapshot groups, but I think it can
be adapted to have overlaps as well.

Best wishes,

Fabian N
> <https://groups.google.com/d/msgid/pypsa/2aa455f3-a77f-460e-bb94-bdd7a5852db8n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/pypsa/2aa455f3-a77f-460e-bb94-bdd7a5852db8n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "pypsa" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pypsa+un...@googlegroups.com
> <mailto:pypsa+un...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pypsa/849cacfa-39eb-4c2b-b1cf-bfc24a0791adn%40googlegroups.com
> <https://groups.google.com/d/msgid/pypsa/849cacfa-39eb-4c2b-b1cf-bfc24a0791adn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Dr.-Ing.
Fabian Neumann (he/him)
Postdoctoral Researcher

Department of Digital Transformation in Energy Systems
Institute of Energy Technology
Technische Universität Berlin

Group website: https://tub-ensys.github.io
Personal website: https://neumann.fyi

Zoom: https://tu-berlin.zoom.us/my/fneum
Schedule Meeting: https://calendly.com/fneum

Visitor Address:
Einsteinufer 25 (TA 8)
10587 Berlin

My working hours may not be your working hours. Do not feel pressure to
reply to this email outside your working hours.
Reply all
Reply to author
Forward
0 new messages