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
.CDPSM
.Unbalanced
.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
, pVoltageExponent
=0.0, qConstantCurrent
=0.0, pFrequencyExponent
=0.0, exponentModel
=False, qConstantImpedance
=0.0, pConstantCurrent
=0.0, qFrequencyExponent
=0.0, pConstantPower
=0.0, qVoltageExponent
=0.0, qConstantPower
=0.0, pConstantImpedance
=0.0, EnergyConsumer
=None, *args
, **kw_args
):
28 """Initialises a new 'LoadResponseCharacteristic' instance.
30 @param pVoltageExponent: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true.
31 @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.
32 @param pFrequencyExponent: Exponent of per unit frequency effecting active power
33 @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.
34 @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.
35 @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.
36 @param qFrequencyExponent: Exponent of per unit frequency effecting reactive power
37 @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.
38 @param qVoltageExponent: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true.
39 @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.
40 @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.
41 @param EnergyConsumer: The set of loads that have the response characteristics.
43 #: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true.
44 self
.pVoltageExponent
= pVoltageExponent
46 #: 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.
47 self
.qConstantCurrent
= qConstantCurrent
49 #: Exponent of per unit frequency effecting active power
50 self
.pFrequencyExponent
= pFrequencyExponent
52 #: 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.
53 self
.exponentModel
= exponentModel
55 #: 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.
56 self
.qConstantImpedance
= qConstantImpedance
58 #: 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.
59 self
.pConstantCurrent
= pConstantCurrent
61 #: Exponent of per unit frequency effecting reactive power
62 self
.qFrequencyExponent
= qFrequencyExponent
64 #: 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.
65 self
.pConstantPower
= pConstantPower
67 #: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true.
68 self
.qVoltageExponent
= qVoltageExponent
70 #: 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.
71 self
.qConstantPower
= qConstantPower
73 #: 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.
74 self
.pConstantImpedance
= pConstantImpedance
76 self
._EnergyConsumer
= []
77 self
.EnergyConsumer
= [] if EnergyConsumer
is None else EnergyConsumer
79 super(LoadResponseCharacteristic
, self
).__init
__(*args
, **kw_args
)
81 _attrs
= ["pVoltageExponent", "qConstantCurrent", "pFrequencyExponent", "exponentModel", "qConstantImpedance", "pConstantCurrent", "qFrequencyExponent", "pConstantPower", "qVoltageExponent", "qConstantPower", "pConstantImpedance"]
82 _attr_types
= {"pVoltageExponent": float, "qConstantCurrent": float, "pFrequencyExponent": float, "exponentModel": bool, "qConstantImpedance": float, "pConstantCurrent": float, "qFrequencyExponent": float, "pConstantPower": float, "qVoltageExponent": float, "qConstantPower": float, "pConstantImpedance": float}
83 _defaults
= {"pVoltageExponent": 0.0, "qConstantCurrent": 0.0, "pFrequencyExponent": 0.0, "exponentModel": False, "qConstantImpedance": 0.0, "pConstantCurrent": 0.0, "qFrequencyExponent": 0.0, "pConstantPower": 0.0, "qVoltageExponent": 0.0, "qConstantPower": 0.0, "pConstantImpedance": 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