Skip to content
Merged
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
14 changes: 14 additions & 0 deletions CaseStudy.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def scale_CaseStudy(self):
if hasattr(self, "dPower_Inflows") and self.dPower_Inflows is not None:
self.scale_dPower_Inflows()

if hasattr(self, "dPower_VRESProfiles") and self.dPower_VRESProfiles is not None:
self.scale_dPower_VRESProfiles()

if self.dPower_Parameters["pEnableVRES"]:
self.scale_dPower_VRES()

Expand Down Expand Up @@ -269,8 +272,19 @@ def scale_dPower_ThermalGen(self):
self.dPower_ThermalGen['Qmax'] = self.dPower_ThermalGen['Qmax'].fillna(0) * self.reactive_power_scaling_factor

def scale_dPower_Inflows(self):
# Allow only positive capacity factors
if (self.dPower_Inflows["value"] < 0).any():
negative_values = self.dPower_Inflows[self.dPower_Inflows["value"] < 0]
raise ValueError(f"Inflows contains negative values:\n{negative_values}")

self.dPower_Inflows["value"] *= self.power_scaling_factor

def scale_dPower_VRESProfiles(self):
# Allow only positive capacity factors
if (self.dPower_VRESProfiles["Capacity"] < 0).any():
negative_values = self.dPower_VRESProfiles[self.dPower_VRESProfiles["Capacity"] < 0]
raise ValueError(f"VRES_Profiles contains negative values:\n{negative_values}")

def scale_dPower_VRES(self):
if "MinProd" not in self.dPower_VRES.columns:
self.dPower_VRES['MinProd'] = 0
Expand Down
Loading