{ "metadata": { "name": "", "signature": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 9, Longitudinal acoustic waves in air" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1, page 380" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "from math import pi\n", "# Pressure amplitude, Energy density and Energy flux\n", "#given data :\n", "A=1*10**-5 # in m\n", "n=500 # in per sec\n", "v=340 # in m/s\n", "p=1.29 # in kg/m**3\n", "Pa=2*pi*n*v*p*A \n", "print \"Pressure amplitude, Pa = %0.1f N/m^2 \"%Pa\n", "Ed=2*pi**2*n**2*p*A**2 \n", "print \"Energy density, Ed = %0.1e J/m^3 \" %Ed\n", "Ev=Ed*v \n", "print \"Energy flux, Ev = %0.2f J/m^2-s \" %Ev" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Pressure amplitude, Pa = 13.8 N/m^2 \n", "Energy density, Ed = 6.4e-04 J/m^3 \n", "Energy flux, Ev = 0.22 J/m^2-s \n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 2, page 381" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Pressure \n", "#given data :\n", "gama=1.4 \n", "u=10**-3 # in m/s\n", "v=340 # in m/s\n", "P=10**5 # in N/m**2\n", "p=gama*P*u/v \n", "print \"The pressure, p = %0.2f N/m^2 \" %p" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The pressure, p = 0.41 N/m^2 \n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3, page 381" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import sqrt\n", "# The amplitude \n", "#given data :\n", "n=350 # in Hz\n", "v=330 # in m/s\n", "p=1.293 # in kg/m**3\n", "I=1*10**-6 # in W/m**2\n", "A=sqrt(I/(2*pi*n**2*p*v)) \n", "print \"The amplitude of wave, A = %0.2e m \" %A" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The amplitude of wave, A = 5.52e-08 m \n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 4, page 381" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Velocity, Amplitude of pressure and particle velocity amplitude\n", "#given data :\n", "gama=1.4 \n", "P=1.013*10**5 \n", "p1=1.29 # in kg/m**3\n", "A=2.5*10**-7 # in m\n", "v=sqrt(gama*P/p1) \n", "print \"The velocity, v = %0.1f m/s \" %v\n", "n=1000 # in Hz\n", "lamda=v/n \n", "print \"Wavelength, lamda = %0.4f m \" %lamda\n", "p=p1*v*2*pi*n*A \n", "print \"Amplitude of pressure, p = %0.2f N/m^2 \" % p\n", "u=2*pi*n*A \n", "print \"Particle velocity amplitude, u = %0.2e m/s \" %u" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The velocity, v = 331.6 m/s \n", "Wavelength, lamda = 0.3316 m \n", "Amplitude of pressure, p = 0.67 N/m^2 \n", "Particle velocity amplitude, u = 1.57e-03 m/s \n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 5, page 382" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import pi\n", "# Amplitude\n", "#given data :\n", "v=(1/3)*10**3 # in m/s\n", "p=1.25 # in kg/m**3\n", "E=v**2*p \n", "n=10**4 # in rad/sec\n", "print \"Bulk modulus of medium, E = %0.2e N/m^2\" %E\n", "I=10**-12 # in W/m**2\n", "A=sqrt(I/(2*pi**2*n**2*p*v)) \n", "print \"Amplitude of wave, A = %0.2e m \" %A\n", "P=sqrt(2*I*p*v) \n", "print \"Pressure amplitude, P = %0.2e N/m^2 \" %P\n", "# answer A and E is wrong in textbook" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Bulk modulus of medium, E = 1.39e+05 N/m^2\n", "Amplitude of wave, A = 1.10e-12 m \n", "Pressure amplitude, P = 2.89e-05 N/m^2 \n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 6, page 383" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import sqrt\n", "# Root mean squre velocity\n", "#given data :\n", "vs=330 # in m/s\n", "gama=1.41 \n", "c=round(sqrt(3/gama)*vs) \n", "print \"The root mean square velocity of modulus, c = %0.f m/s \"%c" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The root mean square velocity of modulus, c = 481 m/s \n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 7, page 383" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Acoustic power entering\n", "#given data :\n", "A=1*2 # in m**2\n", "a=80 # in dB\n", "I0=10**-12 # in W/m**2\n", "IbyI0=10**(80/10) \n", "I=I0*IbyI0 \n", "Ape=I*A \n", "print \"Acoustic power entering the room = %0.e Watt \" %Ape" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Acoustic power entering the room = 2e-04 Watt \n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 8, page 384" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import log10\n", "# Acoustic intensity level\n", "#given data :\n", "Pr=3 # in W\n", "r=15 # in m\n", "I=Pr/(4*pi*r**2) # in W/m**2\n", "I0=10**-12 # in W/m**2\n", "L=round(10*log10(I/I0)) \n", "print \"Acoustic intensity level, L = %0.f dB \" %L" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Acoustic intensity level, L = 90 dB \n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 9, page 391" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# frequency\n", "n2=200 #second**-1\n", "l21=2 #\n", "f=l21*n2 #\n", "print \"Frequency = %0.f second^-1 \" %f" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Frequency = 400 second^-1 \n" ] } ], "prompt_number": 19 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 10, page 391" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# length\n", "l1=66 #cm\n", "v=330 #m/s\n", "nbs=5 #beats/sec\n", "x=(2*(v-(nbs*2*l1*10**-2))/(v*2*l1*10**-2)) #\n", "l2=1/x #cm\n", "print \"Length = %0.1f cm \"%(l2*100)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Length = 67.3 cm \n" ] } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 11, page 392" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# length\n", "f=110 #Hz\n", "v=330 #m/s\n", "l=v/(2*f) #m\n", "print \"Fundamental frequency = %0.f Hz\" %f\n", "print \"Length = %0.1f m\" %l" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Fundamental frequency = 110 Hz\n", "Length = 1.5 m\n" ] } ], "prompt_number": 22 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 12, page 392" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# equation,frequency,amplitude ,wavelength and distance\n", "#y=6*(sin(2*pi*x)/6)*cos(160*pi*t) #given equation\n", "a=3 #cm\n", "T=(2*pi)/(160*pi) #sec\n", "h=((2*pi*6)/(2*pi)) #cm\n", "print \"wave equation is 3*sin((160*pi*t)+(2*pi*x)/6)\"\n", "print \"Amplitude = %0.2f cm \" %a\n", "print \"Frequency = %0.2f Hz \" %(1/T)\n", "print h,\"wavelength is,(cm)=\"\n", "db=h/2 #\n", "print \"Distance between consecutive antinodes = %0.2f cm\" %db" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "wave equation is 3*sin((160*pi*t)+(2*pi*x)/6)\n", "Amplitude = 3.00 cm \n", "Frequency = 80.00 Hz \n", "6.0 wavelength is,(cm)=\n", "Distance between consecutive antinodes = 3.00 cm\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 13, page 393" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import cos, pi\n", "# length,amlitude,pressure\n", "f=440 #Hz\n", "v=330 #m/s\n", "l=((5*v)/(4*f))*100 #cm\n", "print \"Length, L = %0.2f cm \" %l" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Length, L = 93.75 cm \n" ] } ], "prompt_number": 27 } ], "metadata": {} } ] }