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 PerLengthSequenceImpedance(IdentifiedObject
):
24 """Sequence impedance and admittance parameters per unit length, for transposed lines of 1, 2, or 3 phases. For 1-phase lines, define x=x0=xself. For 2-phase lines, define x=xs-xm and x0=xs+xm.
27 def __init__(self
, r0
=0.0, r
=0.0, b0ch
=0.0, x0
=0.0, gch
=0.0, g0ch
=0.0, bch
=0.0, x
=0.0, ConductorSegments
=None, *args
, **kw_args
):
28 """Initialises a new 'PerLengthSequenceImpedance' instance.
30 @param r0: Zero sequence series resistance, per unit of length.
31 @param r: Positive sequence series resistance, per unit of length.
32 @param b0ch: Zero sequence shunt (charging) susceptance, per unit of length.
33 @param x0: Zero sequence series reactance, per unit of length.
34 @param gch: Positive sequence shunt (charging) conductance, per unit of length.
35 @param g0ch: Zero sequence shunt (charging) conductance, per unit of length.
36 @param bch: Positive sequence shunt (charging) susceptance, per unit of length.
37 @param x: Positive sequence series reactance, per unit of length.
38 @param ConductorSegments: All conductor segments described by this sequence impedance.
40 #: Zero sequence series resistance, per unit of length.
43 #: Positive sequence series resistance, per unit of length.
46 #: Zero sequence shunt (charging) susceptance, per unit of length.
49 #: Zero sequence series reactance, per unit of length.
52 #: Positive sequence shunt (charging) conductance, per unit of length.
55 #: Zero sequence shunt (charging) conductance, per unit of length.
58 #: Positive sequence shunt (charging) susceptance, per unit of length.
61 #: Positive sequence series reactance, per unit of length.
64 self
._ConductorSegments
= []
65 self
.ConductorSegments
= [] if ConductorSegments
is None else ConductorSegments
67 super(PerLengthSequenceImpedance
, self
).__init
__(*args
, **kw_args
)
69 _attrs
= ["r0", "r", "b0ch", "x0", "gch", "g0ch", "bch", "x"]
70 _attr_types
= {"r0": float, "r": float, "b0ch": float, "x0": float, "gch": float, "g0ch": float, "bch": float, "x": float}
71 _defaults
= {"r0": 0.0, "r": 0.0, "b0ch": 0.0, "x0": 0.0, "gch": 0.0, "g0ch": 0.0, "bch": 0.0, "x": 0.0}
73 _refs
= ["ConductorSegments"]
74 _many_refs
= ["ConductorSegments"]
76 def getConductorSegments(self
):
77 """All conductor segments described by this sequence impedance.
79 return self
._ConductorSegments
81 def setConductorSegments(self
, value
):
82 for x
in self
._ConductorSegments
:
83 x
.SequenceImpedance
= None
85 y
._SequenceImpedance
= self
86 self
._ConductorSegments
= value
88 ConductorSegments
= property(getConductorSegments
, setConductorSegments
)
90 def addConductorSegments(self
, *ConductorSegments
):
91 for obj
in ConductorSegments
:
92 obj
.SequenceImpedance
= self
94 def removeConductorSegments(self
, *ConductorSegments
):
95 for obj
in ConductorSegments
:
96 obj
.SequenceImpedance
= None