Skip to content

Commit

Permalink
capacitors and cap controllers set with correct thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
nadiavp committed Sep 14, 2023
1 parent 1e9dac2 commit b13ba4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ditto/readers/synergi/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@ def parse(self, model):
# Maps control modes from Synergi format to DiTTo format
# TODO: Complete the mapping with other control modes
#
control_mode_mapping = {"VOLTS": "voltage"}
control_mode_mapping = {"VOLTS": "voltage", "AMPS": "currentflow"}

# Set the nominal voltage
# Convert from KV to Volts since DiTTo is in volts
Expand Down
9 changes: 7 additions & 2 deletions ditto/writers/opendss/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -2740,6 +2740,9 @@ def write_capacitors(self, model):

# Create CapControl
if create_capcontrol:
# set all controllers to start at off unless ONSetting is met
txt += " states=0"

txt += "\n\nNew CapControl.{name} Capacitor={name}".format(
name=i.name
)
Expand All @@ -2763,11 +2766,13 @@ def write_capacitors(self, model):

# Low (CONTROL)
if hasattr(i, "low") and i.low is not None:
txt += " Vmin={vmin}".format(vmin=i.low)
#txt += " Vmin={vmin}".format(vmin=i.low) # this would be an emergency setting
txt += f" OFFSetting={i.low}"

# high (CONTROL)
if hasattr(i, "high") and i.high is not None:
txt += " Vmax={vmax}".format(vmax=i.high)
#txt += " Vmax={vmax}".format(vmax=i.high) # this would be an emergency setting
txt += f" ONSetting={i.high}"

# Pt ratio (CONTROL)
if hasattr(i, "pt_ratio") and i.pt_ratio is not None:
Expand Down

0 comments on commit b13ba4d

Please sign in to comment.