Package empro :: Package toolkit :: Package results :: Module excitation
[frames] | no frames]

Source Code for Module empro.toolkit.results.excitation

1 -class Excitation(object):
2 - def __init__(self, source=0j, feedType="Voltage", R=0, L=0, C=0, arrangement="Series"):
3 self._source = source 4 self._feedType = feedType 5 self._R = R 6 self._L = L 7 self._C = C 8 self._arrangement = arrangement
9 10 @property
11 - def source(self):
12 return self._source
13 14 @property
15 - def feedType(self):
16 return self._feedType
17 18 @property
19 - def R(self):
20 return self._R
21 22 @property
23 - def L(self):
24 return self._L
25 26 @property
27 - def C(self):
28 return self._C
29 30 @property
31 - def arrangement(self):
32 return self._arrangement
33
34 - def __repr__(self):
35 return 'Excitation(source=%(_source)r, feedType=%(_feedType)r, R=%(_R)r, L=%(_L)r, C=%(_C)r, arrangement=%(_arrangement)r)' % self.__dict__
36
37 38 -class SeriesRLC(Excitation):
39 - def __init__(self, R=50.0, L=0.0, C=0.0):
40 Excitation.__init__(self, R=R, L=L, C=C, arrangement="Series")
41 - def __repr__(self):
42 return 'SeriesRLC(R=%(_R)r, L=%(_L)r, C=%(_C)r)' % self.__dict__
43
44 45 -class ParallelRLC(Excitation):
46 - def __init__(self, R=50.0, L=0.0, C=0.0):
47 Excitation.__init__(self, R=R, L=L, C=C, arrangement="Parallel")
48 - def __repr__(self):
49 return 'ParallelRLC(R=%(_R)r, L=%(_L)r, C=%(_C)r)' % self.__dict__
50
51 52 -class RLpC(Excitation):
53 - def __init__(self, R=50.0, L=0.0, C=0.0):
54 Excitation.__init__(self, R=R, L=L, C=C, arrangement="RLpC")
55 - def __repr__(self):
56 return 'RLpC(R=%(_R)r, L=%(_L)r, C=%(_C)r)' % self.__dict__
57
58 59 -class Short(Excitation):
60 - def __init__(self):
61 Excitation.__init__(self, R=0)
62 - def __repr__(self):
63 return 'Short()'
64
65 66 -class Open(Excitation):
67 - def __init__(self):
68 Excitation.__init__(self, R=1e6)
69 - def __repr__(self):
70 return 'Open()'
71
72 73 -class VoltageSource(Excitation):
74 - def __init__(self, V=1, load=SeriesRLC(50)):
75 Excitation.__init__(self, source=V, feedType="Voltage", R=load.R, L=load.L, C=load.C, arrangement=load.arrangement) 76 self._load = load
77 - def __repr__(self):
78 return 'VoltageSource(V=%(_source)r, load=%(_load)r)' % self.__dict__
79
80 81 -class CurrentSource(Excitation):
82 - def __init__(self, A=1, load=ParallelRLC(50)):
83 Excitation.__init__(self, source=A, feedType="Current", R=load.R, L=load.L, C=load.C, arrangement=load.arrangement) 84 self._load = load
85 - def __repr__(self):
86 return 'CurrentSource(V=%(_source)r, load=%(_load)r)' % self.__dict__
87