#Caption:Find the value of line current
a=2200./200##transformation ratio
P=450*1000. # watts
pf=0.85
V_s=200. # volts
I_2=P/(pf*V_s) # amperes
I_1=1.15*I_2/a
print 'Value of line currents = %.2f Amperes'%I_1
import numpy as np
#Caption:Find the value of line current
a=2200./200##transformation ratio
P_1=400.*1000 # watts
P_2=500.*1000 # watts
pf=0.8
V_s=200. # volts
I_2=P_1/(pf*V_s) # amperes
I_1=1.15*I_2/a
I_1T=I_1/2
I_2M=P_2/(pf*V_s*a)
I_p=np.sqrt((I_1T**2)+(I_2M**2))
print 'Value of line current = %.2f Amperes'%I_p
#Caption:Determine the efficiency of transformer at (a)full load and 0.85pf (b)75 percent of full load and unity pf (c)max efficieny at unity pf
P=100*1000 # watts
P_iron=1500 # watts
x=0.8
P_cu=1500/x**2 # watts
pf=0.8
a=5000/400##transformation ratio
P_t=P_iron+P_cu
P_o=0.85*P # watts
Eff=P_o/(P_o+P_t)
print '(a)Efficiency at full load and 0.85pf = %.2f %%'%(Eff*100)
P_cu_1=0.75*P_cu # watts
P_t_1=P_cu_1+P_iron # watts
P_o_1=0.75*P
Eff_1=P_o_1/(P_o_1+P_t_1)
print '(b)Efficiency at 75 percent of full load and unity pf = %.2f %%'%(Eff_1*100)
P_t_2=2.*P_iron
P_o_2=P
Eff_2=P_o_2/(P_o_2+P_t_2)
print '(c)max efficieny at unity pf = %.2f %%'%(Eff_2*100)
import numpy as np
#Caption:Find the value of line voltage,line current,and output when the transformer winding is connected as (a) Star-delta (b)delta-star
a=10. ##transformation ratio
V_s=3300. # volts
I_1=10. # amperes
V_1=V_s/np.sqrt(3)
V_2=V_1/a
I_2=np.sqrt(3)*a*I_1
P_o=np.sqrt(3)*V_2*I_2
print "For Star-Delta Configruation"
print 'Line voltage = %.2f volts'%V_2
print 'Line current = %.2f amperes'%I_2
print 'Output = %.2f watts'%P_o
V_2p=V_s/a
V_2L=np.sqrt(3)*V_2p
I_2L=I_1*a/np.sqrt(3)
P_o2=np.sqrt(3)*V_2*I_2
print "For Delta-Star Configruation"
print 'Line voltage = %.2f volts'%V_2L
print 'Line current = %.2f amperes'%I_2L
print 'Output = %.2f watts'%P_o2
import numpy as np
#Caption:Find the Efficiency
P=1200.*1000 # watts
R_1=2.# ohms
R_2=0.03 # ohms
P_iron=20000. # watts
V_1p=6600. # volts
V_2p=1100./np.sqrt(3) # volts
a=V_1p/V_2p
R_o2=R_2+(R_1/a**2) # ohms
I_2p=P/(np.sqrt(3)*1100) # amperes
P_cu=3*R_o2*I_2p**2
P_t=P_iron+P_cu
P_o=0.9*P # watts
Eff=P_o/(P_o+P_t)
print 'Efficiency = %.2f %%'%(Eff*100)
import math as mt
#Caption:Find the percentage resistance,reactance drop,efficiency and voltage regulation
P=1500.*1000 # watts
phy=mt.acos(0.8)*180/mt.pi
V_1P=300 # volts
V_1L=6600 # volts
I_1P=131.21/mt.sqrt(3)
Z_1=V_1P/I_1P # ohms
R_1=30*1000/(3*I_1P**2)
X_1=mt.sqrt((Z_1**2)-(R_1**2))
R=I_1P*R_1*100/V_1L
X=I_1P*X_1*100/V_1L
print '%% Resistance drop = %.2f %%'%R
print '%% Reactance drop = %.2f %%'%X
VR=(R*mt.cos(phy*180/mt.pi))+(X*mt.sin(phy*180/mt.pi))
print 'Voltage regulation = %.2f %%'%VR
I_1_FL=P/(mt.sqrt(3)*V_1L)
P_t=(30+25)*1000 # watts
P_o=P*0.8 # watts
Eff=P_o/(P_o+P_t)
print 'Efficiency = %.2f %%'%(Eff*100)
import numpy as np
#Caption:Determine the (a)KVA Load (b)Percentage rated load (c)Total KVA Rating (d)Ratio of star-star bank to delta-delta bank transformer rating (e)% increase in load
KVA=25.
KVA_s=50./np.sqrt(3)
print '(a)KVA Load supplied by each transformer = %.2f KVA'%KVA_s
r=KVA_s/KVA
print '(b)Percent of rated load = %.2f %%'%r
KVA_t=2*25*0.866
print '(c)Total KVA rating = %.2f KVA'%KVA_t
ratio=KVA_t/75
print '(d)Ratio=%.3f'%ratio
KVA_s2=50./3
Inc=KVA_s/KVA_s2
print '(e)Increase in load = %.2f %%'%(Inc*100)
import numpy as np
#Caption:Determine the (a)Current flowing in various sections (b)Power transformed (c)Power conducted directly
P=400.*1000 # watts
pf=0.8
V_1=550. # volts
V_2=440. # volts
I_2=P/(np.sqrt(3)*V_2*pf)## in amperes
I_1=I_2*V_2/V_1 # amperes
I=I_2-I_1
print '(a)Currents in sections Oa,Ob and Oc = %.2f amperes'%I
print ' Currents in sections Aa,Bb and Cc = %.2f amperes'%I_1
P_trans=P*(1-(V_2/V_1))
print '(b)Power transformed by transformer action = %.2f Kw'%(P_trans/1000)
P_cond=P-P_trans
print '(c)Power Conducted directly = %.2f Kw'%(P_cond/1000)