{ "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": {} } ] }