Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61970 / LoadModel / LoadResponseCharacteristic.py
blob2b653050c9d9206ff823fa7139d6e356f6a1d96e
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.IdentifiedObject import IdentifiedObject
19 class LoadResponseCharacteristic(IdentifiedObject):
20 """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'.
21 """
23 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):
24 """Initialises a new 'LoadResponseCharacteristic' instance.
26 @param pFrequencyExponent: Exponent of per unit frequency effecting active power
27 @param qFrequencyExponent: Exponent of per unit frequency effecting reactive power
28 @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.
29 @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.
30 @param pVoltageExponent: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true.
31 @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.
32 @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.
33 @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.
34 @param qVoltageExponent: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true.
35 @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.
36 @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.
37 @param EnergyConsumer: The set of loads that have the response characteristics.
38 """
39 #: Exponent of per unit frequency effecting active power
40 self.pFrequencyExponent = pFrequencyExponent
42 #: Exponent of per unit frequency effecting reactive power
43 self.qFrequencyExponent = qFrequencyExponent
45 #: 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.
46 self.pConstantPower = pConstantPower
48 #: 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.
49 self.pConstantCurrent = pConstantCurrent
51 #: Exponent of per unit voltage effecting real power. This model used only when 'useExponentModel' is true.
52 self.pVoltageExponent = pVoltageExponent
54 #: 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.
55 self.pConstantImpedance = pConstantImpedance
57 #: 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.
58 self.qConstantImpedance = qConstantImpedance
60 #: 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.
61 self.qConstantPower = qConstantPower
63 #: Exponent of per unit voltage effecting reactive power. This model used only when 'useExponentModel' is true.
64 self.qVoltageExponent = qVoltageExponent
66 #: 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.
67 self.exponentModel = exponentModel
69 #: 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.
70 self.qConstantCurrent = qConstantCurrent
72 self._EnergyConsumer = []
73 self.EnergyConsumer = [] if EnergyConsumer is None else EnergyConsumer
75 super(LoadResponseCharacteristic, self).__init__(*args, **kw_args)
77 _attrs = ["pFrequencyExponent", "qFrequencyExponent", "pConstantPower", "pConstantCurrent", "pVoltageExponent", "pConstantImpedance", "qConstantImpedance", "qConstantPower", "qVoltageExponent", "exponentModel", "qConstantCurrent"]
78 _attr_types = {"pFrequencyExponent": float, "qFrequencyExponent": float, "pConstantPower": float, "pConstantCurrent": float, "pVoltageExponent": float, "pConstantImpedance": float, "qConstantImpedance": float, "qConstantPower": float, "qVoltageExponent": float, "exponentModel": bool, "qConstantCurrent": float}
79 _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}
80 _enums = {}
81 _refs = ["EnergyConsumer"]
82 _many_refs = ["EnergyConsumer"]
84 def getEnergyConsumer(self):
85 """The set of loads that have the response characteristics.
86 """
87 return self._EnergyConsumer
89 def setEnergyConsumer(self, value):
90 for x in self._EnergyConsumer:
91 x.LoadResponse = None
92 for y in value:
93 y._LoadResponse = self
94 self._EnergyConsumer = value
96 EnergyConsumer = property(getEnergyConsumer, setEnergyConsumer)
98 def addEnergyConsumer(self, *EnergyConsumer):
99 for obj in EnergyConsumer:
100 obj.LoadResponse = self
102 def removeEnergyConsumer(self, *EnergyConsumer):
103 for obj in EnergyConsumer:
104 obj.LoadResponse = None