{ "metadata": { "name": "", "signature": "sha256:078983e30b4c728fb3bac2d9363145a8f1fffb1522bc3df76d2595e630af4298" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "1: Oscillations and Waves" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.1, Page number 23" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "\n", "#Variable declaration\n", "S=4; #SHM described by a particle(cm)\n", "x=0; #mean position\n", "v=12; #velocity at mean position(cm/s)\n", "\n", "#Calculation\n", "A=S/2; #amplitude of motion(cm)\n", "omega=v/A; #angular frequency(sec-1)\n", "T=(2*math.pi)/omega; #time period(sec)\n", "T=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n", "\n", "#Result\n", "print \"time period of motion is\",T, \"sec\"\n", "print \"time period of motion is pi/3 sec\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "time period of motion is 1.048 sec\n", "time period of motion is pi/3 sec\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.2, Page number 23" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "\n", "#Variable declaration\n", "T=0.1; #time period(sec)\n", "A=4; #amplitude of motion(cm)\n", "x=0.2; #distance from mean position(cm)\n", "\n", "#Calculation\n", "omega=(2*math.pi)/T; #angular frequency(sec-1)\n", "a=(omega**2)*x; #acceleration(cm/sec^2)\n", "a=math.ceil(a*10**2)/10**2; #rounding off to 2 decimals\n", "#maximum velocity is when particle is in the mean position\n", "v_max=omega*A; #maximum velocity(cm/sec)\n", "v_max=math.ceil(v_max*10**2)/10**2; #rounding off to 2 decimals\n", "\n", "#Result\n", "print \"acceleration is\",a, \"cm/sec^2\"\n", "print \"maximum velocity is\",v_max, \"cm/sec\"\n", "\n", "#answers given in the book are wrong" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "acceleration is 789.57 cm/sec^2\n", "maximum velocity is 251.33 cm/sec\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.3, Page number 24" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "import numpy as np\n", "\n", "#Variable declaration\n", "A1 = 40; #First amplitude of oscillation(cm)\n", "An_plus_1 = 4; #Amplitude after 100 oscillations(cm)\n", "n = 100; #Number of oscillations\n", "T = 2.5; #Time period of oscillations(s)\n", "\n", "#Calculation\n", "t = T/4; #Time taken to reach the first amplitude from the mean position(s)\n", "#Now A1 = x0*math.exp(-lambda*t) and An_plus_1 = x0*math.exp(-lambda*(t+nT))\n", "#A1/An_plus_1 = math.exp(n*lambda*T)\n", "x=A1/An_plus_1;\n", "lamda=np.log(x)/(n*T); #Damping constant(per sec)\n", "lamda=lamda*10**2;\n", "lamda=math.ceil(lamda*10**3)/10**3; #rounding off to 3 decimals\n", "\n", "#Result\n", "print \"Damping constant is\",lamda,\"*10**-2 per sec\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Damping constant is 0.922 *10**-2 per sec\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.4, Page number 24" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "\n", "#Variable declaration\n", "x1 = 3; #First position of the particle(cm)\n", "x2 = 4; #Second position of the particle(cm)\n", "v1 = 16; #Velocity of particle executing SHM at 1st position(cm/s)\n", "v2 = 12; #Velocity of particle executing SHM at 2nd position (cm/s)\n", "\n", "#Calculation\n", "#As v = omega*sqrt(A**2 - x**2) so\n", "#(v1/v2)**2=(A**2 - x1**2)/(A**2 - x2**2)\n", "#RHS gives (A**2-9)/(A**2-16)\n", "#(v2**2)*(A**2 - x1**2)=(v1**2)*(A**2 - x2**2), on solving we get\n", "A=math.sqrt((((v1**2)*(x2**2))-((v2**2)*(x1**2)))/((v1**2)-(v2**2))); #amplitude in cm\n", "omega=v1/math.sqrt(A**2-x1**2); #Angular speed of the particle(per sec)\n", "T=2*math.pi/omega; #Time period of oscillation(sec)\n", "T=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n", "\n", "#Result\n", "print \"The amplitude of SHM is\",A, \"cm\"\n", "print \"The time period of oscillation is\",T, \"sec\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The amplitude of SHM is 5.0 cm\n", "The time period of oscillation is 1.571 sec\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.5, Page number 25" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "\n", "#Variable declaration\n", "m = 0.3; #Mass attached to the string(kg)\n", "g = 9.8; #Acceleration due to gravity(m/sec**2)\n", "x = 0.15; #Stretchness produced in the spring(m)\n", "s = 0.1; #spring is stretched and released(m)\n", "\n", "#Calculation\n", "F = m*g; #Restoring force acting on the mass(N)\n", "k = F/x; #Spring constant(N/m)\n", "A = s; #amplitude equals to the spring stretched and released\n", "omega = math.sqrt(k/m); #Angular frequency of oscillation(rad per sec)\n", "v0 = omega*A; #Maximum velocity during the oscillations(m/s)\n", "v0=math.ceil(v0*100)/100; #rounding off to 2 decimals\n", "\n", "#Result\n", "print \"The spring constant is\",k, \"N/m\"\n", "print \"The amplitude of oscillation is\",A, \"m\"\n", "print \"The maximum velocity during oscillations is\",v0, \"m/s\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The spring constant is 19.6 N/m\n", "The amplitude of oscillation is 0.1 m\n", "The maximum velocity during oscillations is 0.81 m/s\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.6, Page number 25" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "\n", "#Variable declaration\n", "lambda1 = 400; #Lower limit of wavelength of visible region(nm)\n", "lambda2 = 700; #Upper limit of wavelength of visible region(nm)\n", "c = 3*10**8; #Speed of light in vacuum(m/s)\n", "\n", "#Calculation\n", "lambda1 = lambda1*10**-9 #Lower limit of wavelength(m) \n", "lambda2 = lambda2*10**-9 #upper limit of wavelength(m) \n", "new_1 = c/lambda1; #Upper limit of frequency of visible region(m)\n", "new_2 = c/lambda2; #Lower limit of frequency of visible region(m)\n", "\n", "#Result\n", "print \"The frequency equivalent of 400 nm is\",new_1, \"Hz\"\n", "print \"The frequency equivalent of 700 nm is\",new_2, \"Hz\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The frequency equivalent of 400 nm is 7.5e+14 Hz\n", "The frequency equivalent of 700 nm is 4.28571428571e+14 Hz\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.7, Page number 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "#Comparing the standard equation u(x,t) = A*sin(2*%pi(x/lambda-t/T)) with the given equation, we get\n", "A = 1.5*10**-3; #Amplitude of the sound wave(m)\n", "lamda = 8; #Wavelength of the sound wave(m)\n", "T = 1/40; #Time period of the sound wave(s)\n", "\n", "#Calculation\n", "A = A*10**3;\n", "new = 1/T; #Frequency of the sound wave(Hz)\n", "v = new*lamda; #Velocity of the sound wave(m/s)\n", "T=math.ceil(T*100)/100; #rounding off to 2 decimals\n", "\n", "#Result\n", "print \"The amplitude of the sound wave is\",A,\"*10**-3 m\"\n", "print \"The wavelength of the sound wave is\",lamda, \"m\"\n", "print \"The time period of the sound wave is\",T, \"s\"\n", "print \"The frequency of the sound wave is\",new, \"Hz\"\n", "print \"The velocity of the sound wave is\",v, \"m/s\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The amplitude of the sound wave is 1.5 *10**-3 m\n", "The wavelength of the sound wave is 8 m\n", "The time period of the sound wave is 0.03 s\n", "The frequency of the sound wave is 40.0 Hz\n", "The velocity of the sound wave is 320.0 m/s\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.8, Page number 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "#import modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "A = 2; #Amplitude of the wave(cm)\n", "T = 0.5; #Time period of the wave(sec)\n", "v = 200; #Wave velocity(cm/s)\n", "\n", "#Calculation\n", "f = 1/T; #Frequency of the wave(Hz)\n", "lamda = v/f; #Wavelength of the wave(cm)\n", "\n", "#Result\n", "print \"frequency of wave is\",f, \"Hz\"\n", "print \"wavelength of wave is\",lamda, \"cm\"\n", "print \"The Equation of the wave moving along X-axis :\"\n", "print \"u = \",A,\"*sin*2*math.pi*(x/\",lamda,\"- t/\",T,\")\" #x and y are in cm and t is in sec" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "frequency of wave is 2.0 Hz\n", "wavelength of wave is 100.0 cm\n", "The Equation of the wave moving along X-axis :\n", "u = 2 *sin*2*math.pi*(x/ 100.0 - t/ 0.5 )\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example number 1.9, Page number 27" ] }, { "cell_type": "code", "collapsed": false, "input": [ " \n", "#import modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "T = 1000; #Tension in the wire(N)\n", "M=15; #mass of the wire(kg)\n", "l=300; #length of the wire(m)\n", "lamda = 0.30; #Wavelength of wave along wire(m)\n", "\n", "#Calculation\n", "m = M/l; #Mass per unit length of the wire(kg/m)\n", "v = math.sqrt(T/m); #Velocity of wave through wire(m/s)\n", "v=math.ceil(v*100)/100; #rounding off to 2 decimals\n", "new = v/lamda; #Frequency of wave through string(Hz)\n", "new=math.ceil(new*100)/100; #rounding off to 2 decimals\n", "\n", "#Result\n", "print \"The velocity of the wave through wire is\",v, \"m/s\"\n", "print \"The frequency of the wave through wire is\",new, \"Hz\"\n", "\n", "#answer for frequency of the wave is wrong in the textbook" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The velocity of the wave through wire is 141.43 m/s\n", "The frequency of the wave through wire is 471.44 Hz\n" ] } ], "prompt_number": 15 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }