# Chapter2 - Measurement Errors¶

## Example 2.3.1 - page : 2-8¶

In [1]:
#precision of the 5th measurement
#given data :
X1=98.0
X2=101.0
X3=102.0
X4=97.0
X5=101.0
X6=100.0
X7=103.0
X8=98.0
X9=106.0
X10=99.0
Xn_bar=(X1+X2+X3+X4+X5+X6+X7+X8+X9+X10)/10
Xn=101 # value of 5th measurement
P=(1-abs((Xn-Xn_bar)/Xn_bar))*100
print "Precision of the 5th measurement, P = ", round(P,2), " %"

Precision of the 5th measurement, P =  99.5  %


## Example 2.3.2.i - page : 2-10¶

In [2]:
#Absolute error
#given data :
Ae=80.0 # in V
Am=79.0 # in V
e=Ae-Am
print "Absolute error, e = ", e, " V"

Absolute error, e =  1.0  V


## Example 2.3.2.ii - page : 2-10¶

In [2]:
#Error
#given data :
Ae=80.0 # in V
Am=79.0 # in V
e=Ae-Am
error1=(e/Ae)*100
print "Error = ", error1, " %"

Error =  1.25  %


## Example 2.3.2.iii - page : 2-10¶

In [3]:
#Relative accuracy
#given data :
Ae=80.0 # in V
Am=79.0 # in V
e=Ae-Am
error1=(e/Ae)*100
A=(1-abs(e/Ae))
print "Relative Accuracy, A = ", A

Relative Accuracy, A =  0.9875


## Example 2.3.2.iv - page : 2-10¶

In [5]:
# % accuracy
#given data :
Ae=80.0 # in V
Am=79.0 # in V
e=Ae-Am
error1=(e/Ae)*100
A=(1-abs(e/Ae))
accuracy=A*100
print "Accuracy = ", accuracy, " %"

Accuracy =  98.75  %


## Example 2.3.2.v - page : 2-10¶

In [7]:
# % error
#given data :
Ae=80.0 # in V
Am=79.0 # in V
e=Ae-Am
f=100.0 #full scale deflection
error1=(e/Ae)*100
A=(1-abs(e/Ae))
accuracy=A*100
P_error=(e/f)*100
print "% error = ", P_error, " %"

% error =  1.0  %


## Example 2.3.3 - page : 2-11¶

In [8]:
#Maximum error
#given data :
V1=100.0 # in V
V2=200.0 #in V
V=V2-V1
A=0.25 #may be Â± in %
max_error=(A/100)*V
print "Maximum error = Â± ", max_error, " V"

Maximum error = Â±  0.25  V


## Example 2.3.4 - page : 2-12¶

In [3]:
# sensitivity and deflection error
#given data :
C=4.0 # change in output in mm
M=8.0 # magnitude of input in ohm
S=C/M
print "sensitivity, S = ", S, " mm/ohm"
D=M/C
print "Deflection factor, D = ", D, " ohm/mm"

sensitivity, S =  0.5  mm/ohm
Deflection factor, D =  2.0  ohm/mm


## Example 2.3.5 - page : 2-14¶

In [11]:
#Resolution
#given data :
V=200.0 # full scale reading in V
N=100.0 # number of divisions
Scale_div=V/N
R=(1.0/10)*Scale_div
print "Resolution, R = ", R, " V"

Resolution, R =  0.2  V


## Example 2.3.6 - page : 2-14¶

In [12]:
#Resolution
#given data :
V=9.999 # full scale read out in volt
c=9999.0 # range from 0 to 9999
R=(1/c)*V*10**3
print "Resolution, R = ", R, " mV"

Resolution, R =  1.0  mV


## Example 2.6.1 - page : 2-23¶

In [4]:
#Magnitude and relative error
#given data :
R1=15.0 #ohm
E1=R1*5.0/100 # Â± limiting error for R1
R2=33.0 #ohm
E2=R2*2.0/100 # Â± limiting error for R2
R3=75.0 #ohm
E3=R3*5.0/100 # Â± limiting error for R3
RT=R1+R2+R3 # ohm(in series)
ET=E1+E2+E3 #Â±limiting error for RT
print "For series connection, magnitude is ", RT, " ohm & limiting error is Â± ", ET, " ohm."
Epr=ET/RT*100 #%
print "Percent relative error : Â±", round(Epr,1)," %"

# Answer is not accurate in the textbook.

For series connection, magnitude is  123.0  ohm & limiting error is Â±  5.16  ohm.
Percent relative error : Â± 4.2  %


## Example 2.6.2 - page : 2-23¶

In [7]:
#Magnitude and relative error
#given data :
R1=36.0 #ohm
E1=5.0 # Â± limiting error for R1
R2=75.0 #ohm
E2=5.0 # Â± limiting error for R2
RT=(R1*R2)/(R1+R2) #ohm(in parallel)
EP1=E1+E2 # Â± limiting error
EP2=((R1*E1)/(R1+R2))+((R2*E2)/(R1+R2))
ET=EP1+EP2
etm=(ET/100)*RT
print "Magnitude of limiting error is Â±", round(etm,2), " ohm"
print "Percentage relative error is Â±", ET, " %"

Magnitude of limiting error is Â± 3.65  ohm
Percentage relative error is Â± 15.0  %


## Example 2.6.3 page : 2-24¶

In [8]:
# Limiting error
vr=40.0 #reading of voltmeter in volts
v=50.0 #rane in volts
i=125.0 #range in mA
fsd=2.0 #accurace in percentage in Â±
dv=(2.0/100)*v #limiting error of voltmeter
da=(2./100)*i #liming error of the ammeter in mA
erv=dv/vr #relative limiting error in voltmeter reading
eri=da/i #relative limiting error in ammeter reading
et=erv+eri
pet=et*100 #percentage limiting error of the power calcultaed
print "Percentage limiting error of the power calcultaed is Â± ",pet," %"

Percentage limiting error of the power calcultaed is Â±  4.5  %


## Example 2.6.4 - page : 2-25¶

In [11]:
# limiting error
r1=120.0 # ohm
er1=0.5 #limiting error in resistance 1 in ohm Â±
r2=2 #in A
er2=0.02 #limiting error in amperes Â±
e1=er2/r2 #limiting error in current
e2=er1/r1 #limiting eror in resistance
et=(2*e1+e2) #total error
etp=et*100 #percentage limtimg error
print "Percentage limiting error in the value of power dissipation is Â±",round(etp,3)

Percentage limiting error in the value of power dissipation is Â± 2.417


## Example 2.6.5 - page : 2-25¶

In [14]:
#magnitude and limiting error
r1=120 #in ohm
er1=0.1 #limiting error in resistance 1 in ohm Â±
r2=2700 #in ohm
er2=0.5 #limiting error in resistance 2 in ohm Â±
r3=470 #in ohm
er3=0.5 #limiting error in resistance 3 in ohm Â±
rxm=(r2*r3)/r1 #magnitude of unknown resistance in ohm
rxe=(er1+er2+er3) #error
er=(rxe*rxm)/100 #relative error Â±
print "Magnitude of unknown resistance is ",rxm," kohm"
print "Relative limiting error is Â±",er," ohm"
print "Guranteed value of resistance is between ",rxm-er, " ohm to " ,rxm+er," ohm"

Magnitude of unknown resistance is  10575  kohm
Relative limiting error is Â± 116.325  ohm
Guranteed value of resistance is between  10458.675  ohm to  10691.325  ohm


## Example 2.6.6 - page : 2-26¶

In [17]:
# absolute error, % error, relative error, % accuracy and % error of full scale reading
#given data :
Ae=80.0 # in volt
Am=79 # in volt
fsd=100 #full scale reading in volt
e=Ae-Am
print "Absolute error, e = ",e," V"
error1=(e/Ae)*100
print "Error = ",error1," %"
A=1-abs(e/Ae)
print "Relative accuracy, A = ",A," %"
p_accuracy=A*100
print "% accuracy = ",p_accuracy," %"
error2=(e/fsd)*100
print "% error expressed as percentage of full scale reading = ",error2," %"

Absolute error, e =  1.0  V
Error =  1.25  %
Relative accuracy, A =  0.9875  %
% accuracy =  98.75  %
% error expressed as percentage of full scale reading =  1.0  %


## Example 2.6.7 - page : 2-27¶

In [22]:
# limiting error
#given data :
fsd=100.0 # in V
A=1.0 # (+ve or -ve) in %
del_A=(A/100)*fsd
As=15.0 #in V
e1=del_A/As
e=e1*100
print "Limiting error, e = ",round(e,4)," %"

Limiting error, e =  6.6667  %


## Example 2.6.8 - page : 2-27¶

In [23]:
# limiting value of current and % limiting error
#given data :
As=2.5 # in A
fsd=10 #full scale reading in A
A=1.5/100
del_A=A*fsd
At1=As+del_A
At2=As-del_A
print "Limiting value of current, At1 = ",At1," A"
print "Limiting value of current, At2 = ",At2," A"
e=(del_A/As)*100
print "Percentage limiting error, e = ",e," %"

Limiting value of current, At1 =  2.65  A
Limiting value of current, At2 =  2.35  A
Percentage limiting error, e =  6.0  %


## Example 2.7.1.i - page : 2-30¶

In [57]:
#ARITHEMATIC MEAN
import numpy
q=[49.7,50.1,50.2,49.6,49.7] #
AM= numpy.mean(q) #arithematic mean in mm
print "Arithematic mean is ",AM

Arithematic mean is  49.86


## Example 2.7.1.ii - page : 2-30¶

In [58]:
#deviation
import numpy
q=[49.7,50.1,50.2,49.6,49.7] #
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
print "Deviations of each value are : "
for dev in d:
print dev

Deviations of each value are :
-0.16
0.24
0.34
-0.26
-0.16


## Example 2.7.1.iii - page : 2-30¶

In [59]:
#algebric sum of deviation
import numpy
q=[49.7,50.1,50.2,49.6,49.7] #
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
dtotal=sum(d)
print "Algebric sum of deviation is", round(dtotal,4)

Algebric sum of deviation is 0.0


## Example 2.7.1.iv - page : 2-30¶

In [60]:
#standard deviation
import numpy
q=[49.7,50.1,50.2,49.6,49.7] #
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
sigma=0
n=5 # no. of measurements
for dev in d:
sigma+=dev**2
sigma/=(n-1)
sigma**=(1.0/2)
print "Standard Deviation is ",round(sigma,2)

Standard Deviation is  0.27


## Example 2.7.2.i - page : 2-31¶

In [61]:
#ARITHEMATIC MEAN
import numpy
q=[101.2,101.4,101.7,101.3,101.3,101.2,101.0,101.3,101.5,101.1] #
AM= numpy.mean(q) #arithematic mean in mm
print "Arithematic mean is ",AM," V"

Arithematic mean is  101.3  V


## Example 2.7.2.ii - page : 2-31¶

In [62]:
#Deviation from mean
import numpy
q=[101.2,101.4,101.7,101.3,101.3,101.2,101.0,101.3,101.5,101.1] #
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
print "Deviations of each value are : "
for dev in d:
print dev

Deviations of each value are :
-0.1
0.1
0.4
0.0
0.0
-0.1
-0.3
0.0
0.2
-0.2


## Example 2.7.2.iii - page : 2-31¶

In [63]:
#standard deviation
import numpy
q=[101.2,101.4,101.7,101.3,101.3,101.2,101.0,101.3,101.5,101.1]
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
sigma=0
n=10 # no. of measurements
for dev in d:
sigma+=dev**2
sigma/=(n-1)
sigma**=(1.0/2)
print "Standard Deviation is ",round(sigma,2)

Standard Deviation is  0.2


## Example 2.7.2.iv - page : 2-31¶

In [64]:
#probable error
import numpy
q=[101.2,101.4,101.7,101.3,101.3,101.2,101.0,101.3,101.5,101.1]
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
sigma=0
n=10 # no. of measurements
for dev in d:
sigma+=dev**2
sigma/=(n-1)
sigma**=(1.0/2)
pe1=0.6745*sigma   # Probable error of one reading
print "Probable error of one reading is ",pe1," V"
pm=pe1/(n-1)**(1.0/2)
print "Probable error of mean is ",round(pm,5)

Probable error of one reading is  0.1349  V
Probable error of mean is  0.04497


## Example 2.7.3.i - page : 2-32¶

In [77]:
#Arithmetic mean
#given data :
X1=147.2 # in nF
X2=147.4 # in nF
X3=147.9 # in nF
X4=148.1 # in nF
X5=148.1 # in nF
X6=147.5 # in nF
X7=147.6 # in nF
X8=147.4 # in nF
X9=147.6 # in nF
X10=147.5 # in nF
AM=(X1+X2+X3+X4+X5+X6+X7+X8+X9+X10)/10
print "Arithmetic mean, AM = ",AM," nF"

Arithmetic mean, AM =  147.63  nF


## Example 2.7.3.ii - page : 2-32¶

In [79]:
# Average deviation
#given data :
n=10
X1=147.2 # in nF
X2=147.4 # in nF
X3=147.9 # in nF
X4=148.1 # in nF
X5=148.1 # in nF
X6=147.5 # in nF
X7=147.6 # in nF
X8=147.4 # in nF
X9=147.6 # in nF
X10=147.5 # in nF
AM=(X1+X2+X3+X4+X5+X6+X7+X8+X9+X10)/n
d1=X1-AM
d2=X2-AM
d3=X3-AM
d4=X4-AM
d5=X5-AM
d6=X6-AM
d7=X7-AM
d8=X8-AM
d9=X9-AM
d10=X10-AM
Average_deviation=(abs(d1)+abs(d2)+abs(d3)+abs(d4)+abs(d5)+abs(d5)+abs(d6)+abs(d7)+abs(d8)+abs(d9)+abs(d10))/n
print "Average deviation = ",Average_deviation," nF"
# answer is wrong in book

Average deviation =  0.289  nF


## Example 2.7.3.iii - page : 2-32¶

In [82]:
#Standard deviation
#given data :
n=10
X1=147.2 # in nF
X2=147.4 # in nF
X3=147.9 # in nF
X4=148.1 # in nF
X5=148.1 # in nF
X6=147.5 # in nF
X7=147.6 # in nF
X8=147.4 # in nF
X9=147.6 # in nF
X10=147.5 # in nF
AM=(X1+X2+X3+X4+X5+X6+X7+X8+X9+X10)/n
d1=X1-AM
d2=X2-AM
d3=X3-AM
d4=X4-AM
d5=X5-AM
d6=X6-AM
d7=X7-AM
d8=X8-AM
d9=X9-AM
d10=X10-AM
sigma=((d1**2+d2**2+d3**2+d4**2+d5**2+d6**2+d7**2+d8**2+d9**2+d10**2)/(n-1))**(1.0/2)
print "Standard deviation = ",round(sigma,4)," nF"

Standard deviation =  0.3057  nF


## Example 2.7.3.iv - page : 2-32¶

In [86]:
#: Probable error
#given data :
n=10
X1=147.2 # in nF
X2=147.4 # in nF
X3=147.9 # in nF
X4=148.1 # in nF
X5=148.1 # in nF
X6=147.5 # in nF
X7=147.6 # in nF
X8=147.4 # in nF
X9=147.6 # in nF
X10=147.5 # in nF
AM=(X1+X2+X3+X4+X5+X6+X7+X8+X9+X10)/n
d1=X1-AM
d2=X2-AM
d3=X3-AM
d4=X4-AM
d5=X5-AM
d6=X6-AM
d7=X7-AM
d8=X8-AM
d9=X9-AM
d10=X10-AM
sigma=((d1**2+d2**2+d3**2+d4**2+d5**2+d6**2+d7**2+d8**2+d9**2+d10**2)/(n-1))**(1.0/2)
Pe1=0.6745*sigma # probable error of one reading
probable_error=Pe1/(n-1)**(1.0/2)
print "Probable error of one reading = ",round(Pe1,4)," nF"
print "Probable error of mean = ",round(probable_error,4)," nF"

Probable error of one reading =  0.2062  nF
Probable error of mean =  0.0687  nF


## Example 2.7.4.i - page : 2-34¶

In [65]:
#ARITHEMATIC MEAN
import numpy
q=[10.3,10.7,10.9,9.7,9.5,9.2,10.3,11.7] #
AM= numpy.mean(q) #arithematic mean in mm
print "Arithematic mean is ",AM,"  kg/cm2"

Arithematic mean is  10.2875   kg/cm2


## Example 2.7.4.ii - page : 2-34¶

In [66]:
#average deviation
import numpy
n=8  # NO. OF MEASUREMENTS
q=[10.3,10.7,10.9,9.7,9.5,9.2,10.3,11.7] #
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM  # deviation
davg=sum(abs(d))/n  # average deviation
print "Average deviation = ",round(davg,4)," kg/cm2"

Average deviation =  0.6156  kg/cm2


## Example 2.7.4.iii - page : 2-34¶

In [95]:
#standard deviation
import numpy
q=[10.3,10.7,10.9,9.7,9.5,9.2,10.3,11.7] #
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
sigma=0
n=8  # no. of measurements
for dev in d:
sigma+=dev**2
sigma/=(n-1)
sigma**=(1.0/2)
print "Standard Deviation is ",round(sigma,4)," kg/cm2"

Standard Deviation is  0.8184  kg/cm2


## Example 2.7.4.iv - page : 2-34¶

In [67]:
#probable error
n=8  # no. of measurements
q=[10.3,10.7,10.9,9.7,9.5,9.2,10.3,11.7] #
AM= numpy.mean(q) #arithematic mean in mm
d=q-AM
sigma=0
n=10 # no. of measurements
for dev in d:
sigma+=dev**2
sigma/=(n-1)
sigma**=(1.0/2)
pe1=0.6745*sigma   # Probable error of one reading
print "Probable error of one reading is ",round(pe1,4)," kg/cm2"
pm=pe1/(n-1)**(1.0/2)
print "Probable error of mean is ",round(pm,4)," kg/cm2"

Probable error of one reading is  0.4868  kg/cm2
Probable error of mean is  0.1623  kg/cm2


## Example 2.8.1 - page : 2-34¶

In [116]:
#ARITHEMATIC MEAN ,median value ,standard deviation and variance
q=[25.5,30.3,31.1,29.6,32.4,39.4,28.9,30.0,33.3,31.4,29.5,30.5,31.7,33.0,29.2] #
AM= numpy.mean(q) #arithematic mean in mm
n=len(q) # no. of measurements
Q=q-AM
mv=sorted(q)[n/2] # get the median value from sorted q
d=q-AM
sigma=0
for dev in d:
sigma+=dev**2
sigma/=(n-1)
sigma**=(1.0/2)  #standard deviation
V=sigma**2 #variance
print "Arithematic mean is ",round(AM,4)," V"
print "Median value is",round(mv,1)

print "Standard Deviation is ",round(sigma,2)

print "Variance is ",round(V,0)

Arithematic mean is  31.0533  V
Median value is 30.5
Standard Deviation is  3.0
Variance is  9.0


## Example 2.8.2 - page : 2-37¶

In [46]:
#ARITHEMATIC MEAN
#from __future__ import division
v=[10,11,12,13,14] #
f=[03,12,18,12,03] #
xn=[a*b for a,b in zip(v,f)]
am=sum(xn)/sum(f)   # arithmetic mean
print "Arithematic mean is ",am," V"
dn=[x-am for x in v]  # deviation
n_dn=[a*b for a,b in zip(f,dn)]
dn2=[a*b for a,b in zip(dn,dn)]
n_dn2=[a*b for a,b in zip(f,dn2)]
absn_dn=[abs(a) for a in n_dn]
mean_dev=sum(absn_dn)/sum(f)
print "Mean deviation = ",mean_dev
sigma=(sum(n_dn2)/sum(f))**(1.0/2)
print "Standard deviation is ", sigma

Arithematic mean is  12.0  V
Mean deviation =  0.75
Standard deviation is  1.0


## Example 2.8.3 - page : 2-37¶

In [97]:
#ARITHEMATIC MEAN ,median value ,standard deviation
import numpy
q=[29.2,29.5,29.6,30.0,30.5,31.4,31.7,32.4,33.0,33.3,39.4,28.9] #
AM= numpy.mean(q)#arithematic mean in mm
print "Arithematic mean is ",round(AM,2)
mv=sorted(q)[int(len(q)/2-1)]
print "Median value = ",mv
d=[x-AM for x in q]
d2=[x**2 for x in d]
sigma=(sum(d2)/(len(q)-1))**(1.0/2)
print "Standard Deviation = ",round(sigma,3)

Arithematic mean is  31.57
Median value =  30.5
Standard Deviation =  2.886


## Example 2.8.4 - page:2-39¶

In [103]:
#Unknown resistor
#given data :
S=1000.0    # ohm/V
V=100.0 #in V
I=5*10**-3 # in A
# part (i)
R_app=(V/I)*10**-3
print "(i) Apparent Resistor, R_app = ",R_app, " kohm"
# part (ii)
V1=150 #in V
Rv=S*V1*10**-3
Rx=Rv/6.5 #actual resistance in kohm
print "(ii) Actual resistance is ",round(Rx,2)," kohm."
# part(iii)
per=(Rx-R_app)/Rx*100 # in %
print "(iii) Percentage error due to loading effect of voltmeter is ",round(per,1), " %"

(i) Apparent Resistor, R_app =  20.0  kohm
(ii) Actual resistance is  23.08  kohm.
(iii) Percentage error due to loading effect of voltmeter is  13.3  %


## Example 2.8.5 - page : 2-40¶

In [104]:
# limiting error
#given data :
del_A=2.5 # may be +ve or-ve in %
As=400.0
FSD=600.0 # in V
del_A1=(del_A/100)*FSD
e=(del_A1/As)*100 # in %
print "Limiting error, e = ",e, " %"

Limiting error, e =  3.75  %