import cmath
f=50.0; #Assigning values to parameters
Vl=400.0;
Rph=20.0;
L=0.5;
Xl=2*math.pi*f*L;
Zph=20+1j*157;
[r,t]=cmath.polar(Zph);
Vph=Vl/sqrt(3); #Star connection
Iph=Vph/r;
Il=Iph;
P=sqrt(3)*Vl*Il*cos(t);
print"The line current for Star connection is Il=",round(Il,2),"Amperes"
print"The total power absorbed in Star connection is P=",round(P,3),"Watts"
Vph=Vl; #Delta connection
Iph=Vph/r;
Il=sqrt(3)*Iph;
P=sqrt(3)*Vl*Il*cos(t);
print"The line current for Delta connection is Il=",round(Il,2),"Amperes"
print"The total power absorbed in Delta connection is P=",round(P,2),"Watts"
import cmath
f=50 #Assigning values to parameters
rph=8
l=0.02
xl=2*math.pi*f*l
vl=230
f=50
vph=vl/sqrt(3)
zph=8+1j*6.28
[r,t]=cmath.polar(zph)
iph=vph/r
il=iph
p=sqrt(3)*vl*il*cos(t)
q=sqrt(3)*vl*il*sin(t)
s=sqrt(3)*vl*il
print"The line current is il=",round(il,2),"Amperes"
print"The total Power absorbed is P=",round(P,2),"Watts"
print"The reactive volt amperes is q=",round(q,2),"VAR"
print"The Volt amperes is s=",round(s,2),"Volt Ampere"
import cmath
Vl=230; #Assigning values to parameters
f=50;
Rph=15;
L=0.03;
Xl=2*math.pi*f*L;
Zph=15+1j*9.42;
[r,t]=cmath.polar(Zph)
Vph=Vl;
Iph=Vph/r;
Il=sqrt(3)*Iph;
P=sqrt(3)*Vl*Il*cos(t);
print"Phase current is Iph=",round(Iph,2),"Amperes"
print"Line current is Il=",round(Il,1),"Amperes"
print"Power absorbed is=",round(P/1000,2),"KW"
import cmath
f=50#assigning values to the parameters
xc=200
vph=400
vl=vph
zph=14.151-1j*200
[r,t]=cmath.polar(zph)
iph=vph/r
il=sqrt(3)*iph
p=sqrt(3)*vl*il*cos(t)
pwr=vph*iph*cos(t)
c=1.0/(2*math.pi*f*xc)
print"power consumed in each branch of delta is pwr=",round(pwr,2),"Watts"
print"capacitive reactance is c=""{:.2e}".format(c),"Farads"
import cmath
l=50 #Assigning values to parameters
w=800
c=50
xl=w*l
xc=1/(w*c)
z1=0+1j*40
z2=50
z3=0-1j*25
zph=z1+z2*z3/(z2+z3)
[r,t]=cmath.polar(zph)
vl=550
vph=vl
iph=vph/r
il=sqrt(3)*iph
p=sqrt(3)*vl*il*cos(t)
pf=cos(t)
q=sqrt(3)*vl*il*sin(t)
s=sqrt(3)*vl*il
print"The phase current is",round(iph,2),"Amperes"
print"The line current is",round(il,2),"Amperes"
print"The power drawn is",round(p/1000,2),"kw"
print"The power factor is",round(pf,2)
print"The reactive power is",round(q/1000,2),"kw"
print"The kva rating of load is",round(s/1000,2),"KVA"
import cmath
p=10000 #Assigning values to parameters
t=math.acos(0.6)
vl=440
vph=vl
il=p/(sqrt(3)*vl*cos(t))
iph=il/sqrt(3)
zph=vph/iph
zph1=20.9-1j*27.87
res=zph1.real
xc=zph1.imag
q=sqrt(3)*vl*il*sin(t)
print"The resistance value of circuit element is",round(res,2),"ohms"
print"The capacitive value of circuit element is",round(-xc,2),"ohms"
print"The reactive volt-ampere",round(-q/1000,2),"KVAR"
import cmath
f=50 #Assigning values to parameters
vl=440
p=1500
t=math.acos(0.2)
vph=vl/sqrt(3)
il=p/(sqrt(3)*vl*p*cos(t))
iph=il
zph=vph/iph
zph1=5.17+1j*25.3
res=zph1.real
xl=zph1.imag
l=xl/(2*math.pi*f)
print"The resistive circuit constant is",round(res,2),"ohms"
print"The inductive circuit constant is",round(l,2),"H"
import cmath
p=100000 #Assigning values to parameters
il=80
vl=1100
f=50
vph=vl/sqrt(3)
iph=il
zph=vph/iph
t=math.acos(p/(sqrt(3)*vl*il))
zph1=5.21-1j*6
r=zph1.real
xc=zph1.imag
c=1/(2*math.pi*f*xc)
print"The resistive circuit constant is",round(r,2),"ohms"
print"The capacitive circuit constant is",round(-xc,2),"ohms"
print"The capacitance is","{:.2e}".format(-c),"farads"
Vl=400; #Assigning values to parameters
Il=34.65;
P=14.4*10**3;
Vph=Vl;
Iph=Il/sqrt(3);
Zph=Vph/Iph;
t=math.acos(P/(sqrt(3)*Vl*Il))
Z=complex(Zph,t);
a=cmath.rect(Zph,t)
print"Impedance",a,"ohms"
print "Resistance",round(a.real),"ohms"
print "Reactance",round(a.imag),"ohms"
import cmath
vl=415 #assigning values to the parameters
r=15
l=0.1
c=177*10**-6
f=50
vph=vl/sqrt(3)
xl=2*math.pi*f*l
xc=1.0/(2*math.pi*f*c)
a=xl-xc
zph=r+1j*a
[r1,t]=cmath.polar(zph)
iph=vph/r1
il=iph
p=sqrt(3)*vl*il*cos(t)
q=sqrt(3)*vl*il*sin(t)
s=sqrt(3)*vl*il
print"The phase current is",round(iph,1),"Amperes"
print"The line current is",round(il,2),"Amperes"
print"The power drawn is",round(p/1000,2),"KW"
print"The reactive power is",round(q/1000,2),"KVAR"
print"The total kVA is",round(s/1000,2),"KVA"
vl=400 #assigning values to the parameters
t=0
zph=50
vph=vl/sqrt(3)
iph=vph/zph
il=iph
p=sqrt(3)*vl*il*cos(t)
print"Power taken is",round(p,2),"Watts"
iph=4
il=iph
p=vl*il*cos(t)
print"Power taken after disconecting one of the resistor is",round(p,2),"Watts"
vl=400 #Assigning values to parameters
vph=vl
r=40
t=0
iph=vph/r
il=sqrt(3)*iph
p=sqrt(3)*vl*il*cos(t)
print"Power taken is",round(p,2),"Watts"
i=10
p=2*i*i*r
print"Power taken after diconnecting one resistor is",round(p,2),"Watts"
import math
w1=500 #Assigning values to parameters
w2=2500
p=w1+w2
t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))
pf=cos(t)
print"Total Power supplied is",round(p,2),"Watts"
print"Power factor is",round(pf,3)
w2=2500
w1=-500
p=w1+w2
t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))
pf=cos(t)
print"Total Power supplied after reversing the connections to the current coil is",round(p,2),"Watts"
print"Power factor after reversing the connections to the current coil is",round(pf,3)
import math
w1=3000 #Assigning values to parameters
w2=5000
t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))
pf=cos(t)
p=w1+w2
il=p/(sqrt(3)*vl*cos(t))
print"Watts",p,"Total Power supplied is",round(p,2),"Watts"
print"Power factor is",round(pf,2)
print"The line current is",round(il,2),"Amperes"
import math
w1=-1000 #Assigning values to parameters
w2=3000
vl=400
t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))
pf=cos(t)
p=w1+w2
il=p/(sqrt(3)*vl*cos(t))
print"Total Power supplied is",round(p,2),"Watts"
print"Power factor is",round(pf,3)
print"The line current is",round(il,2),"Amperes"
import math
w1=100000 #Assigning values to parameters
w2=300000
vl=2000
n=0.9
t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))
pf=cos(t)
p=w1+w2
il=p/(sqrt(3)*vl*cos(t))
print"Total Power supplied is",round(p,2),"Watts"
print"Power factor is",round(pf,2)
print"The line current is",round(il,2),"Amperes"
vl=220 #Assigning values to parameters
il=38
n=0.88
p=11200
ip=p/n
t=math.acos(ip/(sqrt(3)*vl*il))
a=math.degrees(t)
w2=vl*il*cos(30-a)
w1=vl*il*cos(30+a)
print"The wattmeter reading is w2=",round(w2,2),"Watts"
print"The wattmeter reading is w1=",round(w1,2),"Watts"
# the answer of w2,w1 are wrong in the book
import math
w1=1 #Assigning values to parameters
w2=2*w1
t=math.atan(sqrt(3)*(w2-w1)/(w1+w2))
pf=cos(t)
print"Power factor is",round(pf,3)