Skip to content

Commit 5f50bfb

Browse files
committed
include pwr_chg/dis_max_observed in result summary for CommoditySystem and MobileCommodity
1 parent ca2bc77 commit 5f50bfb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

revoletion/blocks.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ def __init__(self, name, scenario):
527527

528528
self.bus = self.bus_connected = self.inflow = self.outflow = None # initialization of oemof-solph components
529529

530+
self.pwr_chg_max_observed = self.pwr_dis_max_observed = None # placeholder
531+
530532
self.mode_dispatch = None
531533
# mode_dispatch can be 'apriori_unlimited', 'apriori_static', 'apriori_dynamic', 'opt_myopic', 'opt_global'
532534
self.get_dispatch_mode()
@@ -600,6 +602,8 @@ def calc_capex_init_existing(self):
600602

601603
def calc_energy(self):
602604

605+
self.calc_pwr_max_observed()
606+
603607
# Aggregate energy results for external charging for all MobileCommodities within the CommoditySystem
604608
for commodity in self.commodities.values():
605609
commodity.calc_results()
@@ -651,6 +655,13 @@ def calc_opex_sim(self):
651655
self.scenario.opex_dis_ext += self.opex_dis_ext
652656
self.scenario.opex_ann_ext += self.opex_ann_ext
653657

658+
def calc_pwr_max_observed(self):
659+
"""
660+
Calculate maximum power drawn by the system for external charging and discharging
661+
"""
662+
self.pwr_chg_max_observed = self.flow_in.max()
663+
self.pwr_dis_max_observed = self.flow_out.max()
664+
654665
def calc_revenue(self):
655666
for commodity in self.commodities.values():
656667
commodity.calc_revenue()
@@ -1496,6 +1507,7 @@ def __init__(self, name, parent):
14961507
self.bus = self.inflow = self.outflow = self.ess = None
14971508
self.bus_ext_ac = self.conv_ext_ac = self.src_ext_ac = None
14981509
self.bus_ext_dc = self.conv_ext_dc = self.src_ext_dc = None
1510+
self.pwr_chg_max_observed = self.pwr_dis_max_observed = None
14991511

15001512
self.invest = self.parent.invest
15011513
self.size = self.size_additional = 0
@@ -1637,6 +1649,9 @@ def calc_results(self):
16371649

16381650
self.flow = self.flow_in - self.flow_out # for plotting
16391651

1652+
self.pwr_chg_max_observed = self.flow_in.max()
1653+
self.pwr_dis_max_observed = self.flow_out.max()
1654+
16401655
def calc_revenue(self):
16411656

16421657
# rental time based revenue

0 commit comments

Comments
 (0)