#Chapter-8,Example8_1,pg 8_6
#calculate the values of resistances and change in R2
#given
Rh=1000.
Rm=50.
V=3.
Ifsd=1*10**-3
#calculations
R1=Rh-(Ifsd*Rm*Rh)/V
R2=(Ifsd*Rm*Rh)/(V-Ifsd*Rh)
#results
print"R1 (ohm) = ",round(R1,2)
print"R2 (ohm) = ",R2
#due to 5% voltage drop
V=V-0.05*V
R2=(Ifsd*Rm*Rh)/(V-Ifsd*Rh)
print"change in value R2 (ohm) = ",round(R2,3)
#Chapter-8,Example8_2,pg 8_18
#calculate the unknown resistance
#given
R1=10.*10**3
R2=2.*10**3
R3=5.*10**3
#R4=Rx
#calculations
R4=(R1*R3)/R2
#results
print"unknown resistance (kohm) = ",R4/1000.
#Chapter-8,Example8_3,pg 8_18
#calculate the current
#given
R1=7.*10**3
R2=2.*10**3
R3=4.*10**3
R4=20.*10**3
E=8.
Rg=300.
#calculations
Vth=(E*R4/(R3+R4))-(E*R1 /(R1+R2))#voltage divider rule
Req=(R1*R2/(R1+R2))+(R3*R4/(R3+R4))
Ig=Vth/(Req+Rg)
#results
print"current through galvanometer (muA) = ",round(Ig*10**6,2)
#Chapter-8,Example8_4,pg 8_25
#calculate the unknown resistance
#given
R3=100.03*10**-6
R2=100.24
R1=200.
b=100.31
a=200.
Ry=700*10**-6
#calculations
Rx=R1*R3/R2
Rx=Rx+(b*Ry/(Ry+a+b))*((R1/R2)-(a/b))
#results
print"unknown resistance (muohm) = ",round(Rx*10**6,3)
#Chapter-8,Example8_5,pg 8_35
#calculate the unknown impedance
#given
import math,cmath
Z2=250.
Z3=200.
Z1=50.
theta1=80.
theta2=0.
theta3=30.
#calculations
Z4=Z2*Z3/Z1#magnitude condition
theta4=theta2+theta3-theta1#angle condition
theta4=theta4*math.pi/180#in radians
Rx=Z4*math.cos(theta4)#real part
Ry=Z4*math.sin(theta4)#imag. part
Z4=Rx+1j*Ry
#results
print"unknown impedance (ohm) = ",Z4
#Chapter-8,Example8_6,pg 8_35
#calculate the angles and find if magnitude and angle conditions are satisfied
import math
from math import sin,cos,sqrt
#given
Z1=sqrt(((50*cos(40*math.pi/180))**2)+(50*sin(40*math.pi/180))**2)#angle in radians
Z2=sqrt(((100*cos(-90*math.pi/180))**2)+(100*sin(-90*math.pi/180))**2)
Z3=sqrt(((15*cos(45*math.pi/180))**2)+(15*sin(45*math.pi/180))**2)
Z4=sqrt(((30*cos(30*math.pi/180))**2)+(30*sin(30*math.pi/180))**2)
#mag(Z1*Z4)=mag(Z2*Z3)....magnitude condition
#calculations and results
magl=Z1*Z4#lhs
magr=Z2*Z3#rhs
print"magl= ",magl
print"magr= ",magr
print"lhs=rhs hence,magnitude condition is satisfied "
theta1=40.
theta2=-90.
theta3=45.
theta4=30.
#theta1+theta4=theta2+theta3.......angle condition
thetal=theta1+theta4#lhs
thetar=theta2+theta3#rhs
print"thetal= ",thetal
print"thetar= ",thetar
print"angle condition is not satisfied "
#Chapter-8,Example8_7,pg 8_37
#calculate the equivalent series circuit
#given
C3=10.*10**-6
R1=1.2*10**3
R2=100.*10**3
R3=120.*10**3
#calculations
Rx=R2*R3/R1
Cx=R1*C3/R2
#results
print"equivalent series circuit "
print"Rx (Mohm) = ",Rx/10**6
print"Cx (muF) = ",Cx*10**6
#Chapter-8,Example8_8,pg 8_39
#calculate the equivalent series circuit
#given
L3=8.*10**-3
R1=1.*10**3
R2=25.*10**3
R3=50.*10**3
#calculations
Rx=R2*R3/R1
Lx=R2*L3/R1
#results
print"equivalent series circuit"
print"Rx (Mohm) = ",Rx/10**6
print"Lx (mH) = ",Lx*1000.
#Chapter-8,Example8_9,pg 8_44
#calculate the components of branch
#from the bridge
#given
C1=0.5*10**-6
R1=1200.
R2=700.
R3=300.
#calculations
Rx=R2*R3/R1
Lx=R2*R3*C1
#results
print"components of branch RC"
print"Rx (ohm) = ",Rx
print"Lx (mH) = ",Lx*1000.
#Chapter-8,Example8_10,pg 8_49
#from hay's balance bridge
#given
w=1000.
R1=5.1*10**3
C1=2*10**-6
R2=7.9*10**3
R3=790.
#calculations
Rx=((w**2)*R1*(C1**2)*R2*R3)/(1+((w**2)*(R1**2)*(C1**2)))
Lx=R2*R3*C1/(1+((w**2)*(R1**2)*(C1**2)))
#results
print"unknown inductance and resistance"
print"Rx (kohm) = ",round(Rx/1000.,3)
print"Lx (mH) = ",round(Lx*1000.,2)
#Chapter-8,Example8_11,pg 8_56
#calculate the unknown capacitance and resistance
#given
import math
R1=1.2*10**3
R2=4.7*10**3
C1=1.*10**-6
C3=1.*10**-6
f=0.5*10**3
#calculations
w=2*math.pi*f
Rx=R2*C1/C3
Cx=R1*C3/R2
D=w*Cx*Rx
#results
print"unknown capacitance and resistance"
print"Rx (kohm) = ",Rx/1000.
print"Cx (muF) = ",round(Cx*10**6,3)
print"dissipation factor ",round(D,3)
#Chapter-8,Example8_12,pg 58
#calculate the deflection of galvanometer
#given
R1=200.
R2=100.
R3=1000.
R4=200
Rg=200.
R41=2005.#changed by delR
Si=12.#senstivity
E=10.
#calculations
Vth=E*((R41/(R3+R41))-(R1/(R1+R2)))
Req=(R1*R2/(R1+R2))+(R3*R41/(R3+R41))
Ig=Vth/(Rg+Req)
theta=Si*Ig*10**6#deflection of galvanometer(mm)
#results
print"deflection of galvanometer (mm) = ",round(theta,4)
#Chapter-8,Example8_13,pg 59
#calculate the deflection of galvanometer
#given
R1=1000.
R2=1000.
R3=119.
R4=121.
Rg=200.
S1=1.
E=5.
#calculations
Vth=E*((R4/(R3+R4))-(R1/(R1+R2)))
Req=(R1*R2/(R1+R2))+(R3*R4/(R3+R4))
Ig=Vth/(Rg+Req)
theta=S1*Ig*10**6#deflection of galvanometer(mm)
#results
print"deflection of galvanometer (mm) = ",round(theta,3)
#Chapter-8,Example8_14,pg 59
#calculate the current through galvanometer
#given
R=500.
delR=20.
E=10.
#calculations
Vth=E*delR/(4*R)
Req=R
Rg=125.
Ig=Vth/(Req+Rg)
#results
print"current through galvanometer (muA) = ",Ig*10**6
#Chapter-8,Example8_15,pg 60
#calculate the change in resistance
#given
R=1000.
E=20.
Ig=1*10**-9
#calculations
Req=R
#Ig=Vth/Req......Rg=0
delR=Ig*4*R**2/E
#results
print"change in resistance (muohm) = ",delR*10**6
#Chapter-8,Example8_16,pg 61
#calculate the error voltage
#R4=Rv
#given
R1=10.*10**3
R2=10.*10**3
R3=10.*10**3
R4=R1*R3/R2
E=10.
print"bridge is balanced at 80deg. from graph when Rv=10k\n"
#at 60deg bridge is unbalanced
R4=9.*10**3
#calculations
e=E*((R4/(R3+R4))-(R1/(R1+R2)))#thevenin's voltage
#results
print"error voltage (V) = ",round(e,4)
print"negative sign indicates opposite polarity of error voltage"
#Chapter-8,Example8_17,pg 8_62
#calculate the unbalanced current and resistance
#given
R1=100.
R2=10.
R3=4.
R4=50.
E=10.
Rg=20.
#calculations
Vth=E*((R4/(R3+R4))-(R1/(R1+R2)))
Req=(R1*R2/(R1+R2))+(R3*R4/(R3+R4))
Ig=Vth/(Rg+Req)
#for null deflection
R4=R3*R1/R2
#results
print"unbalanced current in galvanometer (mA) = ",round(Ig*1000.,4)
print"resistance for null deflection (ohm) = ",R4
#Chapter-8,Example8_18,pg 8_62
#calculate the change in resistance
#given
R1=1000.
R2=100.
R3=4.*10**3
Si=70
theta=3*10**-6#deflection
E=10
Rg=80
#calculations
R4=R1*R3/R2
Rth=(R1*R2/(R1+R2))+(R3*R4/(R3+R4))
delR=(theta*(Rth+Rg)*((R3+R4)**2))/(Si*E*R3)
#results
print"Max. Unknown resistance which can be measured (kohm) =",R4/1000.
print"change in resistance (ohm) = ",round(delR,4)
#Chapter-8,Example8_19,pg 8_63
#calculate the series resistance
#given
import math
P=0.4
Rarm=150.#resistance in each arm
I=math.sqrt(P/Rarm)#P=(I**2)*R
#applying KVL to loop ABCEFA
r=1.
E=25.
R=(-I*Rarm-I*Rarm+E-2*I*r)/(2*I)
#results
print"series resistance (ohm) = ",round(R,4)
#Chapter-8,Example8_20,pg 8_63
#calculate the unknown resistance
#given
R1=10.
R2=R1/0.5#given
Rba=1./1200#Rb/Ra
#calculations
Rx=R2*Rba
#results
print"unknown resistance (ohm) = ",round(Rx,4)
#Chapter-8,Example8_21,pg 8_64
#calculate the unknown resistance and inductance
import math
import cmath
#given
w=2*math.pi*1000.
C1=0.2*10**-6
R2=500.
R3=300.
C3=0.1*10**-6
#calculations
Z4=(1j*w*C1*R2)/((1/R3)+(1j*w*C3))#from basic balance equaton
Zx=Z4#unknown impedance
Rx=Zx.real
Xl=Zx.imag
Lx=Xl/w#Xl=w*Lx
#results
print"unknown resistance (ohm) = ",round(Rx,2)
print"unknown inductance (mH) = ",round(Lx*1000.,0)
#Chapter-8,Example8_22,pg 8_67
#calculate the unknown impedance
import math,cmath
#given
Z1=300.
R2=200.
w=2*math.pi*10**3
C2=5.*10**-6
#calculations
Z2=R2-1j*(1./(w*C2))
R3=500.
C3=0.2*10**-6
Z3=R3-1j*(1./(w*C3))
Z4=Z2*Z3/Z1#balance equation
Zx=Z4
#results
print "unknown impedance (ohm) = ",Z4
print "The answer given in textbook is wrong"
#Chapter-8,Example8_23,pg 8_67
#calculate the unknown resistance and capacitance
#given
import math,cmath
Z1=10.*10**3
Z2=50.*10**3
w=2*math.pi*2*10**3
C3=100.*10**-6
R3=100.*10**3
#calculations
Z3=R3-1j*(1/(w*C3))
Z4=Z2*Z3/Z1
Zx=Z4
Rx=Zx.real
Xc=-Zx.imag
Cx=1./(Xc*w)
#results
print"unknown resistance (kohm) = ",Rx/1000.
print"unknown capacitance (muF) = ",Cx*10**6
#Chapter-8,Example8_24,pg 8_68
#calculate the resistance,capacitance and dissipation factor
#given
import math,cmath
R2=4.8
r2=0.4
w=2*math.pi*450
C2=0.5*10**-6
#calculations
Z2=R2+r2-1j*(1/(w*C2))
Z3=200.
Z4=2850.
#I1*Z1=I2*Z2........null deflection detector
Z1=Z2*Z3/Z4
R1=Z1.real
Xc1=-Z1.imag
C1=1./(w*Xc1)
D=w*R1*C1#dissipation factor
#results
print"arm-1 resistance (ohm) = ",round(R1,4)
print"arm-1 capacitance (muF) = ",round(C1*10**6,3)
print"dissipation factor = ",round(D,6)
#Chapter-8,Example8_25,pg 8_70
#calculate the resistance and inductance
#given
import math,cmath
R2=842.
w=2*math.pi*10**3
C2=0.135*10**-6
Z2=R2-1j*(1/(w*C2))
Z3=10
C4=10**-6
#calculations
Z4=-1j*(1/(w*C4))
Z1=Z2*Z3/Z4
R1=Z1.real
Xl1=Z1.imag
L1=Xl1/w
#results
print"resistance of arm AB (ohm) = ",round(R1,3)
print"inductance of arm AB (mH) = ",round(L1*1000.,2)
#Chapter-8,Example8_26,pg 8_71
#calculate the inductance and resistance
#given
#balance is obtained when
L1=47.8*10**-3
R1=1.36
#calculations
#at balance 100(r1+jwL1)=100((R2+r2)+jwL2)
L2=L1
r1=32.7
r2=r1-R1
#results
print"inductance of branch-CD (mH) = ",L2*1000.
print"resistance of branch-CD (ohm) = ",r2
print "The value of L2 is wrong in textbook"
#Chapter-8,Example8_27,pg 8_72
#calculate the upper and lower limits of R4
#given
R1=100.
R2=100.
R3=230.
#calculations
R4=R1*R3/R2
lerrR1=0.02/100
lerrR3=0.01/100
lerrR2=0.02/100#lerrR........limiting error in R
lerrR4=lerrR1+lerrR3+lerrR2
R4u=R4+lerrR4*R4
R4l=R4-lerrR4*R4#limiting ranges of R4
#results
print"limiting range of R4"
print"upper limit (ohm) = ",R4u
print"lower limit (ohm) = ",R4l