A=500*10**-4 # m**2
B_max=1.5 # tesla
f=50 # Hz
E_1=5000 # volts
E_2=500 # volts
S_f=0.85 # Stacking factor
N_1=int(E_1/(4.44*f*B_max*A*S_f))
print '(a)Number of turns in primary winding = %d'%N_1
N_2=int(E_2*N_1/E_1)
print ' Number of turns in secondary winding = %d'%N_2
print '(b)Emf per turn = %.2f Volts'%(E_1/N_1)
B_max=1.4 # tesla
f=50 # Hz
E_1=660 # volts
E_2=440 # volts
E_T1=1.1 # volts
N_1=int(E_1/E_T1)
print '(a)Number of turns in primary winding = %d'%N_1
N_2=int(E_2*N_1/E_1)
print ' Number of turns in secondary winding = %d'%N_2
A=E_1/(4.44*f*N_1*B_max)
print '(b)Cross section area of the core = %.2e m**2'%A
Phy_max=7.82*10**-3 # webers
f=50 # Hz
E_1=5000 # volts
E_2=500 # volts
N_1=int(E_1/(4.44*f*Phy_max))
print 'Number of turns in primary winding = %d'%N_1
N_2=int(E_2*N_1/E_1)
print 'Number of turns in secondary winding = %d'%N_2
f=50 # Hz
E_1=2500 # volts
N_1=500
N_2=100
P=50*1000 # watts
E_2=E_1*N_2/N_1
print '(a)Secondary Voltage = %.2f volts'%E_2
I_1=P/E_1
print '(b)Primary current = %.2f amperes'%I_1
I_2=P/E_2
print ' Secondary current = %.2f amperes'%I_2
Phy_max=E_1/(4.44*f*N_1)
print '(c)Max value of flux = %.2f Wb'%Phy_max
from math import sqrt
f=50 # Hz
W=80 # watts
V=4400 # volts
I=0.04 # amperes
pf=W/(V*I)
print '(a)No load power factor = %.3f'%pf
I_w=I*pf
print '(b)Iron loss component of current = %.2f amperes'%I_w
I_m=I*sqrt(1-pf**2)
print '(c)Magnetising component of current = %.2f amperes'%I_m
from math import sqrt
f=50 # Hz
P=20*1000 # watts
E_1=2200 # volts
E_2=220 # volts
I=1.3 # amperes
I_w=0.5 # amperes
W=E_2*I_w
print '(a)No load input power = %.2f watts'%W
pf=I_w/I
print '(b)No load power factor = %.2f'%pf
I_m=I*sqrt(1-pf**2)
print ' Magnetising component of current = %.2f amperes'%I_m
from math import sqrt
f=50 # Hz
P=30*1000 # watts
E_1=3000 # volts
E_2=300 # volts
R_1=2.5 # ohms
R_2=0.018 # ohms
X_1=3.8 # ohms
X_2=0.052 # ohms
a=E_1/E_2
R1=R_1+a**2*R_2
X1=X_1+a**2*X_2
Z1=sqrt(R1**2+X1**2)
print '(a)Equivalent resistance reffered to high voltage side = %.2f ohms'%R1
print ' Equivalent reactance reffered to high voltage side = %.2f ohms'%X1
print ' Equivalent impedance reffered to high voltage side = %.2f ohms'%Z1
R2=R_1/a**2+R_2
X2=X_1/a**2+X_2
Z2=sqrt(R2**2+X2**2)
print '(b)Equivalent resistance reffered to low voltage side = %.2f ohms'%R2
print ' Equivalent reactance reffered to low voltage side = %.2f ohms'%X2
print ' Equivalent impedance reffered to low voltage side = %.2f ohms'%Z2
I_1=P/E_1
I_2=P/E_2
P_cu=I_1**2*R1
print '(c)Total copper loss of transformer = %.2f watts'%P_cu
from math import sqrt
a=400./200
I_o_Lv=2 # amperes
I_o_Hv=I_o_Lv/a # amperes
V_o=400 # volts
P_occ=90 # watts
pf=P_occ/(V_o*I_o_Hv)
I_w=I_o_Hv*pf
print 'I_w = %.2f Amperes'%I_w
I_m=I_o_Hv*sqrt(1-pf**2)
print 'Magnetising current I_m = %.2f Amperes'%I_m
R_o=V_o/I_w
print 'R_o = %.2f ohms'%R_o
X_o=V_o/I_m
print 'Magnetizing reactance X_o = %.2f ohms'%X_o
V_sc=20 # volts
I_sc=10 # amperes
P_sc=100 # watts
Z_o1=V_sc/I_sc
R_o1=P_sc/I_sc**2
print 'Effective resistance reffered to primary side = %.2f ohms'%R_o1
X_o1=sqrt(Z_o1**2-R_o1**2)
print 'Effective reactance reffered to primary side = %.2f ohms'%X_o1
from math import sqrt
V1=460 # volts
V2=230 # volts
a=V1/V2
R1=0.4 # ohms
R2=0.1 # ohms
X1=0.5 # ohms
X2=0.12 # ohms
R_o=650 # ohms
X_o=250 # ohms
I_w=V1/R_o
I_m=V1/X_o
P_occ=V1*I_w
print 'Readings of transformer for OC test'
print 'Voltage Reading = %.2f volts'%V1
print 'Current Reading = %.2f Amperes'%(sqrt(I_w**2+I_m**2))
print 'Power output reading = %.2f watts'%P_occ
R_O1=R1+a**2*R2
X_O1=X1+a**2*X2
Z=sqrt(R_O1**2+X_O1**2)
I=4000/V1
V_sc=I*Z
P_sc=I**2*R_O1
print 'Readings of transformer for SC test'
print 'Voltage Reading = %.2f volts'%V_sc
print 'Current Reading = %.2f Amperes'%I
print 'Power output reading = %.2f watts'%P_sc
from math import sqrt
V1=300 # volts
I_o=0.8 # amperes
W_o=70 # watts
pf=W_o/(V1*I_o)
I_w=I_o*pf
I_m=I_o*sqrt(1-pf**2)
R_O=V1/I_w
X_O=V1/I_m
a=300.0/600
V_sc=20.0 # volts
I_sc=12.0 # amperes
P_sc=90.0 # watts
Z_O2=V_sc/I_sc
R_O2=P_sc/I_sc**2
X_O2=sqrt(Z_O2**2-R_O2**2)
R_O1=a**2*R_O2
X_O1=a**2*X_O2
I_2=6000/(600*0.8)
V2=I_2*(R_O2*pf+X_O2*sqrt(1-pf**2))
print 'R_O = %.2f ohms'%R_O
print 'X_O Magnetising reactance = %.2f ohms'%X_O
print 'Equivalent Resistance reffered to LV Side = %.2f ohms'%R_O1
print 'Equivalent Reactance reffered to LV Side = %.2f ohms'%X_O1
print 'Secondary Terminal Voltage = %.2f volts'%(600-V2)
from math import sqrt
V1=200 # volts
I_o=0.8 # amperes
W_o=80 # watts
pf=W_o/(V1*I_o)
I_w=I_o*pf
I_m=I_o*sqrt(1-pf**2)
R_O=V1/I_w
X_O=V1/I_m
a=200.0/400
V_sc=25.0 # volts
I_sc=10.0 # amperes
P_sc=90.0 # watts
Z_O2=V_sc/I_sc
R_O2=P_sc/I_sc**2
X_O2=sqrt(Z_O2**2-R_O2**2)
R_O1=a**2*R_O2
X_O1=a**2*X_O2
I_2=12
I_1=I_2/a
V2=sqrt((V1*pf+I_1*R_O1)**2+(V1*sqrt(1-pf**2)+I_1*X_O1)**2)
P_iron=80 # watts
P_cu=(12.0/10)**2*90
P_total=P_cu+P_iron
Eff=6000*0.8/(6000*0.8+P_total)
print 'R_O = %.2f ohms'%R_O
print 'X_O Magnetising reactance = %.2f ohms'%X_O
print 'Equivalent Resistance reffered to LV Side = %.2f ohms'%R_O1
print 'Equivalent Reactance reffered to LV Side = %.2f ohms'%X_O1
print 'Efficiency = %.2f %%'%(Eff*100)
from math import sqrt
V1=2000 # volts
pf=0.8
I1=10000/V1 # amperes
P_iron=60 # watts
V_sc=40 # volts
I_sc=4 # amperes
a=2000.0/200
P_sc=70 # watts
Z_O1=V_sc/I_sc
R_O1=P_sc/I_sc**2
X_O1=sqrt(Z_O1**2-R_O1**2)
R_O2=R_O1/a**2
X_O2=X_O1/a**2
I2=I1*a/2 # At half load
Del_V=I2*(R_O2*pf+X_O2*sqrt(1-pf**2))
V2=200-Del_V
P_o=V2*I2*pf # watts
P_cu=(2.5/4)**2*P_sc # At half load
Eff=0.5*P_o/(0.5*P_o+P_iron+P_cu)
print '(a)Efficiency = %.2f %%'%(Eff*100)
I_1=sqrt(P_iron/R_O1)
KVA_Load=10*I_1/5
print '(b)Load KVA at which max efficiency occurs = %.2f'%KVA_Load
Eff_max=P_o/(P_o+P_iron+P_iron)
print ' Max Efficiency = %.2f %%'%(Eff_max*100)
I_2=50 # at full load
VR=(I_2*(R_O2*pf-X_O2*sqrt(1-pf**2)))/200
print '(c)Voltage Regulation = %.2f %%'%(VR*100)
P=120*1000 # watts
V1=2400 # volts
V2=240 # volts
I1=P/V1 # amperes
I2=P/V2 # amperes
KVA_1=V1*(I1+I2)/1000
P_trans=V2*I2/1000
P_cond_1=KVA_1-P_trans
P_loss_1=((1/0.98)-1)**2*P_trans
Eff_a=1-(P_loss_1/KVA_1)
print 'KVA Rating of transformer with additive polarity = %.2f KVA'%KVA_1
print 'Efficiency of auto transformer with additive polarity = %.2f %%'%(Eff_a*100)
KVA_2=V1*(I2-I1)/1000
P_trans=V2*I2/1000
P_cond_2=KVA_2-P_trans
P_loss=((1/0.98)-1)**2*P_trans
Eff_s=1-(P_loss/KVA_2)
print 'KVA Rating of transformer with subtractive polarity = %.2f KVA'%(KVA_2)
print 'Efficiency of auto transformer with subtractive polarity = %.2f %%'%(Eff_s*100)
from math import sqrt
a=0.5
V1=200 # volts
I_o=0.8 # amperes
W_o=75 # watts
pf=W_o/(V1*I_o)
pf2=0.8
R_O=V1/(I_o*pf)
X_O=V1/(I_o*sqrt(1-pf**2))
V_sc=20 # volts
I_sc=10 # amperes
P_sc=90 # watts
Z_O2=V_sc/I_sc
R_O2=P_sc/I_sc**2
X_O2=sqrt(Z_O2**2-R_O2**2)
R_O1=a**2*R_O2
X_O1=a**2*X_O2
I_2=4000/400 # amperes
VR=I_2*(R_O2*pf2+X_O2*sqrt(1-pf2**2))/400
print 'R_O = %.2f ohms'%R_O
print 'X_O Magnetising reactance = %.2f ohms'%X_O
print 'Equivalent Resistance reffered to LV Side = %.2f ohms'%R_O1
print 'Equivalent Reactance reffered to LV Side = %.2f ohms'%X_O1
print 'Voltage Regulation at full load = %.2f %%'%(VR*100)
P_o=(400-I_2*(R_O2*pf2+X_O2*sqrt(1-pf2**2)))*I_2*pf2
P_i=75 # watts
P_cu=P_sc
P_cu_h=0.5**2*P_cu
Eff=P_o/(P_o+P_i+P_cu)
print 'Efficiency at full load = %.2f %%'%(Eff*100)
P_o_h=(400-I_2*0.5*(R_O2*pf2+X_O2*sqrt(1-pf2**2)))*I_2*0.5*pf2
Eff_h=P_o_h/(P_o_h+P_i+P_cu_h)
print 'Efficiency at half load = %.2f %%'%(Eff_h*100)
from math import sqrt
a=0.5
V1=250 # volts
I_o=1.2 # amperes
W_o=80 # watts
pf=W_o/(V1*I_o)
pf2=0.8
R_O=V1/(I_o*pf)
X_O=V1/(I_o*sqrt(1-pf**2))
V_sc=25 # volts
I_sc=10 # amperes
P_sc=95 # watts
Z_O2=V_sc/I_sc
R_O2=P_sc/I_sc**2
X_O2=sqrt(Z_O2**2-R_O2**2)
R_O1=a**2*R_O2
X_O1=a**2*X_O2
I_2=6000/500 # amperes
VR=I_2*(R_O2*pf2+X_O2*sqrt(1-pf2**2))/500
VR_h=0.5*I_2*(R_O2*pf2+X_O2*sqrt(1-pf2**2))/500
print 'R_O = %.2f ohms'%R_O
print 'X_O Magnetising reactance = %.2f ohms'%X_O
print 'Equivalent Resistance reffered to LV Side = %.2f ohms'%R_O1
print 'Equivalent Reactance reffered to LV Side = %.2f ohms'%X_O1
print 'Voltage Regulation at full load = %.2f %%'%(VR*100)
print 'Voltage Regulation at half load = %.2f %%'%(VR_h*100)
P_o=(500-I_2*(R_O2*pf2+X_O2*sqrt(1-pf2**2)))*I_2*pf2
P_i=80 # watts
P_cu=(12/10)**2*P_sc
P_cu_h=0.5**2*P_cu
Eff=P_o/(P_o+P_i+P_cu)
print 'Efficiency at full load = %.2f %%'%(Eff*100)
P_o_h=(500-I_2*0.5*(R_O2*pf2+X_O2*sqrt(1-pf2**2)))*I_2*0.5*pf2
Eff_h=P_o_h/(P_o_h+P_i+P_cu_h)
print 'Efficiency at half load = %.2f %%'%(Eff_h*100)
I_2=200 # amperes
R_O2=0.008 # ohms
x=0.75
P_cu=x**2*I_2**2*R_O2 # watts
P_i=190 # watts
KVA=40
P_o=40*1000 # watts
Eff=P_o/(P_o+P_i+I_2**2*R_O2)
Eff_2=KVA*1000*0.8/(KVA*1000*0.8+P_i+I_2**2*R_O2)
print '(a)Efficiency of transformer at full load and at unity power factor = %.2f %%'%(Eff*100)
print '(b)Efficiency of transformer at full load and at 0.8 power factor = %.2f %%'%(Eff_2*100)
Eff_3=x*P_o/(x*P_o+P_i+P_cu)
Eff_4=x*P_o*0.8/(x*0.8*P_o+P_i+P_cu)
print '(a)Efficiency of transformer at 75%% of load and at unity power factor = %.2f %%'%(Eff_3*100)
print '(b)Efficiency of transformer at 75%% of load and at 0.8 power factor = %.2f %%'%(Eff_4*100)
from math import sqrt
KVA=20
P_i=250.0 # watts
P_cu=500 # watts
x=sqrt(P_i/P_cu)
print '(a)Max efficiency will occur at : %.2f'%(x*100),
print 'Percent of full load'
P_o=x*KVA*1000
Eff=P_o/(P_o+P_i+P_i)
print ' Maximum Efficiency = %.2f %%'%(Eff*100)
P_cu_n=(P_i+P_cu)/(0.85**2+1)
P_i_n=P_i+P_cu-P_cu_n
print '(b)Core Loss = %.2f watts'%P_i_n
print ' Copper Loss = %.2f watts'%P_cu_n
from math import sqrt
a=1000.0/200
R_1=0.25 # ohms
R_2=0.018 # ohms
R_O2=R_2+R_1/a**2
P_i=240 # watts
I_2=sqrt(P_i/R_2)
print 'The secondary current at which max efficiency will occur = %.2f Amperes'%I_2
P_o=200*I_2*0.8 # watts
P_t=2*P_i # watts
Eff=P_o/(P_o+P_t)
print 'Max efficiency at 0.8pf lagging = %.2f %%'%(Eff*100)
from math import sqrt
KVA=150
pf=0.8
Eff=0.96
P_o=KVA*1000*pf # watts
P_cu=P_o*((1/Eff)-1)*(1-0.5)*4/3
P_i=4999.9-P_cu
print '(a)Iron Loss = %.2f watts'%P_i
print '(b)Copper Loss at full load = %.2f watts'%P_cu
x=sqrt(P_i/P_cu)
print '(c)Load KVA at which maximum efficiency occurs = %.2f KVA'%(x*KVA)
Eff_max=x*KVA*1000*0.8/(x*KVA*1000*0.8+2*P_i)
print '(d)maximum efficiency of transformer at 0.8pf lagging = %.2f %%'%(Eff_max*100)
from math import sqrt
KVA=100
P_cu=1200 # watts
P_i=960 # watts
x1=1
pf1=1
P_o_1=x1*KVA*pf1*1000
Eff_1=P_o_1/(P_o_1+P_i+x1**2*P_cu)
print '(a)Efficiency at full load and at unity power factor = %.2f %%'%(Eff_1*100)
x2=0.5
pf2=0.8
P_o_2=x2*KVA*1000*pf2
Eff_2=P_o_2/(P_o_2+P_i+x2**2*P_cu)
print '(b)Efficiency at half load and at 0.8 power factor = %.2f %%'%(Eff_2*100)
x3=0.75
pf3=0.7
P_o_3=x3*KVA*1000*pf3
Eff_3=P_o_3/(P_o_3+P_i+x3**2*P_cu)
print '(c) Efficiency at 75 percent of load and 0.7 power factor = %.2f %%'%(Eff_3*100)
KVA_max=KVA*sqrt(P_i/P_cu)
print '(d)load KVA at which maximum efficiency will occcur = %.2f KVA'%(KVA_max)
Eff_max=KVA_max*1000*0.85/(KVA_max*1000*0.85+2*P_i)
print '(e)maximum efficiency at 0.85 power factor = %.2f %%'%(Eff_max*100)
from math import sqrt
KVA=100
V2=11000 # volts
x1=1
x2=0.5
pf1=0.8
pf2=1
Eff_1=0.985
Eff_2=0.99
P_cu=(KVA*1000*x1*pf1*((1/Eff_1)-1)-x2*KVA*1000*((1/Eff_2)-1))*(4/3) # in watts
P_i=1218-P_cu # in watts
I_fl=KVA*1000/V2
I_2=I_fl*sqrt(P_i/P_cu)
print 'Copper loss = %.2f watts'%P_cu
print 'Core loss = %.2f watts'%P_i
print 'Load current = %.2f amperes'%I_2
from math import sqrt
P_o=500 # watts
Eff_fl=0.9
Eff_hl=0.9
P_cu=(((P_o-0.5*P_o)/Eff_fl)-0.5*P_o)*4/3 # in watts
P_i=0.5*P_cu # in watts
Eff=P_o*0.75/(P_o*0.75+P_i+0.75**2*P_cu)
print 'Efficiency of transformer at 75 percent of full load = %.2f %%'%(Eff*100)
P_o_max=P_o*sqrt(P_i/P_cu)
Eff_max=P_o_max/(P_o_max+P_i+P_i)
print 'Maximum efficiency = %.2f %%'%(Eff_max*100)
KVA=100.0
P_i=1300 # watts
P_cu=1200 # watts
pf=1
Eff_fl=KVA*1000*pf/(KVA*1000*pf+P_i+P_cu)
print 'Efficiency of transformer at full load = %.2f %%'%(Eff_fl*100)
Eff_hl=KVA*1000*0.5*pf/(KVA*0.5*1000*pf+P_i+0.25*P_cu)
print 'Efficiency of transformer at half load = %.2f %%'%(Eff_hl*100)
from math import sqrt
KVA=100
Eff_max=0.98
x=0.8
pf=0.8
P_o=x*KVA*1000*pf # watts
P_i=(P_o-P_o*Eff_max)/(2*Eff_max) # watts
P_cu=P_i/x**2
R_equ=P_cu/(KVA*1000)
Z_equ=0.05
X_equ=sqrt(Z_equ**2-R_equ**2)
VR=R_equ*pf+X_equ*sqrt(1-pf**2)
print 'Voltage Regulation = %.2f %%'%(VR*100)
from math import sqrt
KVA=20
V1=1100 # volts
V2=220 # volts
a=V1/V2
P_i=175 # watts
R1=0.25 # ohms
R2=0.012 # ohms
X1=1.1 # ohms
X2=0.055 # ohms
R_O2=R2+R1/a**2
X_O2=X2+X1/a**2
I2=KVA*1000/V2
V_r=I2*R_O2*100/V2
print 'Percentage Resistance drop = %.2f %%'%V_r
V_re=I2*X_O2*100/V2
print 'Percentage Reactance drop = %.2f %%'%V_re
P_cu=I2**2*R_O2
x=sqrt(P_i/P_cu)
print 'Max Efficiency will occur at : %.2f'%(x*100),
print 'percent of full load'
from math import sqrt
KVA=500
V2=500 # volts
x=0.75
pf=1
Eff_max=0.97
P_i=(KVA*x*1000*pf-KVA*x*1000*pf*Eff_max)/(2*Eff_max) # watts
P_cu=P_i/x**2
R_equ=P_cu/(KVA*1000)
X_equ=sqrt(0.1**2-R_equ**2) # ohms
VR=R_equ*0.8+X_equ*0.6
print 'Voltage Regulation = %.2f %%'%(VR*100)
KVA=25
P_iron=350 # watts
#For max efficiency P_iron=P_cu
P_cu=P_iron
print 'Iron loss = %.2f watts'%P_iron
print 'Copper Loss = %.2f watts'%P_cu
Eff=KVA*1000/(KVA*1000+P_iron+P_cu)
print 'Maximum Efficiency = %.2f %%'%(Eff*100)
from math import sqrt
P_i=100 # watts
V2=400 # volts
P_sc=200 # watts
I_2=11.4 # amperes
R_O2=P_sc/I_2**2 # ohms
KVA=5
I_2fl=KVA*1000/V2
P_cu=I_2fl**2*R_O2
pf=0.9
Eff=KVA*1000*pf/(KVA*1000*pf+P_cu+P_i)
print 'Efficiency = %.2f %%'%(Eff*100)
V_2sc=40 # volts
Z_O2=V_2sc/I_2
X_O2=sqrt(Z_O2**2-R_O2**2)
VR=I_2fl*(R_O2*pf+X_O2*sqrt(1-pf**2))/V2
print 'Voltage Regulation = %.2f %%'%(VR*100)