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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 2: Acoustics of Buildings"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.1, Page 52"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import log10\n",
"\n",
"#Variable Declaration\n",
"#delta_L=L2-L1\n",
"\n",
"#Calculation\n",
"#I proportional to square of amplitude so when amplitude is doubled intensity will becomes 4 times \n",
"#L1=10*l0g10(I1/I0)\n",
"#L2=10*log10(I2/I0)\n",
"#delta_L=L2-L1\n",
"#delta_L=10*log(I1/I0)-10*log(I2/I0)=10*log(I2/I1)\n",
"I21=4;#I2/I1=4 because intensity=amp^2\n",
"delta_L=10*log10(I21);#increase in intensity level\n",
"\n",
"#Result\n",
"print 'Increase in intensity level =',round(delta_L,2),'dB'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Increase in intensity level = 6.02 dB\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2, Page 52"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import sqrt\n",
"\n",
"#Variable Declaration\n",
"#L2-L1=10*log10(I2/I1)\n",
"#so , we can write that \n",
"L2=40 #i dB\n",
"L1=10 #in dB \n",
"#where L1 and L2 are intensity level of two waves of same frequency\n",
"\n",
"#Calculation\n",
"L=L2-L1;\n",
"#let I2/I1=I\n",
"I=10**(L/10);\n",
"#let a2/a1=a\n",
"a=sqrt(I);#Ratio of their amplitudes \n",
"\n",
"#Result\n",
"print 'Ratio of their amplitudes =',round(a,3)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Ratio of their amplitudes = 31.623\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.3, Page 53"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import log10\n",
"\n",
"#Variable Declaration\n",
"I1=25.2 #in Wm^-2\n",
"I2=0.90 #in Wm^-2\n",
"\n",
"#Calculation\n",
"B=10*log10(I1/I2) #Relative loudness of sound in dB\n",
"\n",
"#Result\n",
"print 'Relative loudness of sound = ',round(B,2),'dB'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Relative loudness of sound = 14.47 dB\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.4, Page 53"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import log10\n",
"\n",
"#Variable Declaration\n",
"I=1e4 #in W/(m*m)\n",
"I0=1e-12 #in W/(m*m)\n",
"\n",
"#Calculation\n",
"B=10*log10(I/I0);#intensity level\n",
"\n",
"#Result\n",
"print \"intensity level = \",B,'dB'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"intensity level = 160.0 dB\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.5, Page 54"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"B=5 # in dB\n",
"\n",
"#Calculation\n",
"#B=10*log(I2/I1)\n",
"#let I2/I1=x\n",
"#10*log(x)=5\n",
"x=10**(5./10);\n",
"\n",
"#Result\n",
"print 'Amplified sound is',round(x,3),'times more intense than the unamplified sound'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Amplified sound is 3.162 times more intense than the unamplified sound\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.6, Page 57"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"d=198; #in meter\n",
"t=1.2;#in second\n",
"\n",
"#Calculation\n",
"#velocity=distance/time\n",
"v=2*d/t;#velocity\n",
"\n",
"#Result\n",
"print 'velocity =',v,'m/s'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"velocity = 330.0 m/s\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.7, Page 64"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"V=5600 #in m^3\n",
"T=2 #in second\n",
"s=700 #in m^2\n",
"\n",
"#Calculation\n",
"a=0.16*V/(s*T)\n",
"\n",
"#Result\n",
"print \"absorption coefficient =\",a\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"absorption coefficient = 0.64\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.8, Page 65"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"absorp1=92.90; #in m^^2\n",
"absorp2=92.90;#in m^2\n",
"V=2265.6;#in m^3\n",
"\n",
"#Calculations\n",
"T1=0.16*V/(absorp1);\n",
"T2=0.16*V/(absorp1+absorp2);\n",
"ans=T2/T1;#effect on Reverberation time\n",
"\n",
"#Result\n",
"print \"Reverberation time reduced to \",ans,\"of original value\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Reverberation time reduced to 0.5 of original value\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.9, Page 65"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"v=25.2*20.3*8.04 ;#in m^3\n",
"T=0.75; #in second\n",
"\n",
"#Calculations\n",
"absorp1=500*0.3176 ;#in m^2\n",
"absorp2=(0.16*v)/T;\n",
"T1=(0.16*v)/(absorp1+absorp2);#reverbaration time\n",
"\n",
"#Result\n",
"print \"reverbaration time =\",round(T1,3),'sec'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"reverbaration time = 0.635 sec\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.10, Page 66"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Variable Declaration\n",
"v=45*100*17.78;#in m^3\n",
"\n",
"#Calculations\n",
"absorp1=(700*0.03)+(600*0.06)+(400*0.025)+(600*0.3);\n",
"absorp_p=600*4.3;\n",
"T1=(0.16*v)/(absorp1);#Reverbaration time (empty hall) \n",
"T2=(0.16*v)/(absorp_p+absorp1);#Reverbaration time with full capacity\n",
"\n",
"#Results\n",
"print 'Reverbaration time (empty hall) =',round(T1,2),'sec' #printing mistake at the end in the textbook\n",
"print 'Reverbaration time with full capacity =',round(T2,2),'sec'"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Reverbaration time (empty hall) = 51.83 sec\n",
"Reverbaration time with full capacity = 4.53 sec\n"
]
}
],
"prompt_number": 12
}
],
"metadata": {}
}
]
}
|