Adding CDPSM package.
[PyCIM.git] / CIM14 / Dynamics / Loads / AggregateLoad.py
blob773455399a22e1646e48c0f9b8b6c8623a9b2102
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.PowerSystemResource import PowerSystemResource
19 class AggregateLoad(PowerSystemResource):
20 """Aggregate loads are used to represent all or part of the real and reactive load from a load in the static (power flow) data. This load is usually the aggregation of many individual load devices. The load models are approximate representation of the aggregate response of the load devices to system disturbances. Models of loads for dynamic analysis may themselves be either static or dynamic. A static load model represents the sensitivity of the real and reactive power consumed by the load to the amplitude and frequency of the bus voltage. A dynamic load model can used to represent the aggregate response of the motor components of the load. Large industrial motors or groups of similar motors may be represented by individual motor models (synchronous or asynchronous) which are usually represented as generators with negative Pgen in the static (power flow) data.
21 """
23 def __init__(self, energyConsumer0=None, *args, **kw_args):
24 """Initialises a new 'AggregateLoad' instance.
26 @param energyConsumer0:
27 """
28 self._energyConsumer0 = []
29 self.energyConsumer0 = [] if energyConsumer0 is None else energyConsumer0
31 super(AggregateLoad, self).__init__(*args, **kw_args)
33 _attrs = []
34 _attr_types = {}
35 _defaults = {}
36 _enums = {}
37 _refs = ["energyConsumer0"]
38 _many_refs = ["energyConsumer0"]
40 def getenergyConsumer0(self):
42 return self._energyConsumer0
44 def setenergyConsumer0(self, value):
45 for p in self._energyConsumer0:
46 filtered = [q for q in p.aggregateLoad0 if q != self]
47 self._energyConsumer0._aggregateLoad0 = filtered
48 for r in value:
49 if self not in r._aggregateLoad0:
50 r._aggregateLoad0.append(self)
51 self._energyConsumer0 = value
53 energyConsumer0 = property(getenergyConsumer0, setenergyConsumer0)
55 def addenergyConsumer0(self, *energyConsumer0):
56 for obj in energyConsumer0:
57 if self not in obj._aggregateLoad0:
58 obj._aggregateLoad0.append(self)
59 self._energyConsumer0.append(obj)
61 def removeenergyConsumer0(self, *energyConsumer0):
62 for obj in energyConsumer0:
63 if self in obj._aggregateLoad0:
64 obj._aggregateLoad0.remove(self)
65 self._energyConsumer0.remove(obj)