{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#2: Ultrasonics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 2.1, Page number 30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The frequency of vibration is 2.7451 *10**6 Hz\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "E=80*10**9;    #Young's modulus of material of piezo electric crystal(Pa)\n",
    "d=2654;    #Density of material of piezo electric crystal(Kg/m^3)\n",
    "t=0.1*10**-2;   #Thickness of  piezo electric crystal(m)\n",
    "p=1;    #for fundamental first overtone\n",
    "\n",
    "#Calculation\n",
    "f=((p/(2*t))*(math.sqrt(E/d)));    #Frequency of vibration of first overtone(Hz)\n",
    "\n",
    "#Result\n",
    "print \"The frequency of vibration is\",round(f/10**6,4),\"*10**6 Hz\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 2.2, Page number 30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Frequency in the first mode of vibration is 5.5 *10**4 Hz\n",
      "Frequency in the second mode of vibration is 110.0 *10**3 Hz\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "v=5.5*10**3;     #Velocity of longitudanal waves in Quartz Crystal(m/s)\n",
    "t=0.05;    #Thickness of Quartz Crystal(m)\n",
    "\n",
    "#Calculation\n",
    "w=2*t;     #wavelength(m)\n",
    "v1=(v/w);    #Frequency in the first mode of vibration(Hz)\n",
    "v2=(2*v1);   #Frequency in the second mode of vibration(Hz)\n",
    "\n",
    "#Result\n",
    "print \"Frequency in the first mode of vibration is\",v1/10**4,\"*10**4 Hz\"\n",
    "print \"Frequency in the second mode of vibration is\",v2/10**3,\"*10**3 Hz\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 2.3, Page number 31"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The depth of sea is 495.0 m\n",
      "The wavelength of ultrasonic pulse is 0.02 m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "f=0.09*10**6;    #Frequency of Ultrasonic source(Hz)\n",
    "t=0.55;     #time(sec)\n",
    "v=1800;     #velocity of sound in water(m/s)\n",
    "\n",
    "#Calculation\n",
    "D=(v*t)/2;    #Depth of sea(m)\n",
    "W=(v/f);      #Wavelength of ultrasonic pulse(m)\n",
    "\n",
    "#Result\n",
    "print \"The depth of sea is\",D,\"m\"\n",
    "print \"The wavelength of ultrasonic pulse is\",W,\"m\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}