Skip to content

StoragePerformanceBase needs to account for arbitrary dt #738

@vijay092

Description

@vijay092

While discussing my PR's handling of arbitrary dt with @jaredthomas68 yesterday, we noticed the solver was failing due to an out-of-bounds initial SoC condition. When I investigated it further today, I found bugs in StoragePerformanceBase (specifically, in the simulate method).

# current (this will be wrong for non-hourly dt)
soc += actual_charge / storage_capacity 
soc -= actual_discharge / storage_capacity   # same problem

There is a problem with units here:

# actual_charge is kW, storage_capacity is kWh
# kW / kWh = 1/h   <--- not dimensionless, not a SOC fraction

We would ideally need to multiply by dt_hr here. The fix should be:

soc += actual_charge  * self.dt_hr / storage_capacity
soc -= actual_discharge * self.dt_hr / storage_capacity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions