@@ -11,28 +11,35 @@ class UndergroundLineType(EditableDevice):
1111 __slots__ = (
1212 'Imax' ,
1313 'Vnom' ,
14+ '_freq' ,
1415 'R' ,
1516 'X' ,
1617 'B' ,
18+ '_C' ,
1719 'R0' ,
1820 'X0' ,
1921 'B0' ,
22+ '_C0' ,
2023 'n_circuits'
2124 )
2225
2326 def __init__ (self , name : str = 'UndergroundLine' , idtag : None | str = None , Imax : float = 1.0 ,
24- Vnom : float = 1.0 , R : float = 0.0 , X : float = 0.0 , B : float = 0.0 ,
25- R0 : float = 0.0 , X0 : float = 0.0 , B0 : float = 0.0 ) -> None :
27+ Vnom : float = 1.0 , R : float = 0.0 , X : float = 0.0 , B : float = 0.0 , C : float = 0.0 ,
28+ R0 : float = 0.0 , X0 : float = 0.0 , B0 : float = 0.0 , C0 : float = 0.0 ,
29+ freq : float = 50.0 ) -> None :
2630 """
2731 Constructor
2832 :param name: name of the device
2933 :param Imax: rating in kA
3034 :param R: Resistance of positive sequence in Ohm/km
3135 :param X: Reactance of positive sequence in Ohm/km
3236 :param B: Susceptance of positive sequence in uS/km
37+ :param C: Capacitance of positive sequence in uF/km (alternative to B)
3338 :param R0: Resistance of zero sequence in Ohm/km
3439 :param X0: Reactance of zero sequence in Ohm/km
3540 :param B0: Susceptance of zero sequence in uS/km
41+ :param C0: Capacitance of zero sequence in uF/km (alternative to B0)
42+ :param freq: Frequency of underground line (Hz)
3643 """
3744 EditableDevice .__init__ (self ,
3845 name = name ,
@@ -42,26 +49,34 @@ def __init__(self, name: str = 'UndergroundLine', idtag: None | str = None, Imax
4249
4350 self .Imax = float (Imax )
4451 self .Vnom = float (Vnom )
52+ self ._freq = float (freq )
4553
4654 # impudence and admittance per unit of length
4755 self .R = float (R )
4856 self .X = float (X )
4957 self .B = float (B )
58+ self ._C = float (C )
5059
5160 self .R0 = float (R0 )
5261 self .X0 = float (X0 )
5362 self .B0 = float (B0 )
63+ self ._C0 = float (C0 )
5464
5565 self .n_circuits = 1
5666
5767 self .register (key = 'Imax' , units = 'kA' , tpe = float , definition = 'Current rating of the line' , old_names = ['rating' ])
5868 self .register (key = 'Vnom' , units = 'kV' , tpe = float , definition = 'Voltage rating of the line' )
69+ self .register (key = 'freq' , units = 'Hz' , tpe = float , definition = 'Cable frequency' )
5970 self .register (key = 'R' , units = 'Ohm/km' , tpe = float , definition = 'Positive-sequence resistance per km' )
6071 self .register (key = 'X' , units = 'Ohm/km' , tpe = float , definition = 'Positive-sequence reactance per km' )
6172 self .register (key = 'B' , units = 'uS/km' , tpe = float , definition = 'Positive-sequence shunt susceptance per km' )
73+ self .register (key = 'C' , units = 'uF/km' , tpe = float ,
74+ definition = 'Positive-sequence shunt capacitance per km (alternative to B' )
6275 self .register (key = 'R0' , units = 'Ohm/km' , tpe = float , definition = 'Zero-sequence resistance per km' )
6376 self .register (key = 'X0' , units = 'Ohm/km' , tpe = float , definition = 'Zero-sequence reactance per km' )
6477 self .register (key = 'B0' , units = 'uS/km' , tpe = float , definition = 'Zero-sequence shunt susceptance per km' )
78+ self .register (key = 'C0' , units = 'uF/km' , tpe = float ,
79+ definition = 'Zero-sequence shunt capacitance per km (alternative to B0' )
6580 self .register (key = 'n_circuits' , units = '' , tpe = int , definition = 'number of circuits' )
6681
6782 def get_values (self , Sbase : float , length : float ):
@@ -100,19 +115,36 @@ def y_shunt(self):
100115 """
101116 return 1j * self .B
102117
103- def change_base (self , Sbase_old , Sbase_new ):
104- """
105- change the per unit base
106- :param Sbase_old: old base in MVA
107- :param Sbase_new: new base in MVA
108- """
109- b = Sbase_new / Sbase_old
118+ @property
119+ def C (self ) -> float :
120+ return self ._C
121+
122+ @C .setter
123+ def C (self , C : float ):
124+ self ._C = float (C )
125+
126+ if self .auto_update_enabled :
127+ self .B = 2 * np .pi * self ._freq * self ._C
128+
129+ @property
130+ def C0 (self ) -> float :
131+ return self ._C0
132+
133+ @C0 .setter
134+ def C0 (self , C0 : float ):
135+ self ._C0 = float (C0 )
136+
137+ if self .auto_update_enabled :
138+ self .B0 = 2 * np .pi * self ._freq * self ._C0
110139
111- self . R *= b
112- self . X *= b
113- self .B *= b
140+ @ property
141+ def freq ( self ) -> float :
142+ return self ._freq
114143
115- self . R0 *= b
116- self . X0 *= b
117- self .B0 *= b
144+ @ freq . setter
145+ def freq ( self , freq : float ):
146+ self ._freq = float ( freq )
118147
148+ if self .auto_update_enabled :
149+ self .B = 2 * np .pi * self ._freq * self ._C
150+ self .B0 = 2 * np .pi * self ._freq * self ._C0
0 commit comments