Skip to content

Commit

Permalink
Fix bug related to export slot timing on AC Coupled mode (#1707)
Browse files Browse the repository at this point in the history
* Fix bug related to export slot timing on AC Coupled mode

#1704

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
springfall2008 and pre-commit-ci-lite[bot] authored Dec 8, 2024
1 parent 8d60e9f commit 9f3223c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/predbat/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def run_prediction(self, charge_limit, charge_window, export_window, export_limi
pv_dc = 0
diff = get_diff(0, pv_dc, pv_ac, load_yesterday, inverter_loss)

required_for_load = load_yesterday / inverter_loss_ac
required_for_load = load_yesterday / inverter_loss
if inverter_hybrid:
potential_to_charge = pv_now
else:
Expand Down
3 changes: 3 additions & 0 deletions apps/predbat/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2906,6 +2906,9 @@ def run_model_tests(my_predbat):
failed |= simple_scenario("load_only", my_predbat, 1, 0, assert_final_metric=import_rate * 24, assert_final_soc=0, with_battery=False)
failed |= simple_scenario("load_bat_ac", my_predbat, 4, 0, assert_final_metric=import_rate * 24 * 3.2, assert_final_soc=100 - 24, with_battery=True, battery_soc=100.0, inverter_loss=0.8)
failed |= simple_scenario("load_bat_dc", my_predbat, 4, 0, assert_final_metric=import_rate * 24 * 3.2, assert_final_soc=100 - 24, with_battery=True, battery_soc=100.0, inverter_loss=0.8, hybrid=True)
failed |= simple_scenario("load_bat_ac2", my_predbat, 0.5, 0, assert_final_metric=0, assert_final_soc=100 - 12 / 0.8, with_battery=True, battery_soc=100.0, inverter_loss=0.8)
failed |= simple_scenario("load_bat_dc2", my_predbat, 0.5, 0, assert_final_metric=0, assert_final_soc=100 - 12 / 0.8, with_battery=True, battery_soc=100.0, inverter_loss=0.8, hybrid=True)

failed |= simple_scenario(
"load_bat_dc_pv",
my_predbat,
Expand Down

0 comments on commit 9f3223c

Please sign in to comment.