Skip to content

[BUG] Heat-storage standing loss uses fixed exponent (1-p_loss)^(1/24) — wrong for non-hourly timesteps #697

Description

@joda9

Where

eDisGo_OPF.jl/src/core/constraint.jl, heat-storage inter-timestep balance:

JuMP.@constraint(pm.model, hse_2 - hse_1 * (1 - p_loss)^(1/24) == - time_elapsed*phs_2)

Problem

p_loss is a daily loss rate (edisgo/io/powermodels_io.py: p_loss = 0.04, # 4% of SOC per day). The exponent 1/24 converts it to a fixed one-hour decay, while the charging
term on the right-hand side scales with time_elapsed — the time handling is inconsistent
within one equation. For 15-min steps the storage loses 4× too much per step; for 4-h steps 4×
too little. Non-hourly resolutions are in real use.

Fix

Scale the decay with the actual step length:

(1 - p_loss)^(time_elapsed/24)

(Interacts with the time_elapsed computation bug on the Python side — see #693;
both need fixing for sub-hourly runs to be correct.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: opfOptimal power flow / Julia side (eDisGo_OPF.jl, powermodels_io)bugcorrectnessSilently produces wrong numeric results (no crash) — high-value to fixgood first issueWell-scoped, low-risk — suitable for newcomers / student assistantspriority: medium

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions