Fixing website and API documentation links
[PyCIM.git] / CIM14 / CPSM / Equipment / Wires / SynchronousMachine.py
blob1818f14721d6bfaa54ae50eccb07bf873ffb8398
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.CPSM.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, 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 operatingMode: Current mode of operation. Values are: "condenser", "generator"
35 @param r0: Zero sequence resistance of the synchronous machine.
36 @param type: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator"
37 @param r2: Negative sequence resistance.
38 @param maxQ: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
39 @param x: Positive sequence reactance of the synchronous machine.
40 @param ratedS: Nameplate apparent power rating for the unit
41 @param minQ: Minimum reactive power limit for the unit.
42 @param InitialReactiveCapabilityCurve: The default ReactiveCapabilityCurve for use by a SynchronousMachine
43 @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.
44 @param GeneratingUnit: A synchronous machine may operate as a generator and as such becomes a member of a generating unit
45 """
46 #: Zero sequence reactance of the synchronous machine.
47 self.x0 = x0
49 #: Percent of the coordinated reactive control that comes from this machine.
50 self.qPercent = qPercent
52 #: Negative sequence reactance.
53 self.x2 = x2
55 #: Positive sequence resistance of the synchronous machine.
56 self.r = r
58 #: Current mode of operation. Values are: "condenser", "generator"
59 self.operatingMode = operatingMode
61 #: Zero sequence resistance of the synchronous machine.
62 self.r0 = r0
64 #: Modes that this synchronous machine can operate in. Values are: "condenser", "generator_or_condenser", "generator"
65 self.type = type
67 #: Negative sequence resistance.
68 self.r2 = r2
70 #: Maximum reactive power limit. This is the maximum (nameplate) limit for the unit.
71 self.maxQ = maxQ
73 #: Positive sequence reactance of the synchronous machine.
74 self.x = x
76 #: Nameplate apparent power rating for the unit
77 self.ratedS = ratedS
79 #: Minimum reactive power limit for the unit.
80 self.minQ = minQ
82 self._InitialReactiveCapabilityCurve = None
83 self.InitialReactiveCapabilityCurve = InitialReactiveCapabilityCurve
85 self._HydroPump = None
86 self.HydroPump = HydroPump
88 self._GeneratingUnit = None
89 self.GeneratingUnit = GeneratingUnit
91 super(SynchronousMachine, self).__init__(*args, **kw_args)
93 _attrs = ["x0", "qPercent", "x2", "r", "operatingMode", "r0", "type", "r2", "maxQ", "x", "ratedS", "minQ"]
94 _attr_types = {"x0": float, "qPercent": float, "x2": float, "r": float, "operatingMode": str, "r0": float, "type": str, "r2": float, "maxQ": float, "x": float, "ratedS": float, "minQ": float}
95 _defaults = {"x0": 0.0, "qPercent": 0.0, "x2": 0.0, "r": 0.0, "operatingMode": "condenser", "r0": 0.0, "type": "condenser", "r2": 0.0, "maxQ": 0.0, "x": 0.0, "ratedS": 0.0, "minQ": 0.0}
96 _enums = {"operatingMode": "SynchronousMachineOperatingMode", "type": "SynchronousMachineType"}
97 _refs = ["InitialReactiveCapabilityCurve", "HydroPump", "GeneratingUnit"]
98 _many_refs = []
100 def getInitialReactiveCapabilityCurve(self):
101 """The default ReactiveCapabilityCurve for use by a SynchronousMachine
103 return self._InitialReactiveCapabilityCurve
105 def setInitialReactiveCapabilityCurve(self, value):
106 if self._InitialReactiveCapabilityCurve is not None:
107 filtered = [x for x in self.InitialReactiveCapabilityCurve.InitiallyUsedBySynchronousMachines if x != self]
108 self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines = filtered
110 self._InitialReactiveCapabilityCurve = value
111 if self._InitialReactiveCapabilityCurve is not None:
112 if self not in self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines:
113 self._InitialReactiveCapabilityCurve._InitiallyUsedBySynchronousMachines.append(self)
115 InitialReactiveCapabilityCurve = property(getInitialReactiveCapabilityCurve, setInitialReactiveCapabilityCurve)
117 def getHydroPump(self):
118 """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.
120 return self._HydroPump
122 def setHydroPump(self, value):
123 if self._HydroPump is not None:
124 self._HydroPump._SynchronousMachine = None
126 self._HydroPump = value
127 if self._HydroPump is not None:
128 self._HydroPump.SynchronousMachine = None
129 self._HydroPump._SynchronousMachine = self
131 HydroPump = property(getHydroPump, setHydroPump)
133 def getGeneratingUnit(self):
134 """A synchronous machine may operate as a generator and as such becomes a member of a generating unit
136 return self._GeneratingUnit
138 def setGeneratingUnit(self, value):
139 if self._GeneratingUnit is not None:
140 filtered = [x for x in self.GeneratingUnit.SynchronousMachines if x != self]
141 self._GeneratingUnit._SynchronousMachines = filtered
143 self._GeneratingUnit = value
144 if self._GeneratingUnit is not None:
145 if self not in self._GeneratingUnit._SynchronousMachines:
146 self._GeneratingUnit._SynchronousMachines.append(self)
148 GeneratingUnit = property(getGeneratingUnit, setGeneratingUnit)