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
.IdentifiedObject
import IdentifiedObject
23 class LoadResponseCharacteristic(IdentifiedObject
):
24 """Models the characteristic response of the load demand due to to changes in system conditions such as voltage and frequency. This is not related to demand response. If LoadResponseCharacteristic.exponentModel is True, the voltage exponents are specified and used as to calculate: Active power component = Pnominal * (Voltage/cim:BaseVoltage.nominalVoltage) ** cim:LoadResponseCharacteristic.pVoltageExponent Reactive power component = Qnominal * (Voltage/cim:BaseVoltage.nominalVoltage)** cim:LoadResponseCharacteristic.qVoltageExponent Where * means 'multiply' and ** is 'raised to power of'.
27 def __init__(self
, pFrequencyExponent
=0.0, qFrequencyExponent
=0.0, pConstantPower
=0.0, pConstantCurrent
=0.0, pVoltageExponent
=0.0, pConstantImpedance
=0.0, qConstantImpedance
=0.0, qConstantPower
=0.0, qVoltageExponent
=0.0, exponentModel
=False, qConstantCurrent
=0.0, EnergyConsumer
=None, *args
, **kw_args
):
28 """Initialises a new 'LoadResponseCharacteristic' instance.
30 @param pFrequencyExponent: Exponent of per unit frequency effecting active power
31 @param qFrequencyExponent: Exponent of per unit frequency effecting reactive power
32 @param pConstantPower: Portion of active power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP.
33 @param pConstantCurrent: Portion of active power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP.
34 @param pVoltageExponent: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true.
35 @param pConstantImpedance: Portion of active power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP.
36 @param qConstantImpedance: Portion of reactive power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP.
37 @param qConstantPower: Portion of reactive power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP.
38 @param qVoltageExponent: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true.
39 @param exponentModel: Indicates the exponential voltage dependency model (pVoltateExponent and qVoltageExponent) is to be used. If false, the coeficient model (consisting of pConstantImpedance, pConstantCurrent, pConstantPower, qConstantImpedance, qConstantCurrent, and qConstantPower) is to be used.
40 @param qConstantCurrent: Portion of reactive power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP.
41 @param EnergyConsumer: The set of loads that have the response characteristics.
43 #: Exponent of per unit frequency effecting active power
44 self
.pFrequencyExponent
= pFrequencyExponent
46 #: Exponent of per unit frequency effecting reactive power
47 self
.qFrequencyExponent
= qFrequencyExponent
49 #: Portion of active power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP.
50 self
.pConstantPower
= pConstantPower
52 #: Portion of active power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP.
53 self
.pConstantCurrent
= pConstantCurrent
55 #: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true.
56 self
.pVoltageExponent
= pVoltageExponent
58 #: Portion of active power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of pZ, pI, and pP.
59 self
.pConstantImpedance
= pConstantImpedance
61 #: Portion of reactive power load modeled as constant impedance. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP.
62 self
.qConstantImpedance
= qConstantImpedance
64 #: Portion of reactive power load modeled as constant power. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP.
65 self
.qConstantPower
= qConstantPower
67 #: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true.
68 self
.qVoltageExponent
= qVoltageExponent
70 #: Indicates the exponential voltage dependency model (pVoltateExponent and qVoltageExponent) is to be used. If false, the coeficient model (consisting of pConstantImpedance, pConstantCurrent, pConstantPower, qConstantImpedance, qConstantCurrent, and qConstantPower) is to be used.
71 self
.exponentModel
= exponentModel
73 #: Portion of reactive power load modeled as constant current. Used only if the useExponentModel is false. This value is noralized against the sum of qZ, qI, and qP.
74 self
.qConstantCurrent
= qConstantCurrent
76 self
._EnergyConsumer
= []
77 self
.EnergyConsumer
= [] if EnergyConsumer
is None else EnergyConsumer
79 super(LoadResponseCharacteristic
, self
).__init
__(*args
, **kw_args
)
81 _attrs
= ["pFrequencyExponent", "qFrequencyExponent", "pConstantPower", "pConstantCurrent", "pVoltageExponent", "pConstantImpedance", "qConstantImpedance", "qConstantPower", "qVoltageExponent", "exponentModel", "qConstantCurrent"]
82 _attr_types
= {"pFrequencyExponent": float, "qFrequencyExponent": float, "pConstantPower": float, "pConstantCurrent": float, "pVoltageExponent": float, "pConstantImpedance": float, "qConstantImpedance": float, "qConstantPower": float, "qVoltageExponent": float, "exponentModel": bool, "qConstantCurrent": float}
83 _defaults
= {"pFrequencyExponent": 0.0, "qFrequencyExponent": 0.0, "pConstantPower": 0.0, "pConstantCurrent": 0.0, "pVoltageExponent": 0.0, "pConstantImpedance": 0.0, "qConstantImpedance": 0.0, "qConstantPower": 0.0, "qVoltageExponent": 0.0, "exponentModel": False, "qConstantCurrent": 0.0}
85 _refs
= ["EnergyConsumer"]
86 _many_refs
= ["EnergyConsumer"]
88 def getEnergyConsumer(self
):
89 """The set of loads that have the response characteristics.
91 return self
._EnergyConsumer
93 def setEnergyConsumer(self
, value
):
94 for x
in self
._EnergyConsumer
:
97 y
._LoadResponse
= self
98 self
._EnergyConsumer
= value
100 EnergyConsumer
= property(getEnergyConsumer
, setEnergyConsumer
)
102 def addEnergyConsumer(self
, *EnergyConsumer
):
103 for obj
in EnergyConsumer
:
104 obj
.LoadResponse
= self
106 def removeEnergyConsumer(self
, *EnergyConsumer
):
107 for obj
in EnergyConsumer
:
108 obj
.LoadResponse
= None