add monthly plots code

This commit is contained in:
Hanzhang Ma 2024-05-10 17:29:08 +02:00
parent 32e8e59c82
commit a330946f71
3 changed files with 278 additions and 473 deletions

View File

@ -39,7 +39,8 @@ class EnergySystem:
time = row['time']
sunlight_intensity = row['sunlight']
factory_demand = row['demand']
electricity_price = row['price']
electricity_price = row['buy']
sell_price = row['sell']
# electricity_price = self.grid.get_price_for_time(time)
if time == '00:00':
@ -66,7 +67,7 @@ class EnergySystem:
# 如果还有电量盈余,且pv功率大于ess的充电功率+工厂的需求功率则准备卖电
if surplus_after_ess > 0 and generated_pv_power > self.ess.charge_power + factory_demand:
sold_to_grid = surplus_after_ess
sell_income = sold_to_grid * self.grid.sell_price
sell_income = sold_to_grid * sell_price
total_benefit += sell_income
# 节省的能量 = 工厂需求的能量 * 时间段
# total_energy = factory_demand * time_interval

View File

@ -15,7 +15,7 @@ class ess_config:
self.cost_per_kW = cost_per_kW
self.lifetime = lifetime
self.loss = loss
self.storage = 100
self.storage = 0
self.charge_power = charge_power
self.discharge_power = discharge_power
def get_cost(self):

File diff suppressed because one or more lines are too long