def __init__(self,from_bus,to_bus, bandwidth=2.0, N_PT=20.0, CTp=700., CTs=5, Rd=3.0, Xd=9.0, Vset=120, type='B'): Branch.__init__(self,from_bus,to_bus) self.from_bus=from_bus # self is attached from bus self.to_bus = to_bus # self is attached to bus self.bandwidth=bandwidth # my bandwidth in Volt self.Vset=Vset # the desired voltage on a 120 V base voltage to be held at the regulating point self.Vset_min= self.Vset-self.bandwidth/2. self.Vset_max= self.Vset+self.bandwidth/2. self.N_PT=N_PT # my potential transformer ratio self.CTp=CTp # my primary current rating of the current transformer in Ampere self.CTs=CTs # my secondary current rating of the current transformer in Ampere self.CT=self.CTp/self.CTs self.Rd=Rd # Rd --> R' the compensator equvalent setting in Volt self.Xd=Xd # Xd --> R' the compensator equvalent setting in Volt self.Zd=self.Rd + 1j*self.Xd self.Zd_ohm =self.Zd/self.CTs self.Tap=0 self.a_R=1 self.I_comp=0 self.I_line=0 self.I_from=0 self.Vs=1.0+1j*0 self.Is=0 self.VL=1+1j*0 self.IL=0 self.V_reg=1+1j*0 self.V_drop=1+1j*0 self.type=type
def __init__(self, from_bus, to_bus, Z=ones([3, 3]),Y=zeros([3,3]),base_kv=1.0): Branch.__init__(self,from_bus,to_bus) self.Z=Z # This is the series element of the line impedance self.Y=Y # This is the shunt element of the line impedance self.Z012 = dot(dot(inv(Pinv),Z),Pinv) self.base_kv=base_kv self.E_from = from_bus.E#zeros(3) self.E_to=to_bus.E#zeros(3) self.I_from = zeros(3) self.I_to=zeros(3) #self.Iline=zeros(3) self.I_line=self.I_to+dot(self.Y,self.E_to) self.line_drop=zeros(3,dtype=complex) self.line_loss=zeros(3,dtype=complex)