summaryrefslogtreecommitdiff
path: root/Engineering_Physics/Chapter_1.ipynb
blob: 4392ba50d18c5f2f0c511ac5345970222b063e6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{
 "metadata": {
  "name": "Chapter 1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Ultrasonics"
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 1.1, Page number 28 "
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#To calculate the fundamental frequency of vibration\n\n#importing modules\nimport math\n\n#Variable declaration\nt=0.15*10**-2;        #thickness of the quartz crystal in m\nY=7.9*10**10;         #young's modulus of quartz in N/m^2\nrho=2650;          #density of quartz in kg/m^3\n\n#Calculation\nx=math.sqrt(Y/rho);\nf=x/(2*t);\nf=f*10**-6;        #converting f from Hz to MHz\nf=math.ceil(f*10**6)/10**6;   #rounding off to 6 decimals\n\n#Result\nprint(\"fundamental frequency of vibration in MHz is\",f);\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "('fundamental frequency of vibration in MHz is', 1.819992)\n"
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 1.2, Page number 28 "
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#To calculate the fundamental frequency and the first overtone\n\n#importing modules\nimport math\n\n#Variable declaration\nt=1e-03;        #thickness of the quartz crystal in m\nY=7.9*10**10;       #young's modulus of quartz in N/m^2\nrho=2650;          #density of quartz in kg/m^3\n\n#Calculation\nx=math.sqrt(Y/rho);\np1=1;        #for fundamental frequency p=1\nf1=(p1*x)/(2*t);\nF1=f1/10**6;\nF1=math.ceil(F1*10**5)/10**5;   #rounding off to 5 decimals\nf_1=f1*10**-6;      #converting f1 from Hz to MHz\nf_1=math.ceil(f_1*10**5)/10**5;   #rounding off to 5 decimals\np2=2;       #for first overtone p=2\nf2=(p2*x)/(2*t);\nF2=f2/10**6;\nF2=math.ceil(F2*10**5)/10**5;   #rounding off to 5 decimals\nf_2=f2*10**-6;      #converting f2 from Hz to MHz\nf_2=math.ceil(f_2*10**5)/10**5;   #rounding off to 5 decimals\n\n#Result\nprint(\"fundamental frequency in Hz is\",F1,\"*10**6\");\nprint(\"fundamental frequency in MHz is\",f_1);\nprint(\"frequency of the first overtone in Hz is\",F2,\"*10**6\");\nprint(\"frequency of the first overtone in MHz is\",f_2);\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "('fundamental frequency in Hz is', 2.72999, '*10**6')\n('fundamental frequency in MHz is', 2.72999)\n('frequency of the first overtone in Hz is', 5.45998, '*10**6')\n('frequency of the first overtone in MHz is', 5.45998)\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 1.3, Page number 29 "
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#To calculate the velocity of ultrasonic wave\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda=589.3*10**-9;       #wavelength of light in m\nf=100*10**6;       #frequency of ultrasonic transducer in Hz\nn=1;       #order of diffraction\ntheta=2.25;          #angle of diffraction in degrees\ntheta=theta*0.0174532925;       #converting degrees to radians\n\n#Calculation\nd=(n*lamda)/(2*math.sin(theta));\nd1=d*10**6;      #converting d from m to micro m\nlamda1=2*d;\nv=f*lamda1;\nv=math.ceil(v*100)/100;   #rounding off to 2 decimals\n\n#Result\nprint(\"wavelength of ultrasonic wave in m is\",lamda1);\nprint(\"velocity of ultrasonic wave in m/sec\",int(v));",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "('wavelength of ultrasonic wave in m is', 1.5010258944908707e-05)\n('velocity of ultrasonic wave in m/sec', 1501)\n"
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 1.4, Page number 29 "
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#To calculate the Doppler shifted frequency\n\n#importing modules\nimport math\n\n#Variable declaration\nf=2*10**6;      #frequency of transducer in MHz\nv=3;       #speed of blood in m/s\nc=800;      #velocity of ultrasonic wave in m/s\ntheta=30;       #angle of inclination in degrees\ntheta=theta*0.0174532925;       #converting degrees to radians\n\n#Calculation\ndeltaf=(2*f*v*math.cos(theta))/c;\ndeltaf=deltaf*10**-6;       #converting deltaf from Hz to MHz\ndeltaf=math.ceil(deltaf*10**6)/10**6;   #rounding off to 6 decimals\n\n#Result\nprint(\"doppler shifted frequency in MHz is\",deltaf);",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "('doppler shifted frequency in MHz is', 0.012991)\n"
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example number 1.5, Page number 30 "
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#To calculate the velocity of ultrasonic wave\n\n#importing modules\nimport math\n\n#Variable declaration\nY=7.9*10**10;         #young's modulus of quartz in N/m^2\nrho=2650;          #density of quartz in kg/m^3\n\n#Calculation\nv=math.sqrt(Y/rho);\nv=math.ceil(v*10**3)/10**3;   #rounding off to 3 decimals\n\n#Result\nprint(\"velocity of ultrasonic waves in m/s is\",v);\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "('velocity of ultrasonic waves in m/s is', 5459.975)\n"
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "",
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}