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
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 thesimulatemethod).There is a problem with units here:
We would ideally need to multiply by
dt_hrhere. The fix should be: