1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 from CIM14
.IEC61970
.Core
.PowerSystemResource
import PowerSystemResource
23 class TapChanger(PowerSystemResource
):
24 """Mechanism for changing transformer winding tap positions.
27 def __init__(self
, stepVoltageIncrement
=0.0, normalStep
=0, neutralStep
=0, subsequentDelay
=0.0, regulationStatus
=False, ltcFlag
=False, highStep
=0, initialDelay
=0.0, lowStep
=0, neutralU
=0.0, SvTapStep
=None, ImpedanceVariationCurve
=None, TapSchedules
=None, RegulatingControl
=None, *args
, **kw_args
):
28 """Initialises a new 'TapChanger' instance.
30 @param stepVoltageIncrement: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step.
31 @param normalStep: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting.
32 @param neutralStep: The neutral tap step position for this winding.
33 @param subsequentDelay: For an LTC, the delay for subsequent tap changer operation (second and later step changes)
34 @param regulationStatus: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating.
35 @param ltcFlag: Specifies whether or not a TapChanger has load tap changing capabilities.
36 @param highStep: Highest possible tap step position, advance from neutral
37 @param initialDelay: For an LTC, the delay for initial tap changer operation (first step change)
38 @param lowStep: Lowest possible tap step position, retard from neutral
39 @param neutralU: Voltage at which the winding operates at the neutral tap setting.
40 @param SvTapStep: The tap step state associated with the tap changer.
41 @param ImpedanceVariationCurve: A TapChanger can have an associated ImpedanceVariationCurve to define impedance variations with tap step changes.
42 @param TapSchedules: A TapChanger can have TapSchedules.
43 @param RegulatingControl:
45 #: Tap step increment, in per cent of nominal voltage, per step position. For a symmetrical PhaseTapChanger, the stepVoltageIncrement is used in the formula for calculation of the phase angle. For a symmetrical PhaseTapChanger, the voltage magnitude does not change with tap step.
46 self
.stepVoltageIncrement
= stepVoltageIncrement
48 #: The tap step position used in 'normal' network operation for this winding. For a 'Fixed' tap changer indicates the current physical tap setting.
49 self
.normalStep
= normalStep
51 #: The neutral tap step position for this winding.
52 self
.neutralStep
= neutralStep
54 #: For an LTC, the delay for subsequent tap changer operation (second and later step changes)
55 self
.subsequentDelay
= subsequentDelay
57 #: Specifies the default regulation status of the TapChanger. True is regulating. False is not regulating.
58 self
.regulationStatus
= regulationStatus
60 #: Specifies whether or not a TapChanger has load tap changing capabilities.
61 self
.ltcFlag
= ltcFlag
63 #: Highest possible tap step position, advance from neutral
64 self
.highStep
= highStep
66 #: For an LTC, the delay for initial tap changer operation (first step change)
67 self
.initialDelay
= initialDelay
69 #: Lowest possible tap step position, retard from neutral
70 self
.lowStep
= lowStep
72 #: Voltage at which the winding operates at the neutral tap setting.
73 self
.neutralU
= neutralU
75 self
._SvTapStep
= None
76 self
.SvTapStep
= SvTapStep
78 self
._ImpedanceVariationCurve
= None
79 self
.ImpedanceVariationCurve
= ImpedanceVariationCurve
81 self
._TapSchedules
= []
82 self
.TapSchedules
= [] if TapSchedules
is None else TapSchedules
84 self
._RegulatingControl
= None
85 self
.RegulatingControl
= RegulatingControl
87 super(TapChanger
, self
).__init
__(*args
, **kw_args
)
89 _attrs
= ["stepVoltageIncrement", "normalStep", "neutralStep", "subsequentDelay", "regulationStatus", "ltcFlag", "highStep", "initialDelay", "lowStep", "neutralU"]
90 _attr_types
= {"stepVoltageIncrement": float, "normalStep": int, "neutralStep": int, "subsequentDelay": float, "regulationStatus": bool, "ltcFlag": bool, "highStep": int, "initialDelay": float, "lowStep": int, "neutralU": float}
91 _defaults
= {"stepVoltageIncrement": 0.0, "normalStep": 0, "neutralStep": 0, "subsequentDelay": 0.0, "regulationStatus": False, "ltcFlag": False, "highStep": 0, "initialDelay": 0.0, "lowStep": 0, "neutralU": 0.0}
93 _refs
= ["SvTapStep", "ImpedanceVariationCurve", "TapSchedules", "RegulatingControl"]
94 _many_refs
= ["TapSchedules"]
96 def getSvTapStep(self
):
97 """The tap step state associated with the tap changer.
99 return self
._SvTapStep
101 def setSvTapStep(self
, value
):
102 if self
._SvTapStep
is not None:
103 self
._SvTapStep
._TapChanger
= None
105 self
._SvTapStep
= value
106 if self
._SvTapStep
is not None:
107 self
._SvTapStep
.TapChanger
= None
108 self
._SvTapStep
._TapChanger
= self
110 SvTapStep
= property(getSvTapStep
, setSvTapStep
)
112 def getImpedanceVariationCurve(self
):
113 """A TapChanger can have an associated ImpedanceVariationCurve to define impedance variations with tap step changes.
115 return self
._ImpedanceVariationCurve
117 def setImpedanceVariationCurve(self
, value
):
118 if self
._ImpedanceVariationCurve
is not None:
119 self
._ImpedanceVariationCurve
._TapChanger
= None
121 self
._ImpedanceVariationCurve
= value
122 if self
._ImpedanceVariationCurve
is not None:
123 self
._ImpedanceVariationCurve
.TapChanger
= None
124 self
._ImpedanceVariationCurve
._TapChanger
= self
126 ImpedanceVariationCurve
= property(getImpedanceVariationCurve
, setImpedanceVariationCurve
)
128 def getTapSchedules(self
):
129 """A TapChanger can have TapSchedules.
131 return self
._TapSchedules
133 def setTapSchedules(self
, value
):
134 for x
in self
._TapSchedules
:
138 self
._TapSchedules
= value
140 TapSchedules
= property(getTapSchedules
, setTapSchedules
)
142 def addTapSchedules(self
, *TapSchedules
):
143 for obj
in TapSchedules
:
144 obj
.TapChanger
= self
146 def removeTapSchedules(self
, *TapSchedules
):
147 for obj
in TapSchedules
:
148 obj
.TapChanger
= None
150 def getRegulatingControl(self
):
152 return self
._RegulatingControl
154 def setRegulatingControl(self
, value
):
155 if self
._RegulatingControl
is not None:
156 filtered
= [x
for x
in self
.RegulatingControl
.TapChanger
if x
!= self
]
157 self
._RegulatingControl
._TapChanger
= filtered
159 self
._RegulatingControl
= value
160 if self
._RegulatingControl
is not None:
161 if self
not in self
._RegulatingControl
._TapChanger
:
162 self
._RegulatingControl
._TapChanger
.append(self
)
164 RegulatingControl
= property(getRegulatingControl
, setRegulatingControl
)