#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Resistance strain gauge
# Example 1# Page 163
Rg=120. #('enter the resistance of strain gage=:')
E=200 *10**9 # given
dL=3. #('enter the percent change in the length of nthe rod due to loading=:')
dp=0.3 #('enter the corresponding change in the resistivity of strain gage=:')
v=0.3 # poissons ratio
e=dL/100.;
dp_p=dp/100.
print("dR_R=dp_p+e*(1+2*v)")
dR_R=dp_p+e*(1+2*v)
Sg=dR_R/e;
print'So the gage factor is d \n',Sg
u_dr=0.02 #('enter the uncertainty in resistance=:')
u_sig=E*u_dr/(Rg*Sg)*10**-6;
print' Stress uncertainty is MPa\n',u_sig
# To calculate strain uncertainty
u_e=u_dr/(Rg*Sg)
print'Strain uncertainty is d\n',u_e
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Rosette
# Example 2# Page 168
Eh=625*10**-6 #('enter the circumferential strain=:')
Ea= 147*10**-6 #('enter the longitudinal strain=:')
E=200*10**9 # given
v=0.3; # poissons ratio
# to calculate circumferential stress
sig_h=E/(1-v**2)**(Eh+v**Ea)**10**-6;
print'Circumferential stress (hoops stress) is MPa\n',sig_h
sig_a=E/(1-v**2)**(v**Eh+Ea)**10**-6;
print'Axial stress is M Pa\n',sig_a
# To calculate ratio of stresse
print("Let the ratio be represented by RR")
RR=sig_h/sig_a;
print'Ratio of stresses is d\n',RR
print("Let the ratio of strains be represented by SS")
SS=Eh/Ea;
print'THe ratio of strains is ', round(SS,2)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Strain gage
# Example 3# Page 176
print("Rg=120")
print("Sg=2;")
print("Rs=120000")
Rg=120.; # given
Sg=2.; # gage factor
Rs=120000. #('enter the value of shunt resistor=:')
print"The input bridge excitation is represented by Eex"
A=10 #('enter the amplifier gain=:')
# The shunt resistance has to be very large since we intend to measure only very small change in resistanc
eo=30*10**-3 #('enter the unbalanced bridge voltage=:')
dR=Rg/(Rg+Rs);
r=1;#ratio of resistances of adjacent arms
Eex=eo*(1+r)**2/(r*dR*A);
print'The input excitation voltage is d V\n',Eex
v=1
p1=2 *(1+v) # bridge factor
Eo=.5 #('enter the voltmeter reading when shunt is removed=:')
E_axial=Eo*(1+r)**2/(r*Sg*p1*Eex*A);
print' Axial strain is d\n ',E_axial
E_trans=E_axial*v;
print'The transverse strain is -d',round(E_trans,4)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Capacitance pick ups
# Example 4# Page 192
print("h=.005")
print("A=200*10**-6")
print("n=0.03")
h=.005 #('enter the distance between the capacitors=:')
A=200*10**-6 #('enter the area of the transducer=:')
n=0.03 #('enter the non linearity=:')
w=.014 #('enter the side of the square capacitor=:')
er=1 # given that air if filled
eo=8.85 ;
# to calculate the sensitivity of this transducer, let it be represented by c
c=eo*er*A/h**2;
print'sensitivity of the transducer is pF/m \n',c
# to calculate the sensitivity of the square moving plate sensor cl
cl=eo*er*w/h;
print'the sensitivity of the square moving plate sensor is pF/m ',cl
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Piezoelectric transducer
# Example 5# Page 207
from math import pi,exp,sqrt,atan
g=15 #('enter the value constant g for the crystal=:')
A=pi*((5*10**-3)**2)/4 #('enter the area of cross section of the crystal=:')
f=50 #('enter the frequency of sinusoidally varying pressure=:')
eoer=15*10**-9 # for the crystal
E=120 *10**9 # youngs modulus of elasticity
t=.003 #('enter the thichness of the crystal=:')
Kq=g*eoer*A*E/t;
print'Charge sensitivity is d mC/m \n',Kq
Ccr=eoer*A/t;
Camp=2000*10**-12;
Ccable=100*10**-12;
C=Ccr+Camp+Ccable;
Ramp=2000000 #('enter the input impedance of the amplifier')
Req=Ramp;
tou=Req*C; # time constant
# Let the amplitude ratio is given by EOP
w=2*pi*f;
EOP=Kq*t*w*tou/(C*E*sqrt(1+(w*tou)**2))
print'The amplitude ratio is d mV/V\n',EOP
# let the phase lag be represented by phi
phi=360*atan(1/(w*tou))/(2*pi);
print' The phase lag is d deg',round(phi)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Piezoelectric transducer
# Example 6# Page 209
from math import pi,exp,sqrt,atan
g=10 #('enter the value constant g for the crystal=:')
A=pi*((5*10**-3)**2)/4 #('enter the area of cross section of the crystal=:')
f=70 #('enter the frequency of sinusoidally varying pressure=:')
eoer=15*10**-9 # for the crystal
E=120 *10**9 # youngs modulus of elasticity
t=.005 #('enter the thichness of the crystal=:')
Kq=g*eoer*A*E/t;
print'Charge sensitivity is d mC/m \n',Kq
Ccr=eoer*A/t;
Camp=2000*10**-12;
Ccable=100*10**-12;
C=Ccr+Camp+Ccable;
Ramp=2000000 #('enter the input impedance of the amplifier')
Req=Ramp;
tou=Req*C; # time constant
# Let the amplitude ratio is given by EOP
w=2*pi*f;
EOP=Kq*t*w*tou/(C*E*sqrt(1+(w*tou)**2))
print'The amplitude ratio is d mV/V\n',EOP
# let the phase lag be represented by phi
phi=360*atan(1/(w*tou))/(2*pi);
print' The phase lag is d deg',round(phi)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Seismic vibration
# Example 7# Page 232
print("ty=0.6")
print("fn=10")
print("f=25")
print("M=0.15")
print("xo=1.5*10**-3")
from math import sqrt,pi
ty=0.6 #(' enter the damping ratio of seismic vibration pickup=:')
fn=10 #('enter the natural frequency =:')
f=25 #('enter the frequency at which the table is vibrating=')
M=0.15 #( 'enter the seismic mass=:')
xo=1.5*10**-3 #('enter the relative amplitude of the mass=:')
r=f/fn;
print"xi=xo/((r**2)/sqrt((1-r**2)**2+(2*ty*r)**2));"
xi=xo/((r**2)/sqrt((1-r**2)**2+(2*ty*r)**2));
error=(xi-xo)/xo;
print'error in measurement is d\n',error
wn=2*pi*fn;
Ks=wn**2*M;
print'spring constant is d N/m\n',Ks
B=ty*(2*sqrt(Ks*M));
print' damping coefficient of pickup is dN-s/m\n',round(B,2)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Seismic velocity pickup
# Example 8# Page 235
print("fn=4")
print("S=500")
print("m=0.2")
print("v=1.5*10**-2")
from math import pi,atan,sqrt
fn=4 #('enter the natural frequency=:')
S=500 #('enter the sensitivity=:')
m=0.2 #('enter the mass =:')
v=1.5*10**-2 #('enter the maximum velocity with which the surface is vibrating=:')
f=10 #('enter the frequency=:')
r=f/fn;
tou=0.2 # given
w=2*pi*f;
eo=(v*S*r**2)/sqrt((1-r**2)**2+(2*tou*r)**2);
print'The peak voltage corresponding to 10Hz frequency is d mV\n',round(eo,2)
phi1=360*atan(2*tou*r/(1-r**2))/(2*pi);
print'phase angle corresponding to the 10 Hz frequency is d deg\n',round(phi1,2)
f2=20 #('enter the other frequency=:')
r=f2/fn;
eo=(v*S*r**2)/sqrt((1-r**2)**2+(2*tou*r)**2);
print'The peak voltage corresponding to 20Hz frequency is d mV\n',round(eo,2)
phi2=360*atan(2*tou*r/(1-r**2))/(2*pi);
print'phase angle corresponding to the 20 Hz frequency is d deg\n',round(phi2,2)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Piezoelectric transducer
# Example 9# Page 237
print("Ccr=1200")
print("Kq=100")
print("Cc=250")
from math import sqrt,pi
Ccr=1200. #('enter the capacitance of the transducer=:')
Kq=100. #('enter the charge sensitivity of the transducer=:')
Cc=250. #('enter the capacitance of the connecting cable=:')
#to calculate the sensitivity of transducer alone
Ktrans=Kq/Ccr;
print'the sensitivity of the transducer alone is d V/micro m\n',Ktrans
Camp=75. #('enter the capacitance of amplifier=:')
Ceq=Ccr+Cc+Camp
Ktot=Kq/Ceq;
print'total sensitivity of the transducer is dV/micro m\n',Ktot
Ramp=2*10**6 #('enter the resistance of the amplifier=:')
print"tou=Ramp*Ceq*10**-12"
tou=Ramp*Ceq*10**-12;
e=5. #('enter the error in percent=:')
e1=1-(e/100);
# let tou*w1=l
l=sqrt(e1**2/(1-e1**2));
f1=l/(2*pi*tou);
print'The lowest frequency that can be measured with 5 per cent amplitude error by the entire system is d Hz\n',f1
tou1=l/(2*pi*100)
print"Ceq1=tou1*10**12/Ramp"
Ceq1=tou1*10**12/Ramp
Creq=Ceq1-Ceq;
print' The capacitance that needs to be connected in parallel to extend the range of 5percent error to 100hz is d pF\n',Creq
K_hf=Kq/Ceq1
print'high frequency sensitivity is d V/micro m\n',round(K_hf,3)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Seismic pickup
# Example 10# Page 238
print("r1=0.2;")
print("r2=0.6 ")
print("tou=0.05")
from math import pi,sqrt,atan
r1=0.2;
r2=0.6 # given
tou=0.05; #given
wn=1600 #(' enter the natural frequency=:')
print("H1=1/sqrt((1-r1**2)**2+(2*tou*r1)**2)")
H1=1/sqrt((1-r1**2)**2+(2*tou*r1)**2);
H1_phase=-atan((2*tou*r1)/(1-r1**2))*360/(2*pi);
print("H1_phase=-atan((2*tou*r1)/(1-r1**2))*360/(2*pi)")
H2=1/sqrt((1-r2**2)**2+(2*tou*r2)**2);
H2_phase=-atan((2*tou*r2)/(1-r2**2))*360/(2*pi);
#In order to obtain the amplitude of relative printlacement, transfer function must be multiplied by amplitude of the input signal and the static sensitivty of the pickup (1/wn**2) for each frequency
#amp1=H1/wn**2;
#amp2=H2/wn**2;
tou2=0.6; # given
H11=1/sqrt((1-r1**2)**2+(2*tou2*r1)**2);
H11_phase=-atan((2*tou2*r1)/(1-r1**2))*360/(2*pi);
H22=1/sqrt((1-r2**2)**2+(2*tou2*r2)**2);
H22_phase=-atan((2*tou2*r2)/(1-r2**2))*360/(2*pi);
#amp11=H11/wn**2;
#amp22=H22/wn**2;
print'the magnitude of the transfer function will be d and d while the phases will shift byfd and d for tou=0.05\n',H1,H2,H1_phase,H2_phase
print'the magnitude of the transfer function will be d and d while the phases will shift by d and d for tou=0.6\n',H11,H22,H11_phase,H22_phase
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Accelerometer
# Example 11# Page 240
print("fn=20000")
print("tou=0.6")
print("f=10000 ")
from math import sqrt,atan,pi
fn=20000. #('enter the natural frequency of the accelerometer =:')
tou=0.6 #('enter the daping ratio of the accelerometer=:')
f=10000. #('enter the frequency at which transfer function is to be calculated=:')
r=f/fn;
H_mag=1/sqrt((1-r**2)**2+(2*tou*r)**2);
H_phase=atan((2*tou*r)/(1-r**2))*360/(2*pi);
print' The magnitude is d and phase is d deg\n',H_mag,round(H_phase)
error=(H_mag-1)*100./1.;
print' Error at d Hz is percent\n',f,round(error)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Strain gage
# Example 12# Page 272
from math import sqrt
Rg=120.; # given
Sg=2. # gage factor is given
stress=7*10**6; #given
Ia=.03 #('enter the gage current=:')
#maximum allowable bridge voltage is
Eex=240.*Ia;
strain=7e6/(200e9);
dR=strain*Sg*Rg;
Eo=Eex*dR/(4*Rg);
print'output voltage is d V\n',Eo
k=1.38e-23; #boltzmann constant
T=300. #room temperature
dF=100000.# bandwidth
E_noise=sqrt(4*k*Rg*T*dF)
print'rms noise voltage is d V\n',E_noise
SN=Eo/E_noise;
print'Signal to noise ratio is d\n',round(SN)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Accelerometer
# Example 13# Page 273
from math import sqrt,atan,pi
fn=35000. #('enter the natural frequency of the accelerometer =:')
tou=0.23 #('enter the daping ratio of the accelerometer=:')
f=15000. #('enter the frequency at which transfer function is to be calculated=:')
r=f/fn;
H_mag=1/sqrt((1-r**2)**2+(2*tou*r)**2);
H_phase=atan((2*tou*r)/(1-r**2))*360/(2*pi);
print' The magnitude is d and phase is d deg\n',H_mag,H_phase
error=(H_mag-1)*100./1.;
print' Error at d Hz is percent\n',f,round(error)
#CHAPTER 4_ Motion and Dimensional Measurement
#Caption : Strain gage
# Example 14# Page 275
from math import sqrt
Rg=210.; # given
Sg=2. # gage factor is given
stress=5.5*10**6; #given
Ia=.05 #('enter the gage current=:')
#maximum allowable bridge voltage is
Eex=240.*Ia;
strain=7e6/(200e9);
dR=strain*Sg*Rg;
Eo=Eex*dR/(4*Rg);
print'output voltage is d V\n',Eo
k=1.38e-23; #boltzmann constant
T=300. #room temperature
dF=100000.# bandwidth
E_noise=sqrt(4*k*Rg*T*dF)
print'rms noise voltage is d V\n',E_noise
SN=Eo/E_noise;
print'Signal to noise ratio is d\n',round(SN)