Chapter 8:Fundamentals of measuring instruments

Example 8.1, Page Number: 507

In [1]:
#variable declaration
fi=10.0*10**-6        # fi-flux
inch=2.54*10**-2      # length
A=inch**2             # area

#calculation
B =fi/A

#Result
print('Flux Density B= %.1f mT'%(B*1000))
Flux Density B= 15.5 mT

Example 8.2, Page Number: 508

In [2]:
#variable Declaration
i=10*10**-3                  # current in A
R=1000.0                     # resistance in ohm
P=(i**2)*R                   # Power
err_R=10.0                   # Error in Resistance measurement
err_I=(2.0/100)*25*100/10    # Error in current measurement

#calculation
err_I2=2*err_I
err_p=err_I2+err_R

#Result
print('%% error in I^2 = ± %d%%\n%% error in Power = ± %d%%'%(err_I2,err_p))
% error in I^2 = ± 10%
% error in Power = ± 20%

Example 8.3, Page Number: 508

In [3]:
#variable Declaration
i1=37.0                        # current in branch 1 
i2=42.0                        # current in branch 2
i3=13.0                        # current in branch 3
i4=6.7                         # current in branch 4

#Calculation
Imax=(i1+i2)+(i1+i2)*(3.0/100)+(i3+i4)+(i3+i4)*(1.0/100)
Imin=(i1+i2)-(i1+i2)*(3.0/100)+(i3+i4)-(i3+i4)*(1.0/100)

#result
print('Maximum level of total supply current = %.3f mA'%Imax)
print('\nMinimum level of total supply current = %.3f mA'%Imin)
Maximum level of total supply current = 101.267 mA

Minimum level of total supply current = 96.133 mA

Example 8.4, Page Number:508

In [4]:
import math

#(a)

#variable declaration
T=200.0                   # intermediate temperature 
T0=300.0                  # final temperature 
Ti=70.0                   # initial temperature 
t=3.0                     # time in seconds 

#calculation
x=(T-T0)/(Ti-T0)
tow=-t/math.log(x)

#result
print('(a)\nTime constant  tow=%.1f s'%tow)


#(b)

#variable declaration
t1=5.0                    # time in seconds 
#calculation
T5=T0+((Ti-T0)*math.e**(-t1/tow))

#result
print('\n(b)\nTemperature after 5 seconds T5 = %.2f°C'%T5)
(a)
Time constant  tow=3.6 s

(b)
Temperature after 5 seconds T5 = 242.61°C

Example 8.5, Page Number:

In [5]:
import math

#variable declaration
w=9.0              # excitation frequency
wn=6.0             # natural frequency
dr=0.6             # damping ratio

#calculations

x=w/wn
Ar=1/math.sqrt(((1-(x)**2)**2)+(2*dr*x)**2)
err=(1-Ar)*100

#Result
print('A=%.3f'%Ar)
print('\nError = %.2f%%'%err)
A=0.456

Error = 54.37%

Example 8.6, PAge Number: 510

In [6]:
#variable Declaration
t=2.0                  # output  to be calculated after t seconds

#calculation
y=1-math.e**(-(t-1.5)/0.5)

#result
print('y(t)at t=2 will be y(t)=%.3f'%y)
y(t)at t=2 will be y(t)=0.632

Example 8.7, Page Number: 510

In [7]:
import math

#variable declaration

#Temperature Readings
x1=98.5                     # Reading 1
x2=99.0                     # Reading 2
x3=99.5                     # Reading 3 
x4=100.0                    # Reading 4
x5=100.5                    # Reading 5
x6=101.0                    # Reading 6
x7=101.5                    # Reading 7
# Frequency
f1=4.0                      # Reading 1
f2=13.0                     # Reading 2
f3=19.0                     # Reading 3
f4=35.0                     # Reading 4
f5=17.0                     # Reading 5
f6=10.0                     # Reading 6
f7=2.0                      # Reading 7

#(i) Arithmatic Mean

#calculation
x_bar=((x1*f1)+(x2*f2)+(x3*f3)+(x4*f4)+(x5*f5)+(x6*f6)+(x7*f7))/(f1+f2+f3+f4+f5+f6+f7)

#result
print('(i)\n\tArithmatic Mean = %.2f°C'%x_bar)

#(ii) Average Deviation

#calculation
D=(abs(x1-x_bar)*f1)+(abs(x2-x_bar)*f2)+(abs(x3-x_bar)*f3)+(abs(x4-x_bar)*f4)
D=D+(abs(x5-x_bar)*f5)+(abs(x6-x_bar)*f6)+(abs(x7-x_bar)*f7)
D=D/(f1+f2+f3+f4+f5+f6+f7)

#result
print('\n(ii)\n\tAverage Deviation =%.4f°C'%D)

#Standard deviation

#Calculation
sigma=((x1-x_bar)**2*f1)+((x2-x_bar)**2*f2)+((x3-x_bar)**2*f3)+((x4-x_bar)**2*f4)
sigma=sigma+((x5-x_bar)**2*f5)+((x6-x_bar)**2*f6)+((x7-x_bar)**2*f7)
sigma=math.sqrt(sigma)
sigma=sigma/math.sqrt(f1+f2+f3+f4+f5+f6+f7)

#result
print('\n(iii)\n\tStandard deviation = %.3f°C'%sigma)

#variance

#result
print('\n(iv)\n\tVariance = %.4f°C'%(sigma**2))

#Probable Error

#result
print('\n(v)\n\tProbable Error= %.4f°C'%(0.6745*sigma))
(i)
	Arithmatic Mean = 99.93°C

(ii)
	Average Deviation =0.5196°C

(iii)
	Standard deviation = 0.671°C

(iv)
	Variance = 0.4501°C

(v)
	Probable Error= 0.4525°C

Example 8.8, Page Number: 511

In [8]:
import math

#variable Declaration
wn=math.sqrt(3.0)             # natural frequency of osscilation

#Calculation
x=3.2/(2*wn)

#Result
print('Damping coefficient = %.3f\nNatural frequency of Oscillation = %.3f'%(x,wn))
Damping coefficient = 0.924
Natural frequency of Oscillation = 1.732

Example 8.9, Page Number: 512

In [9]:
import math
#variable declaration
w=100.0                   # natural frequency of osscilation

#calculation
fi=-math.atan(0.1*w)-math.atan(0.5*w)
A=1/(math.sqrt(1+(0.1*w)**2)*(math.sqrt(1+(0.5*w)**2)))
A=1*1000.0/math.ceil(1000*A)
err=(1-1.0/A)*100

#Result
print('A=K/%d\n%% error = %.1f%%\nfi = %.2f°'%(A,err,fi*180/math.pi))
A=K/500
% error = 99.8%
fi = -173.14°

Example 8.10, Page Number: 512

In [10]:
#calculations
R=0.15*10/50            # Temperature gradient
K=1.0                   # constant
tow=15.0                # time constant 

#Calculations
deg=K*R*tow

#(i)
a=15-deg

#(ii)
alt_red=deg*50.0/0.15
h=5000-alt_red

#result
print('(i)The actual temperature when instrument reads 15°C is %.2f°C'%a)
print('\n The true temperature at 5000 metres = %.2f '%a)
print('\n(ii)\nThe true altitude at which 15°C occurs is %d metres'%h)
(i)The actual temperature when instrument reads 15°C is 14.55°C

 The true temperature at 5000 metres = 14.55 

(ii)
The true altitude at which 15°C occurs is 4850 metres