diff options
Diffstat (limited to 'Oscillations_and_Waves_by_S._Prakash/chapter5.ipynb')
-rwxr-xr-x | Oscillations_and_Waves_by_S._Prakash/chapter5.ipynb | 661 |
1 files changed, 661 insertions, 0 deletions
diff --git a/Oscillations_and_Waves_by_S._Prakash/chapter5.ipynb b/Oscillations_and_Waves_by_S._Prakash/chapter5.ipynb new file mode 100755 index 00000000..103201f7 --- /dev/null +++ b/Oscillations_and_Waves_by_S._Prakash/chapter5.ipynb @@ -0,0 +1,661 @@ +{ + "metadata": { + "name": "", + "signature": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5, Wave motion and speed of waves in gases" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1, page 206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from __future__ import division\n", + "# wavelength\n", + "#given data :\n", + "v=960 # in m/s\n", + "n=3600/60 # in per sec\n", + "lamda=v/n \n", + "print \"The wavelength, lamda = %0.f m \" %lamda" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The wavelength, lamda = 16 m \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2, page 206" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Frequency\n", + "#given data :\n", + "c=3*10**8 # in m/s\n", + "lamda=300 # in m\n", + "n=c*10**-6/lamda \n", + "print \"The frequency, n = %0.f MHz \" %n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The frequency, n = 1 MHz \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3, page 208" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# velocity and direction\n", + "#y=1.2*sin(3.5*t+0.5*x) #equation\n", + "w=3.5 #from equation\n", + "k=0.5 #from equation\n", + "v=w/k #m/s\n", + "print \"wave velocity =\",v,\"m/s and direction of the wave is along negative X-axis\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "wave velocity = 7.0 m/s and direction of the wave is along negative X-axis\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4, page 209" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from sympy import symbols, pi, sin\n", + "#equation of wave propogation\n", + "amp=0.02 #m\n", + "fr=110 #Hz\n", + "v=330 #m/s\n", + "w=2*pi*fr #s**-1\n", + "k=w/v #constant\n", + "t, x = symbols('t x')\n", + "y=amp*sin(w*t-k*x) #refrence equation\n", + "print \"Equation of wave is\",y" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Equation of wave is 0.02*sin(220*pi*t - 2*pi*x/3)\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5, page 211" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from numpy import pi\n", + "#path difference\n", + "v=360 #m/s\n", + "fr=500 #Hz\n", + "h=v/fr #wavelength in metre\n", + "ang=60 #degree\n", + "angr=ang*(pi/180) #radian\n", + "pth=(h)/(2*pi) #metre\n", + "print \"Path difference = %0.2f m \" %pth" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Path difference = 0.11 m \n" + ] + } + ], + "prompt_number": 17 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6, page 211" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import pi\n", + "#path difference\n", + "pth=15 #cm\n", + "pd=(2*pi)/3 #radians\n", + "h=(pth*2*pi)/pd #cm\n", + "print \"Wavelength = %0.f cm \" %h" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Wavelength = 45 cm \n" + ] + } + ], + "prompt_number": 19 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8, page 214" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sin,degrees\n", + "from sympy import pi\n", + "#displacement ,particle velocity and acceleration\n", + "x=200 #cm\n", + "a=3 # cm\n", + "v=1000#cm/s\n", + "n=25\n", + "lamda=v/n \n", + "y=a*sin(2*pi/lamda*(v*t-x))\n", + "\n", + "v=1000 #cm/s\n", + "n=25 #vibrations\n", + "h=v/n #cm\n", + "a=3 #cm\n", + "t=2 #seconds\n", + "vl=2*pi*a*n #cm/s\n", + "acc=0 #\n", + "print \"Displacement c = %0.f m \" %round(abs(y))\n", + "print \"Velocity =\",vl,\"cm/s \" \n", + "print \"Acceleration = %0.2f cm/s^2 \" %acc" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Displacement c = 0 m \n", + "Velocity = 150*pi cm/s \n", + "Acceleration = 0.00 cm/s^2 \n" + ] + } + ], + "prompt_number": 62 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9, page 215" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#amplitude,frequency,velocity ,wavelength and speed\n", + "#y=5*sin*(4t-0.02x) #given\n", + "a=5 #cm \n", + "h=(2*pi)/0.02 #\n", + "v=0.02*10000 #cm/s\n", + "n=v/h #cycles/seconds\n", + "print \"Amplitude = %0.2f cm \" %a\n", + "print \"Frequency = %0.3f cycles/s \" %n\n", + "print \"Velocity = %0.f cm/s \" %v\n", + "print \"Wavelength = %0.f cm \" %h\n", + "ma1x=a*4 #cm/s\n", + "print \"Maximum speed = %0.2f cm/s \" %ma1x" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amplitude = 5.00 cm \n", + "Frequency = 0.637 cycles/s \n", + "Velocity = 200 cm/s \n", + "Wavelength = 314 cm \n", + "Maximum speed = 20.00 cm/s \n" + ] + } + ], + "prompt_number": 66 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10, page 216" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import pi\n", + "#wave intensity\n", + "nt=1 #watt source\n", + "r=1 #n\n", + "Is=(nt/(4*pi*r**2)) # joule/sec-m**2\n", + "print \"Intensity on the surface = %0.2f J/s-m^2 \" %Is" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Intensity on the surface = 0.08 J/s-m^2 \n" + ] + } + ], + "prompt_number": 67 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14, page 225" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Energy flux \n", + "#given data :\n", + "A=.10 # in m\n", + "w=4 # in per sec\n", + "k=0.1 # in per cm\n", + "p=1.25*10**3 # in kg/m**3\n", + "v=w*10**-2/k # in m/s\n", + "n=w/(2*pi) \n", + "Ef=2*pi**2*n**2*A**2*p*v \n", + "print \"Energy flux of the wave, Ef = %0.f W/m^2 \" %Ef" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Energy flux of the wave, Ef = 40 W/m^2 \n" + ] + } + ], + "prompt_number": 69 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 15, page 225" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Energy radiated and energy current\n", + "#given data :\n", + "p=1.29 # in kg/m**3\n", + "a=.15*10**-2 # in m/s\n", + "n=76 # in Hz\n", + "E=2*pi**2*n**2*a**2*p \n", + "print \"(a) Energy radiated, E = %0.3f J/m^3 \" %E\n", + "v=332 # in m/s\n", + "Ev=E*v \n", + "print \"(b) The energy current, Ev = %0.2f W/s \" %Ev\n", + "# energy current is calculated wrong in the textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(a) Energy radiated, E = 0.331 J/m^3 \n", + "(b) The energy current, Ev = 109.87 W/s \n" + ] + } + ], + "prompt_number": 71 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 16, page 234" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "# Pressure amplitude, Energy density and energy flux\n", + "#given data :\n", + "a=10**-5 # in m\n", + "n=500 # in per sec\n", + "p=1.29 # in kg/m**3\n", + "v=340 # in m/s\n", + "Pa=2*pi*a*n*v*p \n", + "print \"(i) Pressure amplitude, Pa = %0.1f N/m^2 \" %Pa\n", + "Ed=2*pi**2*a**2*n**2*p \n", + "print \"(ii) Energy density, Ed = %0.1e J/m^3 \"%Ed\n", + "Ef=2*pi**2*a**2*n**2*p*v \n", + "print \"(iii) The energy flux, Ef = %0.2f J/m^2-s \" %Ef" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "(i) Pressure amplitude, Pa = 13.8 N/m^2 \n", + "(ii) Energy density, Ed = 6.4e-04 J/m^3 \n", + "(iii) The energy flux, Ef = 0.22 J/m^2-s \n" + ] + } + ], + "prompt_number": 74 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17, page 235" + ] + }, + { + "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": 77 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 18, page 238" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "from math import sqrt\n", + "#speed\n", + "sa=332 #m/s\n", + "pa=16 #density of air\n", + "ph=1 #density of hydrogen\n", + "vn=sa*sqrt(pa/ph) #m/s\n", + "t1=0 #degree celsius\n", + "t2=546 #degree celsius\n", + "t1k=0+273 #kelvin\n", + "t2k=t2+273 #kelvin\n", + "v2=vn*sqrt(t2k/t1k) #m/s\n", + "print \"Speed of sound in first case = %0.f m/s \" %vn\n", + "print \"speed of sound in second case is = %0.f m/s\" %v2" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of sound in first case = 1328 m/s \n", + "speed of sound in second case is = 2300 m/s\n" + ] + } + ], + "prompt_number": 80 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 19, page 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#temperature\n", + "t1=0 #degree celsius\n", + "t1k=t1+273 #kelvin\n", + "rt=2 #\n", + "tk=rt**2*t1k #Kelvin\n", + "t=tk-273 #degree celsius\n", + "print \"Temperature = %0.f degree-celsius \" %t" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature = 819 degree-celsius \n" + ] + } + ], + "prompt_number": 81 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 20, page 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#temperature\n", + "rtd=16/14 #ratio of densities\n", + "tk=15+273 #degree celsius\n", + "x=(tk*rtd)-273 #degree celsius\n", + "print \"Temperature = %0.2f degree-celsius \" %x" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Temperature = 56.14 degree-celsius \n" + ] + } + ], + "prompt_number": 82 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21, page 240" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#speed\n", + "rt=4/1 #\n", + "ss=332 #m/s\n", + "rd=32/28 #ratio of densities\n", + "rt1=((1+(1/rt)*rd)/(1+(1/rt))) #\n", + "v1=ss*sqrt(rt1) #m/s\n", + "print \"Speed of sound in nitrogen = %0.1f m/s \" %v1" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Speed of sound in nitrogen = 336.7 m/s \n" + ] + } + ], + "prompt_number": 84 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 22, page 241" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#speed\n", + "gm=1.41 #\n", + "vs=330 #m/s\n", + "vrms=sqrt(3/gm)*vs #m/s\n", + "print \"Root mean square velocity of molecules of gas = %0.f m/s \" %vrms" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Root mean square velocity of molecules of gas = 481 m/s \n" + ] + } + ], + "prompt_number": 86 + } + ], + "metadata": {} + } + ] +} |