# Example 5.1 : resistance
#calculate the resistance
# given :
n=50.;#number of turns
B=1.;#magnetic field in tesla
I=1.;#current in amperes
L=4.;#length in cm
d=3.;#dia in cm
#calculations
Td=n*B*I*L*d*10**-4;#torque in N-m
cd1=2.4*10**-4;#controlling torque
id=cd1/Td;#current in amperes
fsv=100;#full scale voltage
trv=fsv/id;#ohms
adr=10000;#ohms
r=trv-adr;#ohms
#results
print "required resistance is,(ohm)=",r
# Example 5.2 : resistance
#calculate the total resistance
# given :
fsf=20.;#full scale deflection current in mA
v=200.;#voltage in mV
#calculations
ri=v/fsf;#resistance in ohms
x=199.98;#current in amperes
rsh=(v*10**-3)/x;#ohms
fs2=1000;#volts
trv=fs2/(fsf*10**-3);#ohms
rse=trv-ri;#reqquired resistance in ohms
#results
print "total resistance of the voltmeter is,(ohm)=",rse
#in the text book approximately value of resistance is taken as 50000 ohm
# Example 5.3 : power factor
#calculate the power factor
from math import sqrt, atan, cos
# given :
w1=2000.;#power in watts
w2=500.;#power in watts
#calculations and results
an=atan(sqrt(3)*(((w1-w2)/(w1+w2))));#angle in radians
print "part (a)"
pf=cos(an);#power factor
print "power factor is ,=",round(pf,3)
print "part (b)"
w1=2000.;#power in watts
w2=-500.;#power in watts
an=atan(sqrt(3)*(((w1-w2)/(w1+w2))));#angle in degree
pf=cos(an);#power factor
print "power factor is ,=",round(pf,3)
# Example 5.4;reading
#calculate the reading of the instrument
from math import sqrt, pi, sin
from scipy import integrate
import numpy
print "part (i)"
# given :
vm=100.;#volts
rc=10.;#ohms
#calculations and results
im=vm/rc;#amperes
t= numpy.linspace(0,2*pi, num =3);#time rane
#x=intsplin(t,(sin(t))**2);#variable
x=2.0;
Irms=sqrt((1/(2*pi))*im**2*x);#current in amperes
print "indication of moving iron instrument is,(A)=",round(Irms,2)
print "part (ii)"
t1=0;#time interval
t2=pi;#time inerval
def function(t):
return sin(t)
x=integrate.quad(function,t1,t2)[0];#variable
Iav=(1/pi)*x*(im/2);#current in amperes
print "indication of moving coil instrument is,(A)=",round(Iav,2)
#answer of part a is calculated wrong in the textbook
# Example 5.5;reading
#calculate the current reading
# given :
fsd=100.;#full scale division in amperes
fsd1=100.;#full scale division in mA
#calculations
csh=fsd-(fsd*10**-3);#difference in currents in amperes
rx=0.8;#resistance in ohms
r1=((fsd1*10**-3*rx)/csh);#resistance in ohms
rx1=1;#resistance in ohms
r2=((fsd1*10**-3*rx1)/csh);#resistance in ohms
em1=((rx*r1)/(rx+r1));#resistance in ohms
em2=((rx1*r2)/(rx1+r2));#resistance in ohms
crm1=((em2*10**4*fsd)/((em2*10**4)+(em1*10**4)));#current in amperes
crm2=((em1*10**4*fsd)/((em1*10**4)+(em2*10**4)));#current in amperes
#results
print "current read by meter 1 is,(A)=",round(crm1,2)
print "current read by meter 2 is,(A)=",round(crm2,2)
# Example 5.6;
#calculate the multiplier resistance and sensivity
# given :
rm=50.;#resistance in ohms
rsh=rm;#shunt resistance in ohms
it=2.;#current in mA
erms=10.;#rms voltage in volts
#calculations
ede=0.45*erms;#voltage in volts
rd1=400.;#resistance in ohms
x=(rm*rsh)/(rm+rsh);#resistance in ohms
r1=ede/(it*10**-3);#resistance in ohms
rs=r1-x-rd1;#resistance in ohms
S=r1/erms;#sensivity in ohms/V
#results
print "part (a)"
print "multiplier resistance Rs is,(Ohm)=",rs
print "part (b)"
print "sensivity is,(Ohm/V)=",S
# Example 5.7;
#calculate the apparent resistance of the unknown resistor,actual resistance of the unknown resistor and percentage error
# given :
v=200.;#voltage in volts
i=5.;#current in mA
#calculations and results
tr=v/i;#resistance in kilo ohms
print "part (a)"
print "apparent resistance of unknown resistor is,(kilo-Ohm)=",tr
S=1000.;#sensivity in ohms/V
V1=250.;#voltage in volts
rv=V1*S*10**-3;#resistance in kilo ohms
rx=(V1*tr)/(V1-tr);#resistance in kilo ohms
print "part (b)"
print "actual resistance of unknown resistor is,(kilo-Ohm)=",round(rx,3)
per=(rx-tr)/rx;#percentage error
print "part (c)"
print "percentage error is,(%)=",per*100
# Example 5.8;resolution
#calculate the resolution
# given :
fsr=200.;#full scale reading in volts
d=100.;#number of divisions
sc=1/10.;#scale
#calculations
sd1=fsr/d;#one sccale divisions
R=sc*sd1;#resolution
#results
print "resolution is, (V)=",R
# Example 5.9;resolution
#calculate the resolution
# given :
fsr=9.999;#full scale reading in volts
d=9999.;#number of divisions
#calculations
R=(1/d)*fsr*10**3;#resolution
#results
print "resolution is ,(mV)=",R
# Example 5.10;
#calculate the true resistance of the unknown resistor , percentage error and reading voltmeter
# given :
print "part (i)"
ra=0.1;#ohms
vr=18.;#voltage in volts
am=0.2;#current in amperes
#calculations and results
apr=vr/am;#in ohms
rv=5000.;#ohms
im=vr/rv;#amperes
rxi=am-(im);#in amperes
rx=vr/rxi;#ohms
print "true value of resistance is,(Ohm)=",round(rx,3)
per=((rx-apr)/rx)*100;#percentage error
print "part (ii)"
print "percentage error is,(%)=",per
rvv=am*(ra+rx);#reading of voltmeter
print "part (iii)"
print "reading of voltmeter is,(V)=",round(rvv,3)
# Example 5.11;resistance
#calculate the resistance in all cases
# given :
im=10.;#mA
i=100.;#mA
#calculations and results
m=i/im;#multiplying factor
rm=50;#ohms
rsh=rm/(m-1);#in ohms
print "part (i)"
print "resistance of shunt (range 0-100mA) Rsh1 is,(Ohm)=",round(rsh,3)
i1=500.;#mA
m1=i1/im;#multiplying factor
rm1=50.;#ohms
rsh1=rm1/(m1-1);#in ohms
print "part (ii)"
print "resistance of shunt (range 0-500mA) Rsh2 is,(Ohm)=",round(rsh1,3)
im2=1;#A
i2=100.;#A
m2=i2/im2;#multiplying factor
rm2=50.;#ohms
rsh2=rm2/(m2-1);#in ohms
print "part (iii)"
print "resistance of shunt (range 0-1A) Rsh2 is,(Ohm)=",round(rsh2,3)
im3=1;#A
i3=500.;#A
m3=i3/im3;#multiplying factor
rm3=50.;#ohms
rsh3=rm3/(m3-1);#in ohms
print "part (iv)"
print "resistance of shunt (range 0-5A) Rsh2 is,(Ohm)=",round(rsh3,3)
# Example 5.12;load power
#calculate the load power
# given :
k=600.;#in rev./kwh.
nr=5.;#number of revolutions
t=20.;#time in seconds
#calculations
lp=(1/k)*nr*((60*60)/t);#power in kW
#results
print "load power is,(kW)=",lp