summaryrefslogtreecommitdiff
path: root/Engineering_Physics_Marikani/Chapter_1.ipynb
blob: a6934dcdc22af6e678dcf631ef75ce298f1bd312 (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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
{
 "metadata": {
  "name": "",
  "signature": "sha256:dbcb8c7a4d852e94c64ae36b37434de99bb1000ca8d8a481769813b464811eeb"
 },
 "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": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "t=0.15*10**-2;        #thickness of the quartz crystal in m\n",
      "Y=7.9*10**10;         #young's modulus of quartz in N/m^2\n",
      "rho=2650;          #density of quartz in kg/m^3\n",
      "\n",
      "#Calculation\n",
      "x=math.sqrt(Y/rho);\n",
      "f=x/(2*t);\n",
      "f=f*10**-6;        #converting f from Hz to MHz\n",
      "f=math.ceil(f*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"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": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "t=1e-03;        #thickness of the quartz crystal in m\n",
      "Y=7.9*10**10;       #young's modulus of quartz in N/m^2\n",
      "rho=2650;          #density of quartz in kg/m^3\n",
      "\n",
      "#Calculation\n",
      "x=math.sqrt(Y/rho);\n",
      "p1=1;        #for fundamental frequency p=1\n",
      "f1=(p1*x)/(2*t);\n",
      "F1=f1/10**6;\n",
      "F1=math.ceil(F1*10**5)/10**5;   #rounding off to 5 decimals\n",
      "f_1=f1*10**-6;      #converting f1 from Hz to MHz\n",
      "f_1=math.ceil(f_1*10**5)/10**5;   #rounding off to 5 decimals\n",
      "p2=2;       #for first overtone p=2\n",
      "f2=(p2*x)/(2*t);\n",
      "F2=f2/10**6;\n",
      "F2=math.ceil(F2*10**5)/10**5;   #rounding off to 5 decimals\n",
      "f_2=f2*10**-6;      #converting f2 from Hz to MHz\n",
      "f_2=math.ceil(f_2*10**5)/10**5;   #rounding off to 5 decimals\n",
      "\n",
      "#Result\n",
      "print(\"fundamental frequency in Hz is\",F1,\"*10**6\");\n",
      "print(\"fundamental frequency in MHz is\",f_1);\n",
      "print(\"frequency of the first overtone in Hz is\",F2,\"*10**6\");\n",
      "print(\"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": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "lamda=589.3*10**-9;       #wavelength of light in m\n",
      "f=100*10**6;       #frequency of ultrasonic transducer in Hz\n",
      "n=1;       #order of diffraction\n",
      "theta=2.25;          #angle of diffraction in degrees\n",
      "theta=theta*0.0174532925;       #converting degrees to radians\n",
      "\n",
      "#Calculation\n",
      "d=(n*lamda)/(2*math.sin(theta));\n",
      "d1=d*10**6;      #converting d from m to micro m\n",
      "lamda1=2*d;\n",
      "v=f*lamda1;\n",
      "v=math.ceil(v*100)/100;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"wavelength of ultrasonic wave in m is\",lamda1);\n",
      "print(\"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": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "f=2*10**6;      #frequency of transducer in MHz\n",
      "v=3;       #speed of blood in m/s\n",
      "c=800;      #velocity of ultrasonic wave in m/s\n",
      "theta=30;       #angle of inclination in degrees\n",
      "theta=theta*0.0174532925;       #converting degrees to radians\n",
      "\n",
      "#Calculation\n",
      "deltaf=(2*f*v*math.cos(theta))/c;\n",
      "deltaf=deltaf*10**-6;       #converting deltaf from Hz to MHz\n",
      "deltaf=math.ceil(deltaf*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"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": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Y=7.9*10**10;         #young's modulus of quartz in N/m^2\n",
      "rho=2650;          #density of quartz in kg/m^3\n",
      "\n",
      "#Calculation\n",
      "v=math.sqrt(Y/rho);\n",
      "v=math.ceil(v*10**3)/10**3;   #rounding off to 3 decimals\n",
      "\n",
      "#Result\n",
      "print(\"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": {}
  }
 ]
}