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
.CPSM
.Equipment
.Core
.IdentifiedObject
import IdentifiedObject
23 class MutualCoupling(IdentifiedObject
):
24 """This class represents the zero sequence line mutual coupling.
27 def __init__(self
, g0ch
=0.0, r0
=0.0, x0
=0.0, distance11
=0.0, distance12
=0.0, distance22
=0.0, distance21
=0.0, b0ch
=0.0, Second_Terminal
=None, First_Terminal
=None, *args
, **kw_args
):
28 """Initialises a new 'MutualCoupling' instance.
30 @param g0ch: Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section.
31 @param r0: Zero sequence branch-to-branch mutual impedance coupling, resistance
32 @param x0: Zero sequence branch-to-branch mutual impedance coupling, reactance
33 @param distance11: Distance from the first line's specified terminal to start of coupled region
34 @param distance12: Distance from the first line's from specified terminal to end of coupled region
35 @param distance22: Distance from the second line's specified terminal to end of coupled region
36 @param distance21: Distance from the second line's specified terminal to start of coupled region
37 @param b0ch: Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section.
38 @param Second_Terminal: The starting terminal for the calculation of distances along the second branch of the mutual coupling.
39 @param First_Terminal: The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments.
41 #: Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section.
44 #: Zero sequence branch-to-branch mutual impedance coupling, resistance
47 #: Zero sequence branch-to-branch mutual impedance coupling, reactance
50 #: Distance from the first line's specified terminal to start of coupled region
51 self
.distance11
= distance11
53 #: Distance from the first line's from specified terminal to end of coupled region
54 self
.distance12
= distance12
56 #: Distance from the second line's specified terminal to end of coupled region
57 self
.distance22
= distance22
59 #: Distance from the second line's specified terminal to start of coupled region
60 self
.distance21
= distance21
62 #: Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section.
65 self
._Second
_Terminal
= None
66 self
.Second_Terminal
= Second_Terminal
68 self
._First
_Terminal
= None
69 self
.First_Terminal
= First_Terminal
71 super(MutualCoupling
, self
).__init
__(*args
, **kw_args
)
73 _attrs
= ["g0ch", "r0", "x0", "distance11", "distance12", "distance22", "distance21", "b0ch"]
74 _attr_types
= {"g0ch": float, "r0": float, "x0": float, "distance11": float, "distance12": float, "distance22": float, "distance21": float, "b0ch": float}
75 _defaults
= {"g0ch": 0.0, "r0": 0.0, "x0": 0.0, "distance11": 0.0, "distance12": 0.0, "distance22": 0.0, "distance21": 0.0, "b0ch": 0.0}
77 _refs
= ["Second_Terminal", "First_Terminal"]
80 def getSecond_Terminal(self
):
81 """The starting terminal for the calculation of distances along the second branch of the mutual coupling.
83 return self
._Second
_Terminal
85 def setSecond_Terminal(self
, value
):
86 if self
._Second
_Terminal
is not None:
87 filtered
= [x
for x
in self
.Second_Terminal
.HasSecond_MutualCoupling
if x
!= self
]
88 self
._Second
_Terminal
._HasSecond
_MutualCoupling
= filtered
90 self
._Second
_Terminal
= value
91 if self
._Second
_Terminal
is not None:
92 if self
not in self
._Second
_Terminal
._HasSecond
_MutualCoupling
:
93 self
._Second
_Terminal
._HasSecond
_MutualCoupling
.append(self
)
95 Second_Terminal
= property(getSecond_Terminal
, setSecond_Terminal
)
97 def getFirst_Terminal(self
):
98 """The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments.
100 return self
._First
_Terminal
102 def setFirst_Terminal(self
, value
):
103 if self
._First
_Terminal
is not None:
104 filtered
= [x
for x
in self
.First_Terminal
.HasFirst_MutualCoupling
if x
!= self
]
105 self
._First
_Terminal
._HasFirst
_MutualCoupling
= filtered
107 self
._First
_Terminal
= value
108 if self
._First
_Terminal
is not None:
109 if self
not in self
._First
_Terminal
._HasFirst
_MutualCoupling
:
110 self
._First
_Terminal
._HasFirst
_MutualCoupling
.append(self
)
112 First_Terminal
= property(getFirst_Terminal
, setFirst_Terminal
)