Skip to content

e_initial is clipped to e_max/min_pu at the first snapshot of calculation - #883

Merged
lenzim97 merged 5 commits into
devfrom
fixes/#846_adjust_e_initial_of_e_mob_storages
Nov 5, 2026
Merged

lenzim97 merged 5 commits into
devfrom
fixes/#846_adjust_e_initial_of_e_mob_storages

Conversation

@lenzim97

Copy link
Copy Markdown
Contributor

Clip e_initial of e-mobility stores to their SoC band

Fixes #846

Problem

e_initial of the battery_storage stores refers to 1 January 00:00, but it was used for every start snapshot and every rolling horizon window. At other snapshots it is often outside the SoC band, which leads to infeasibilities in highly resolved networks or requires (negative) load shedding.

Changes

  • New function adjust_e_initial_emob() in tools/utilities.py: clips e_initial of all battery_storage stores to [e_min_pu, e_max_pu] * e_nom at the first snapshot of the optimization.
  • The function is called before lopf/grid optimization, the pre-market model, sclopf and every rolling horizon window.
  • Rolling horizon: from the second window on, battery_storage stores take e_initial from the result of the previous window, like the other non-seasonal stores.
  • Removed the previous fix in disaggregate/temporal.py, which only clipped e_initial to e_max at the first snapshot of the temporal disaggregation. This is now covered by the rolling horizon.

Testing

Run with eGon2035, snapshots 240–408, 30 AC clusters, market optimization with rolling horizon (168/120) and grid optimization, linopy:

  • e_initial is within the SoC band in the pre-market model, the market model and the grid optimization.
  • No jumps of the state of charge at the rolling horizon boundaries.

Not tested with an higher resoluted grid

Comment thread etrago/execute/__init__.py Resolved
Comment thread etrago/tools/utilities.py Resolved
@lenzim97 lenzim97 changed the title e_initial is clipped to e_max/min_pu at the first snapshot of calcula… e_initial is clipped to e_max/min_pu at the first snapshot of calculation Oct 15, 2026
@ClaraBuettner

Copy link
Copy Markdown
Contributor

Should I check sth. in particular?
And did you already run calculations with these changes?

I'm just trying to find out what the best way is to review it :)

@lenzim97

lenzim97 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Should I check sth. in particular? And did you already run calculations with these changes?

I'm just trying to find out what the best way is to review it :)

Yes i run a test with 100 snapshots (market optimization 24/12) locally and the e_initial values fits now to the SoC band for all stores in all stages of the optimization. So from my side it would be fine just checking the code if there seems something strange.

@lenzim97
lenzim97 merged commit a28ef9e into dev Nov 5, 2026
6 checks passed
@lenzim97
lenzim97 deleted the fixes/#846_adjust_e_initial_of_e_mob_storages branch November 5, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flexible charging sometimes needs negative load shedding

2 participants