Skip to content

Commit

Permalink
adjust DiscreteTapControl.py: change vm_set_pu to property
Browse files Browse the repository at this point in the history
  • Loading branch information
rbolgaryn committed May 20, 2021
1 parent 09e42c3 commit 67e25d2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pandapower/control/controller/trafo/DiscreteTapControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ def from_tap_step_percent(cls, net, tid, vm_set_pu, side="lv", trafotype="2W", t
**vm_set_pu** (float) - Voltage setpoint in pu
"""
return cls(net, tid=tid, vm_lower_pu=None, vm_upper_pu=None, side=side, trafotype=trafotype, tol=tol,
self = cls(net, tid=tid, vm_lower_pu=None, vm_upper_pu=None, side=side, trafotype=trafotype, tol=tol,
in_service=in_service, order=order, drop_same_existing_ctrl=drop_same_existing_ctrl,
matching_params=matching_params, vm_set_pu=vm_set_pu, **kwargs)
self.vm_delta_pu = net[self.trafotable].at[tid, "tap_step_percent"] / 100. * .5 + self.tol
return self

@property
def vm_set_pu(self):
Expand All @@ -77,9 +79,8 @@ def vm_set_pu(self, value):
self._vm_set_pu = value
if value is None:
return
vm_delta_pu = net[self.trafotable].at[tid, "tap_step_percent"] / 100. * .5 + self.tol
self.vm_lower_pu = value - vm_delta_pu
self.vm_upper_pu = value + vm_delta_pu
self.vm_lower_pu = value - self.vm_delta_pu
self.vm_upper_pu = value + self.vm_delta_pu

def control_step(self, net):
"""
Expand Down

0 comments on commit 67e25d2

Please sign in to comment.