Update README.rst
[PyCIM.git] / CIM14 / ENTSOE / Equipment / Wires / SynchronousMachine.py
blob4500c1ba050ff2fefc4a1eba912e9e8cec7d2ebd
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
19 # IN THE SOFTWARE.
21 from CIM14.ENTSOE.Equipment.Wires.RegulatingCondEq import RegulatingCondEq
23 class SynchronousMachine(RegulatingCondEq):
24 """An electromechanical device that operates synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump.- [R7.2] and [R9.3] are satisfied by navigation to ConnectivityNode and Substation. - If a SynchronousMachine is not associated with a ReactiveCapabilityCurve, then the minQ and maxQ attributes will be used. - If a ReactiveCapabilityCurve is supplied, then the minQ and maxQ attributes are not required. - If a synchronous condenser is being modeled so that there is no capability for real power output, the SynchronousMachine is not required to be associated with a GeneratingUnit. In this case, the type and operatingMode attributes must both be set to “condenser”. - Attributes qPercent, r, r0, r2, x, x0, x2, ratedS and referencePriority are not required. SynchronousMachine.GeneratingUnit is required for this profile - need to change UML to reflect this.
25 """
27 def __init__(self, x0=0.0, qPercent=0.0, x2=0.0, r=0.0, referencePriority=0, operatingMode="condenser", r0=0.0, type="condenser", r2=0.0, maxQ=0.0, x=0.0, ratedS=0.0, minQ=0.0, InitialReactiveCapabilityCurve=None, HydroPump=None, GeneratingUnit=None, *args, **kw_args):
28 """Initialises a new 'SynchronousMachine' instance.
30 @param x0: Zero sequence reactance of the synchronous machine.
31 @param qPercent: Percent of the coordinated reactive control that comes from this machine.
32 @param x2: Negative sequence reactance.
33 @param r: Positive sequence resistance of the synchronous machine.
34 @param referencePriority: Priority of unit for reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on.
35 @param operatingMode: Current mode of operation. Values are: "condenser", "generator"
36 @param r0: Zero sequence resistance of the synchronous machine.
37 @param type: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator"
38 @param r2: Negative sequence resistance.
39 @param maxQ: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
40 @param x: Positive sequence reactance of the synchronous machine.
41 @param ratedS: Nameplate apparent power rating for the unit
42 @param minQ: Minimum reactive power limit for the unit.
43 @param InitialReactiveCapabilityCurve: The default ReactiveCapabilityCurve for use by a SynchronousMachine
44 @param HydroPump: The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating.
45 @param GeneratingUnit: A synchronous machine may operate as a generator and as such becomes a member of a generating unitFor the 2010 ENTSOE IOP, this is required for Synchronous Machine.
46 """
47 #: Zero sequence reactance of the synchronous machine.
48 self.x0 = x0
50 #: Percent of the coordinated reactive control that comes from this machine.
51 self.qPercent = qPercent
53 #: Negative sequence reactance.
54 self.x2 = x2
56 #: Positive sequence resistance of the synchronous machine.
57 self.r = r
59 #: Priority of unit for reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on.
60 self.referencePriority = referencePriority
62 #: Current mode of operation. Values are: "condenser", "generator"
63 self.operatingMode = operatingMode
65 #: Zero sequence resistance of the synchronous machine.
66 self.r0 = r0
68 #: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator"
69 self.type = type
71 #: Negative sequence resistance.
72 self.r2 = r2
74 #: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
75 self.maxQ = maxQ
77 #: Positive sequence reactance of the synchronous machine.
78 self.x = x
80 #: Nameplate apparent power rating for the unit
81 self.ratedS = ratedS
83 #: Minimum reactive power limit for the unit.
84 self.minQ = minQ
86 self._InitialReactiveCapabilityCurve = None
87 self.InitialReactiveCapabilityCurve = InitialReactiveCapabilityCurve
89 self._HydroPump = None
90 self.HydroPump = HydroPump
92 self._GeneratingUnit = None
93 self.GeneratingUnit = GeneratingUnit
95 super(SynchronousMachine, self).__init__(*args, **kw_args)
97 _attrs = ["x0", "qPercent", "x2", "r", "referencePriority", "operatingMode", "r0", "type", "r2", "maxQ", "x", "ratedS", "minQ"]
98 _attr_types = {"x0": float, "qPercent": float, "x2": float, "r": float, "referencePriority": int, "operatingMode": str, "r0": float, "type": str, "r2": float, "maxQ": float, "x": float, "ratedS": float, "minQ": float}
99 _defaults = {"x0": 0.0, "qPercent": 0.0, "x2": 0.0, "r": 0.0, "referencePriority": 0, "operatingMode": "condenser", "r0": 0.0, "type": "condenser", "r2": 0.0, "maxQ": 0.0, "x": 0.0, "ratedS": 0.0, "minQ": 0.0}
100 _enums = {"operatingMode": "SynchronousMachineOperatingMode", "type": "SynchronousMachineType"}
101 _refs = ["InitialReactiveCapabilityCurve", "HydroPump", "GeneratingUnit"]
102 _many_refs = []
104 def getInitialReactiveCapabilityCurve(self):
105 """The default ReactiveCapabilityCurve for use by a SynchronousMachine
107 return self._InitialReactiveCapabilityCurve
109 def setInitialReactiveCapabilityCurve(self, value):
110 if self._InitialReactiveCapabilityCurve is not None:
111 filtered = [x for x in self.InitialReactiveCapabilityCurve.InitiallyUsedBySynchronousMachines if x != self]
112 self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines = filtered
114 self._InitialReactiveCapabilityCurve = value
115 if self._InitialReactiveCapabilityCurve is not None:
116 if self not in self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines:
117 self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines.append(self)
119 InitialReactiveCapabilityCurve = property(getInitialReactiveCapabilityCurve, setInitialReactiveCapabilityCurve)
121 def getHydroPump(self):
122 """The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating.
124 return self._HydroPump
126 def setHydroPump(self, value):
127 if self._HydroPump is not None:
128 self._HydroPump._SynchronousMachine = None
130 self._HydroPump = value
131 if self._HydroPump is not None:
132 self._HydroPump.SynchronousMachine = None
133 self._HydroPump._SynchronousMachine = self
135 HydroPump = property(getHydroPump, setHydroPump)
137 def getGeneratingUnit(self):
138 """A synchronous machine may operate as a generator and as such becomes a member of a generating unitFor the 2010 ENTSOE IOP, this is required for Synchronous Machine.
140 return self._GeneratingUnit
142 def setGeneratingUnit(self, value):
143 if self._GeneratingUnit is not None:
144 filtered = [x for x in self.GeneratingUnit.SynchronousMachines if x != self]
145 self._GeneratingUnit._SynchronousMachines = filtered
147 self._GeneratingUnit = value
148 if self._GeneratingUnit is not None:
149 if self not in self._GeneratingUnit._SynchronousMachines:
150 self._GeneratingUnit._SynchronousMachines.append(self)
152 GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit)