#Resistance
#Given data :
R1=5.0 # in kohm
R2=7.0 # in kohm
R3=10.0 # in kohm
Rx=(R2*R3)/R1
print "Unknown resistance, Rx = ", Rx," kohm"
#Current
#Given data :
R1=1.5 # in kohm
R2=3.0 # in kohm
R3=5.0 # in kohm
R4=14.0 #in kohm
Rg=250.0 #in ohm
E=10.0 #in V
Vd=(E*R4)/(R2+R4)
Vc=(E*R3)/(R1+R3)
E_th=E*((R4/(R2+R4))-(R3/(R1+R3)))
R_th=((R1*R3)/(R1+R3))+((R2*R4)/(R2+R4))
Ig=(E_th/((R_th*10**3)+Rg))*10**6
print "Current, Ig = ",round(Ig,2)," micro A"
# answer is wrong in book
#Deflection
#Given data :
s=8 #sensivity in mm/micro A
R1=1.0 # in kohm
R2=5.0 # in kohm
R3=2.0 # in kohm
R4=10.0 #in kohm
Rg=150.0 #in ohm
E=6.0 #in V
r=10.0 # unbalance resistance in ohm
del_r=10.0 # in kohm
R4_1=((R4*10**3)+r)*10**-3
Vd=(E*R4_1)/(R2+R4_1)
Vc=(E*R3)/(R1+R3)
E_th=E*((R4_1/(R2+R4_1))-(R3/(R1+R3)))
R_th=((R1*R3)/(R1+R3))+((R2*R4)/(R2+R4))
Ig=(E_th/((R_th*10**3)+Rg))*10**6
d=Ig*s #deflection in mm
print "Deflection is ",round(d,1), " mm"
#answer is wrong in the textbook
#Current
#Given data :
R=500.0 #in ohm
Rg=150.0 # in ohm
del_r=10.0 # in ohm
E=6.0 #in V
E_th=(E*del_r)/(4*R)
R_th=R
Ig=(E_th/(R_th+Rg))*10**6
print "Current, Ig = ", round(Ig,3), "micro A"
#Supply voltage
#Given data :
R=120.0 #in ohm
del_r=1.0 # in ohm
E_th=10*10**-3 #in V
E=(E_th*4*R)/del_r
print "Supply voltage, E = ", E," V"
#Resistance
#Given data :
A=100.24 # in ohm
B=200.0 # in ohm
a=100.31 # in ohm
b=200.0 # in ohm
S=100.03 # in micro ohm
r=700.0 # in micro ohm
X=((A/b)*S)+(((r*b)/(r+a+b))*((A/B)-(a/b)))
print "Unknown resistance, X = ", round(X,2), "micro ohm"
#Deflection
#Given data :
R_ab=100.0 # in ohm
R_bc=500.0 # in ohm
R_cd=1000.0 # in ohm
R_da=200.0 # in ohm
V=10.0
VRg=200. # in ohm
del_CD=10.0 # in ohm
V_bd=V*((R_ab/(R_ab+R_bc))-(R_da/(R_da+R_cd+del_CD)))
R_bd=(((R_ab*R_bc)/(R_ab+R_bc))+((VRg*(R_cd+del_CD))/(VRg+R_cd+del_CD)))
I_G=(V_bd/(R_bd+VRg))
s=5 #sensivity in micro A/mm
dg=I_G*10**6*s #deflection in mm
print "Deflection is ",round(dg,0)," mm"
#answer is wrong in the textbook
#LIMITING VALUE OF RESISTANCE
P=100.0 #OHMS
Q=P
S=230.0 #IN ohm
DP=0.02 #ERROR IN PERCENTAGE
DS=0.01 #IN PERCENTAGE
R=(P/Q)*S #unknown resistance in ohms
dr=(DP+DP+DS) #relative limiting error in unknow resistance in percentage ±
drm=(dr/100)*R #magnitude of error
R1=R+drm #in ohms
R2=R-drm #in ohms
print "Limiting value of unknow resistance is ", R2, " ohm to ", R1, " ohm"
import math
#Insulation resistance of cable
t=120.0 #in seconds
v1=300.0 #in volts
v2=100.0 #in volts
c=300.0 #capacitance in pf
r=t/(c)/math.log(v1/v2)#resistance in Mohm
print "Resistance of cable is ", round(r,3)," Mohm"
#Resistance
g=2000.0 #in ohms
s=10.0 #in kohm
q1=40.0 #divisions
q2=46.0 #divisions
r=((q1/q2)*((s*10**3)+(g)))-g #in ohms
print "Unknown resistance is ",round(r,2)," ohm"
#answer is wrong in the textbook
#Resistance
t=200.0 # in V
i=0.5 #in A
ra=10.0 #in ohm
x=t/i #in ohm
r=x-ra #in ohm
print "Unknown resistance is ",r," ohm"
#Ammeter and voltmeter readings
t=200.0 # in V
i=0.5 #in A
ra=10.0 #in ohm
x=t/i #in ohm
r=x-ra #in ohm
sv=10 #sensivity in kohms / V
v=1000 #in V
rv=v*sv *10**-6 # in Mohm
rp=((rv*10**6)*r)/(rv*10**6+r) #in ohm
vr=((t*rp)/(ra+rp)) #voltmeter reading in V
vi=vr/rp #ammeter rading in A
print "Voltmeter reading is ",round(vr,2)," V"
print "Ammeter rading is ",round(vi,5)," A"