Skip to content

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

Open
lenzim97 wants to merge 3 commits into
devfrom
fixes/#846_adjust_e_initial_of_e_mob_storages
Open

lenzim97 wants to merge 3 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 Outdated

x = time.time()

adjust_e_initial_emob(etrago.network)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is called in that many functions, is it really needed like this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transfered into adjust_network() now

Comment thread etrago/tools/utilities.py Outdated
)


def adjust_e_initial_emob(network, snapshot=None):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checks with black are failing in this file. Could you run black again?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just applied for the files i changed

@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
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