import math
#given
b=0.2
a=0.04
n=1000/float(60) #rev/sec
t=500
#case a
#since coil is at right angles ang=0
print "e(t)=0 V"
#case b
#when coil is 30deg to the field ang=60
#p=math.sin(60)
p=0.8660254
e=2*3.14*a*n*b*t*p
print "e(t)=",format(e,'.2f'),"V"
#case c
#when ang=90 that is coil is in the plane of the field
#p=math.sin(90)
p=1
e=2*3.14*b*a*n*p*t
print "e(t)=",format(e,'.2f'),"V"
import math
#given
vm=155
omega=377
#case a
t=(2*3.14)/float(omega)
print "t=",format(t,'.4f'),"sec"
#case b
f=1/float(t)
print "f=",format(f,'.1f'),"Hz"
#case c
v=109.60 #rms value
#at t=0 -77.5=155*sin(ang)
#therefore, ang=-0.5236 rad
ang=-0.5236
t=ang/omega
print "t=",format(t,'.4f'),"sec"
import math
#given
#i=14.14*sin(314t)-->i=im*sin(omega*t)
#case a
im=14.14
i=14.14/1.414 #1.414 is the value of root 2
print "i=",format(i,'.1f'),"A"
#case b
#omega=314=2*3.14*f
f=314/float(2*3.14)
print "f=",format(f,'.1f'),"A"
#case c
t=0.002
#i=im*sin(omega*t)
p=0.01096 #value of sin(omega*t)
i=im*p
print "i=",format(i,'.2f'),"A"
print "NOTE:Answer calculated wrongly in textbook for i obtained here"
import math
i=20
im=i/float(1.414) #that is i*root 2
#the heat produced by i is the sum of heat produced by dc and ac current
p=i**2
q=im**2
r=p+q
I=(r**0.5)
print "I=",format(I,'.3f'),"A"
import math
f=50
irms=10
im=irms/float(0.707)
#omega*t=2*3.14*f*t here the value for t can be substituted and value for i can be found from i=im*sin(omega*t)
t=0.0025
p=0.0137 #value of sin(314*0.0025)
i=(10*p)/float(0.707)
print "i=",format(i,'.1f'),"A"
#maximum value is when 314*t=pi/2 (in radians)-->t=0.005
#hence at t=0.005+0.0125=0.0175 the value of i nedds to be found
p=0.0957
i=(10*p)/float(0.707)
print "i=",format(i,'.1f'),"A"
print "NOTE:The answer given in text is printed wrongly"
i=7.07
#7.07=(10*sin314t)/0.707-->t=0.00833 sec
t=0.00833-0.005 #the time at which the instaneous value is 7.07A after positive maximum value is at this time
print "t=",format(t,'.5f'),"A"
import math
#from graph
a=0
b=5**2
c=10**2
c=20**2
d=40**2
e=50**2
f=40**2
g=20**2
h=10**2
i=5**2
v=(0.1*(a+b+c+d+e+f+g+h+i))**0.5 #pi and omega values get cancelled
print "v=",format(v,'.2f'),"V"
vavg=0.1*(0+5+10+20+40+50+40+20+10+5)
print "vavg=",format(vavg,'.1f'),"v"
ff=v/float(vavg)
print ff
pf=50/float(v) #50 is the maximum value
print pf
v=0.707*50
print "rms value for a sin wave with the same peak value is=",format(v,'.2f'),"V"
import math
#from phasor diagram vac=vab+vbc
hcab=60
vcab=60
hcbc=45
vcbc=77.94 #vbc=60*sin(60)
p=(vcab+hcbc)**2
q=vcbc**2
vac=((p+q)**0.5)
print "vac=",format(vac,'.2f'),"v"
#the angle is given by ang=taninverse(vcbc/(vcab+hcbc))=36.59
print "phase position with respect to vbc=60-36.59=23.41"
import math
#a=6.34+j*13.59
#b=20angle(35)
#case a-->(a+b)
#in polar form a=15 at angle 65
#in rectangular form b=16.38-j*11.47
#a+b=6.34+j13.59+16.38-j11.47=22.72+j2.12
print "a+b=22.72+j2.12"
#a/b=15angle(65)/20angle(-35)=0.75angle(100)=-0.13+j0.74
print "a/b=-0.13+j0.74"
#a-b=-10.04+j25.06
print "Thus (a+b)/(a-b) gives -0.24-j0.81"
#(a+b)*b/(a-b)*a
print "(a+b*b/(a-b)*a)=-1.01+j0.5"
import math
#i1=20*sin(314t+60),i2=-10*sin(314t),i3=15*sin(314t-45)-->angles are in degrees
#I1=(7.7072+j12.25),I2=(-7.072),I3=7.5-j7.5
#adding phasor currents I1,I2 and I3
#I=7.702+j12.25-7.702+7.5-j7.5=7.5+j4.75
print "I=7.5+j4.75. Its value in polar form is obtained as 8.8776 at angle 32.34"
#i=2**0.5*8.8776*sin(314t+32.34)-->instantaneous value of resultant i
print "instantaneous value of resultant i is 12.5548*sin(314t+32.34)"
import math
v=230
f=50
L=50*10**-3
r=10
#case a
xl=2*3.14*f*L
z=complex(r,xl)
#the value of z in polar form is 18.62 ohm
z=18.62
i=v/float(z)
print "i=",format(i,'.2f'),"A"
#case b
#phy=taninverse(xl/r)=57.52 lag
print "phase angle of current=57.52 lag"
import math
vr=150
r=50
l=250*10**-3
f=50
i=vr/r
xl=2*3.14*f*l
vl=i*xl
v=(((vr**2)+(vl**2))**0.5)
print "v=",format(v,'.2f'),"V"
import math
v=200
f=50
r=20
vr=100
vc=144
vl=150
#case a
#from eqn ((vr**2+vl*cos(angle))**2)+((vl*sin(angle))**2)=v**2
#on substituting values in the above eqn the value of angle can be found by isolating cos
#angle=75.52
cos=0.25
pf=(vr+vl*cos)/float(v)
print pf
#case b
i=vr/r
power=i**2*r
print "power consumed=",format(power,'.1f'),"w"
#case c
power=vl*i*cos
print "power consumed in choke oil=",format(power,'.1f'),"W"
import math
r=10
c=10**-4
v=230
f=50
omega=314
#case a
xc=1/float(omega*c)
print "xc=",format(xc,'.2f'),"ohm"
#case b
zc=33.38 #zc=10-j31.85 into polar form is 33.38
i=v/zc
print "i=",format(i,'.2f'),"A"
#case c
pf=r/zc
print pf
#case d
#phase angle=cosinverse(0.3)=72.6
print "phase angle=72.6"
#case e
v=r*i
print "v=",format(v,'.1f'),"v"
v=xc*i
print "v=",format(v,'.1f'),"v"
import math
v=230
f=50
#voltage vr across r is in phase with the current i while voltage vc across c lage i by 90
#from phasor diagram v**2=vr**2+vc**2
vr=100
vc=((v**2)-(vr**2))**0.5
print "vc=",format(vc,'.2f'),"v"
p=500 #power
i=p/vr
c=i/float(2*3.14*f*vc)
print "c=",format(c,'.8f'),"F"
#case b
v=(2**0.5)*vc
print "maximum voltage across c=",format(v,'.2f'),"V"
#case c
#phase angle=cosinverse(vr/v)=cosinverse(0.4348)=64.2
print "phase angle=64.2"
import math
r=8
l=0.15
f=50
v=230
c=125*10**-6
#case a inductive reactance
xl=2*3.14*f*l
print "xl=",format(xl,'.1f'),"ohm"
#case b capacitance reactance
xc=1/float(2*3.14*f*c)
print 'xc=',format(xc,'.2f'),"ohm"
#case c complex impedance
#z=r+j(xl-xc)-->on substituting valuees we get z=8+j21.62
#z=((8**2)+(21.62**2))**0.5
print "complex impedance=8+j21.62 at an impedance angle of 69.7"
#impedance angle=taninverse(xl-xr)/r
#case d
v=230
z=23.05
i=v/z
print "current=",format(i,'.2f'),"A"
#case e
#(r+jxl)*i=446.8 at 10.66 degrees
print "voltage across coil=446.8 at 10.66 degrees"
#-j*xc*i=25.48*9.98
print "voltage across capacitor=-254.29 at -159.7 degrees"
#case e
print 'phase difference between supply and current i is 69.7 lag'
import math
c=50*10**-6
i=2.355
#case a
vl=120
vr=70
vac=150
#the phasor sum of vr and vl is OC;the applied voltage v is the phasor sum of vc and OC and is represented by OV
#the theta be the impedance angle of RL combination
#from right angled triangle OCD,theta can be determined as follows:
#(vr+vl*costheta)**2+(vl*costheta)**2=vac**2
#substitute the values then value of costheta can be found
zl=vl/i #impedance of the coil
p=0.981 #value of sin(79)
xl=zl*p
q=0.19 #value of cos(79)
r=zl*q
dc=i*xl
bd=i*r
#from right angled triangle ODB in fig.
v=98.3
xc=vac/i
print "capacitive reactance=",format(xc,'.1f'),"ohm"
f=1/float(xc*2*3.14*c)
print "f=",format(f,'.1f'),"cycles/sec"
ploss=i**2*r
print "power loss in iron cored choke is=",format(ploss,'.2f'),"w"
import math
r=20
l=200*10**-3
v=230
f=50
xl=314*l #314 is omega
ir=v/float(r)
il=v/float(xl)
i=((ir**2)+(il**2))**0.5
print "i=",format(i,'.2f'),"A"
import math
r=100
c=50*10**-6
f=50
v=230
#case a
xc=-1/float(314*c) #314 is omega
ir=v/r #with angle 0
ic=230/float(xc) #with angle of 90 deg
i=((ir**2)+(ic**2))**0.5
print "current with a lead of 57.5 is obtained as=",format(i,'.2f'),"A"
import math
r=100
l=0.1
c=150*10**-6
v=230
f=50
#case a
xl=314*l #at 90 deg
xc=1/float(314*c) #at lag -90 deg
ir=v/r #at 0 deg
il=v/xl
ic=v/xc
#i=ir+ic+il-->2.3+j3.51
i=((2.3**2)+(3.51**2))**0.5
print "current at 56.76 lead=",format(i,'.3f'),"A"
import math
z1=18.03 #z1=10+j15 converted to polar form also it is at angle 56.31
z2=32.02
z3=10.77
#ybc=1/zbc=(1/z2+1/z3)=1/32.02+1/10.77
#on performing the add operation we get the value of zbc as 8.159-j9.553 that is in rectangular form
print "The value of zbc is 8.159-j9.553"
#thus total impedance between terminals A and C is given by zac=z1+zbc
print "zac=18.159+j5.447(in rectangular form)"
import math
r1=25
l1=0.159
r2=60
c=125*10**-6
v=230
f=50
#case a
xl=2*3.14*f*l1
z1=((r1**2)+(xl**2))**0.5
i1=v/z1
#phy1=cosinverse(r1/z1)=63.43 lag
xc=1/float(2*3.14**c)
z2=((r2**2)+(xc**2))**0.5
i2=v/z2
#i2 has 23 deg lead calculated similar to i1
#p=cosphy1
#q=cosphy2
p=0.44
q=0.92
I1=i1*p+i2*q
a=-0.89
b=0.39
I2=i1*a+i2*b
I=((I1**2)+(I2**2))**0.5
print "I=",format(I,'.2f'),"A"
#case b
z=v/I
print "z=",format(z,'.2f'),"ohm"
R=(z*I1)/I #note the value of I in text is printed wrongly so the result may vary
print "R=",format(R,'.2f'),"ohm"
x=(z*I2)/I #same note applicable here as well
print "x=",format(x,'.2f'),"ohm"
import math
#given
#z1=15+j20
#z2=8-j10
I=20
z1=25 #in polar form at angle 53.13
z2=12.81 #at angle -51.34
#v=I1z1=I2z2
#I2=1.95I1
#from diagram I**2=(I1cosang1+I2cosang2)**2+(I2sinang2-I1sinang1)**2
#on substituting values in the above eqn and simplifying
I1=6.78
print "I1=6.78A"
I2=13.22
#substitute this in I2=1.95I1
print "I2=13.22A"
pow1=I1**2*15
pow2=I2**2*8
print "power loss in z1=",format(pow1,'.2f'),"W"
print "power loss in z2=",format(pow2,'.2f'),"W"
import math
r=25
f=50
xl=20
v=230
#case a
#z1=r+jxl
z1=32 #in polar form
i1=v/float(z1)
print "i1=",format(i1,'.2f'),'A'
#case b
print "current lags by voltage 38.66"
#case c
p=0.78 #cos value
q=-0.62 #sin value
ir=i1*p
il=i1*q
#from phasor diagram current c is equal to il
ic=il=4.491
c=ic/float(v*2*3.14*50)
print "c=",format(c,'.8f'),"F"
#case d
print "ir=",format(ir,'.3f'),"A"
import math
z1=complex(6,-10)
z2=complex(10,15)
z3=complex(18,12)
#z1+z2 is parallel to z3
zab=z1+(z2*z3)/(z2+z3)
print zab
print "the phase angle is -12.11"
import math
r=8
l=0.05
v=230
f=50
#case a
xl=2*3.14*f*l
zl=complex(r,xl)
zl=17.62
i=v/zl #since v=230 at angle 0 and zl in polar form has 63 deg i has a lag of 63
print "current at -63 lag is=",format(i,'.2f'),'A'
#case b
print "phase angle between supply voltage and current is -63"
#case c
power=v*i
print "power=",format(power,'.1f'),"VA"
#case d
p=0.45 #cos63
actpow=v*i*p
print "active power=",format(actpow,'.1f'),"W"
#case e
q=0.89 #sin63
reapow=v*i*q
print 'reactive power=',format(reapow,'.1f'),"VAR"
import math
v=230
f=50
pf=0.7
n=0.8
op=7500
#case a
ip=op/float(0.7*0.8)
print "input=",format(ip,'.2f'),"VA"
#case b
im=ip/v
p=0.71 #sin
activecompo=im*pf
print "active component=",format(activecompo,'.2f'),"A"
reacompo=p*im
print "reactive component=",format(reacompo,'.2f'),"A"
#case c
reacpow=p*ip
print "reactive power=",format(reacpow,'.1f'),"VAR"
#case d
cos=0.95
i=activecompo/cos
isin=13.40 #i*sinang=i*(1-cos**2)**0.5ic=28.18 #since i=ic+im
c=ic/float(2*3.14*f*v)
print "c=",format(c,'.8f'),"F"
import math
#case a
l=0.25
f=50
v=230
r=2
c=1/float(((2*3.14*f)**2)*l)
print "c=",format(c,'.8f')
#case b
i=v/r
print "i=",format(i,'.1f'),"A"
#case c
vl=2*3.14*f*l*i
vc=i/float(c*2*3.14*f)
q=(2*3.14*f*l)/float(r)
print q
import math
l=10
r=100
i=1
f=100
i1=0.5
c=1/float(4*(3.14**2)*(r**2)*l)
v=i*r
z=v/i1
#z=100+jX
x=((200**2)-(100**2))**0.5
omega=641.1 #angular frequency in rad/sec
f0=omega/float(2*3.14)
f1=f0-(r/float(4*3.14*l))
f2=f0+(r/float(4*3.14*l))
print "f0=",format(f0,'.4f'),"Hz"
print "f1=",format(f1,'.4f'),"Hz"
print "f2=",format(f2,'.4f'),"Hz"
import math
v=3*10**8
lamb=3000
c=0.0005*10**-6
f=v/lamb
l=1/float(4*3.14*3.14*f**2*c)
print "l=",format(l,'.5f'),"H"
import math
r=1500
l=0.2
v=1.5
f=15000
#case a
#p=1/0.2c
p=(4*3.14*3.14*f**2)+(r**2)/float(l**2)
c=1/float(0.2*p)
print "c=",format(c,'.13f'),"F"
#case b
z=l/float(c*r)
print "z=",format(z,'.1f'),"ohm"
#case c
i=v/float(z)
print "i=",format(i,'.7f'),"A"
import math
#the eqns are formed using the given diagram
#the derivations from the eqns are obtained as below using matrices for their construction
#the below eqns are in polar form
delta=0.3165
delta1=5.95
delta2=6.82
v1=delta1/delta
print "v1 at -47.63 is=",format(v1,'.2f'),"V"
v2=delta2/delta
print "v2 at -42.30 is=",format(v2,'.2f'),"V"
import math
#in polar form
z1=10
z2=12.806
z3=13.416
#the mesh currents are written in matrix form
delta=329.31 #in polar form
delta1=360
delta2=793.22
i1=delta1/delta
i2=delta2/delta
i=i1-i2 #answer obtained in text is wrongly printed
print "i at -84.21 is=",format(i,'.2f'),"V"
import math
#superposition theorem
r=4
#z=4+(8+6j)*(0-j10)/8+j6+0-j10
#z=14-j5
z=14.87
l=40
#I1a=z/l=2.69 in polar form
I1a=complex(2.533,0.904)
I2a=complex(-0.324,-2.67)
#from fig c
z=complex(2.93,-9.47)
I1b=complex(-0.895,3.935)
I2b=complex(1.056,-2.474)
I1=I1a+I1b
print I1
I2=I2a+I2b
print I2
I=I1+I2
print I
import math
#thevenin's theorem
#all the values are derived from the figures
z1=complex(8,-6)
z2=complex(0,5)
zth=(z1*z2)/(z1+z2)
print zth
vth=complex(-17.71,141.54)
zload=complex(4,3)
I=vth/(zth+zload)
print I
import math
#norton's theorem
#values derived and calculated from figure
v=complex(230,0)
xl=complex(8,-6)
isc=v/xl
IN=isc
rl=complex(0,5)
zn=(rl*xl)/(rl+xl)
zload=complex(4,3)
I=(IN*zn)/(zn+zload)
print I
import math
#all values derived from figure
#zth=complex(0.923,2.615)
#vth=complex(-4.615,-6.923) #derived using formula
#zl=complex(0.923,-2.615)
#z=zl+zth
vth=8.32 #polar form
z=1.846
I=vth/z
print "I=",format(I,'.2f'),"A"
rl=0.923
pl=(I**2)*rl
print "pl=",format(pl,'.2f'),"w"