Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions peakshaving_analyzer/PSA.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def add_additional_pv(self):
)

def add_storage(self):
if self.config.max_inverter_charge:
max_cap = pd.Series([self.config.max_inverter_charge, 0], index=["consumption_site", "grid"])
else:
max_cap = None
self.esm.add(
fn.Conversion(
esM=self.esm,
Expand All @@ -151,7 +155,7 @@ def add_storage(self):
"stored_energy": self.config.inverter_efficiency,
},
hasCapacityVariable=True,
capacityMax=pd.Series([self.config.max_inverter_charge, 0], index=["consumption_site", "grid"]),
capacityMax=max_cap,
investPerCapacity=0,
linkedConversionCapacityID="storage",
interestRate=self.config.interest_rate / 100,
Expand Down Expand Up @@ -183,14 +187,18 @@ def add_storage(self):
)
)

if self.config.max_inverter_discharge:
max_cap = pd.Series([self.config.max_inverter_discharge, 0], index=["consumption_site", "grid"])
else:
max_cap = None
self.esm.add(
fn.Conversion(
esM=self.esm,
name="from_storage",
physicalUnit="kWh",
commodityConversionFactors={"stored_energy": -1, "energy": 1},
hasCapacityVariable=True,
capacityMax=pd.Series([self.config.max_inverter_discharge, 0], index=["consumption_site", "grid"]),
capacityMax=max_cap,
investPerCapacity=self.config.inverter_cost_per_kw,
economicLifetime=self.config.inverter_lifetime,
technicalLifetime=self.config.inverter_lifetime,
Expand Down
2 changes: 1 addition & 1 deletion peakshaving_analyzer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"""

__all__ = ["PeakShavingAnalyzer", "Config", "Results", "load_yaml_config", "load_oeds_config", "create_default_yaml"]
__version__ = "0.1.9"
__version__ = "0.1.10"
2 changes: 2 additions & 0 deletions peakshaving_analyzer/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Config(IOHandler):
inverter_efficiency: float = 0.95
inverter_cost_per_kw: float = 180
inverter_lifetime: int = 15
max_inverter_charge: float | None = None
max_inverter_discharge: float | None = None

# Existing PV system parameters
pv_system_already_exists: bool = False
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "peakshaving-analyzer"
version = "0.1.9"
version = "0.1.10"
description = "Peak shaving analysis for industrial load profiles"
authors = [
{ name = "Christoph Komanns", email = "[email protected]" },
Expand Down