1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14
.IEC61970
.Core
.Curve
import Curve
19 class ReactiveCapabilityCurve(Curve
):
20 """Reactive power rating envelope versus the synchronous machine's active power, in both the generating and motoring modes. For each active power value there is a corresponding high and low reactive power limit value. Typically there will be a separate curve for each coolant condition, such as hydrogen pressure. The Y1 axis values represent reactive minimum and the Y2 axis values represent reactive maximum.
23 def __init__(self
, coolantTemperature
=0.0, hydrogenPressure
=0.0, InitiallyUsedBySynchronousMachines
=None, SynchronousMachines
=None, *args
, **kw_args
):
24 """Initialises a new 'ReactiveCapabilityCurve' instance.
26 @param coolantTemperature: The machine's coolant temperature (e.g., ambient air or stator circulating water).
27 @param hydrogenPressure: The hydrogen coolant pressure
28 @param InitiallyUsedBySynchronousMachines: Synchronous machines using this curve as default.
29 @param SynchronousMachines: Synchronous machines using this curve.
31 #: The machine's coolant temperature (e.g., ambient air or stator circulating water).
32 self
.coolantTemperature
= coolantTemperature
34 #: The hydrogen coolant pressure
35 self
.hydrogenPressure
= hydrogenPressure
37 self
._InitiallyUsedBySynchronousMachines
= []
38 self
.InitiallyUsedBySynchronousMachines
= [] if InitiallyUsedBySynchronousMachines
is None else InitiallyUsedBySynchronousMachines
40 self
._SynchronousMachines
= []
41 self
.SynchronousMachines
= [] if SynchronousMachines
is None else SynchronousMachines
43 super(ReactiveCapabilityCurve
, self
).__init
__(*args
, **kw_args
)
45 _attrs
= ["coolantTemperature", "hydrogenPressure"]
46 _attr_types
= {"coolantTemperature": float, "hydrogenPressure": float}
47 _defaults
= {"coolantTemperature": 0.0, "hydrogenPressure": 0.0}
49 _refs
= ["InitiallyUsedBySynchronousMachines", "SynchronousMachines"]
50 _many_refs
= ["InitiallyUsedBySynchronousMachines", "SynchronousMachines"]
52 def getInitiallyUsedBySynchronousMachines(self
):
53 """Synchronous machines using this curve as default.
55 return self
._InitiallyUsedBySynchronousMachines
57 def setInitiallyUsedBySynchronousMachines(self
, value
):
58 for x
in self
._InitiallyUsedBySynchronousMachines
:
59 x
._InitialReactiveCapabilityCurve
= None
61 y
._InitialReactiveCapabilityCurve
= self
62 self
._InitiallyUsedBySynchronousMachines
= value
64 InitiallyUsedBySynchronousMachines
= property(getInitiallyUsedBySynchronousMachines
, setInitiallyUsedBySynchronousMachines
)
66 def addInitiallyUsedBySynchronousMachines(self
, *InitiallyUsedBySynchronousMachines
):
67 for obj
in InitiallyUsedBySynchronousMachines
:
68 obj
._InitialReactiveCapabilityCurve
= self
69 self
._InitiallyUsedBySynchronousMachines
.append(obj
)
71 def removeInitiallyUsedBySynchronousMachines(self
, *InitiallyUsedBySynchronousMachines
):
72 for obj
in InitiallyUsedBySynchronousMachines
:
73 obj
._InitialReactiveCapabilityCurve
= None
74 self
._InitiallyUsedBySynchronousMachines
.remove(obj
)
76 def getSynchronousMachines(self
):
77 """Synchronous machines using this curve.
79 return self
._SynchronousMachines
81 def setSynchronousMachines(self
, value
):
82 for p
in self
._SynchronousMachines
:
83 filtered
= [q
for q
in p
.ReactiveCapabilityCurves
if q
!= self
]
84 self
._SynchronousMachines
._ReactiveCapabilityCurves
= filtered
86 if self
not in r
._ReactiveCapabilityCurves
:
87 r
._ReactiveCapabilityCurves
.append(self
)
88 self
._SynchronousMachines
= value
90 SynchronousMachines
= property(getSynchronousMachines
, setSynchronousMachines
)
92 def addSynchronousMachines(self
, *SynchronousMachines
):
93 for obj
in SynchronousMachines
:
94 if self
not in obj
._ReactiveCapabilityCurves
:
95 obj
._ReactiveCapabilityCurves
.append(self
)
96 self
._SynchronousMachines
.append(obj
)
98 def removeSynchronousMachines(self
, *SynchronousMachines
):
99 for obj
in SynchronousMachines
:
100 if self
in obj
._ReactiveCapabilityCurves
:
101 obj
._ReactiveCapabilityCurves
.remove(self
)
102 self
._SynchronousMachines
.remove(obj
)