Daniel Varga commited on
Commit
fc67e21
1 Parent(s): 200f45c

removing demand charge

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. main.py +13 -1
app.py CHANGED
@@ -55,7 +55,10 @@ def ui_refresh(solar_cell_num, bess_nominal_capacity, fixed_consumption):
55
 
56
  supplier = Supplier(price=70) # HUF/kWh
57
  supplier.set_price_for_daily_interval_on_workdays(start=6, end=22, price=100)
58
- supplier.set_demand_charge(peak_demand=100, surcharge_per_kw=1000)
 
 
 
59
  fee = supplier.fee(results["consumption_from_network"])
60
  html += f"<tr><td>{fee/1e6:.3f} million HUF billed by energy supplier</td></tr>\n"
61
 
 
55
 
56
  supplier = Supplier(price=70) # HUF/kWh
57
  supplier.set_price_for_daily_interval_on_workdays(start=6, end=22, price=100)
58
+
59
+ # not realistic, just for testing the effect
60
+ # supplier.set_demand_charge(peak_demand=100, surcharge_per_kw=1000)
61
+
62
  fee = supplier.fee(results["consumption_from_network"])
63
  html += f"<tr><td>{fee/1e6:.3f} million HUF billed by energy supplier</td></tr>\n"
64
 
main.py CHANGED
@@ -22,9 +22,21 @@ def main():
22
  all_2021_data = interpolate_and_join(met_2021_data, cons_2021_data)
23
 
24
  results = simulator_with_solar(all_2021_data, parameters)
25
- consumption_from_network = results["consumption_from_network"]
26
  supplier = Supplier(price=70) # HUF/kWh
27
  supplier.set_price_for_daily_interval_on_workdays(start=6, end=22, price=100)
 
 
 
 
 
 
 
 
 
 
 
 
28
  print("Energy supplier charges", int(supplier.fee(consumption_from_network)), "HUF between", results.index[0], "and", results.index[-1])
29
  return
30
 
 
22
  all_2021_data = interpolate_and_join(met_2021_data, cons_2021_data)
23
 
24
  results = simulator_with_solar(all_2021_data, parameters)
25
+
26
  supplier = Supplier(price=70) # HUF/kWh
27
  supplier.set_price_for_daily_interval_on_workdays(start=6, end=22, price=100)
28
+
29
+ for month in range(1, 13):
30
+ start = f"2021-{month:02}-01"
31
+ end = f"2021-{month+1:02}-01"
32
+ if month == 12:
33
+ end = "2022-01-01"
34
+ results_in_month = results[(results.index >= start) & (results.index < end)]
35
+ consumption_from_network = results_in_month["consumption_from_network"]
36
+ print("Energy supplier charges", int(supplier.fee(consumption_from_network)), "HUF in", start[:-3])
37
+
38
+
39
+ consumption_from_network = results["consumption_from_network"]
40
  print("Energy supplier charges", int(supplier.fee(consumption_from_network)), "HUF between", results.index[0], "and", results.index[-1])
41
  return
42