import math
##Example 12.1
##calculation of natural frequency,magnetostriction
##given values
l=40*10**-3.;##length of pure iron rod
d=7.25*10**3.;##density of iron in kg/m**3
Y=115*10**9.;##Young's modulus in N/m**2
##calculation
f=(1*math.sqrt(Y/d))/(2.*l);
print'%s %.2f %s'%('the natural frequency(in kHz) is',f*10**-3,'');
import math
##Example 12.2
##calculation of natural frequency
##given values
t=5.5*10**-3.;##thickness in m
d=2.65*10**3.;##density in kg/m**3
Y=8*10**10.;##Young's modulus in N/m**2
##calculation
f=(math.sqrt(Y/d))/(2.*t);##frequency in hertz
print'%s %.2f %s'%('the natural frequency(in kHz) is',f*10**-3,'');
import math
##Example 12.3
##calculation of depth and wavelength
##given values
f=.07*10**6;##frequency in Hz
t=.65;##time taken for pulse to return
v=1700.;##velocity of sound in sea water in m/s
##calculation
d=v*t/2.;##
print'%s %.2f %s'%('the depth of sea(in m) is',d,'');
l=v/f;##wavelenght of pulse in m
print'%s %.2f %s'%('wavelength of pulse (in cm)is',l*10**2,'');