diff options
Diffstat (limited to 'Engineering_Physics/Chapter1_1.ipynb')
-rw-r--r-- | Engineering_Physics/Chapter1_1.ipynb | 217 |
1 files changed, 217 insertions, 0 deletions
diff --git a/Engineering_Physics/Chapter1_1.ipynb b/Engineering_Physics/Chapter1_1.ipynb new file mode 100644 index 00000000..c487a981 --- /dev/null +++ b/Engineering_Physics/Chapter1_1.ipynb @@ -0,0 +1,217 @@ +{ + "metadata": { + "name": "Chapter1" + }, + "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": "#To calculate the period of motion\n\n#import modules\nimport math\n\n#Variable declaration\nS=4; #SHM described by a particle(cm)\nx=0; #mean position\nv=12; #velocity at mean position(cm/s)\n\n#Calculation\nA=S/2; #amplitude of motion(cm)\nomega=v/A; #angular frequency(sec-1)\nT=(2*math.pi)/omega; #time period(sec)\nT=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"time period of motion is\",T, \"sec\"\nprint \"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\ntime 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": "#To calculate the acceleration and maximum velocity\n\n#import modules\nimport math\n\n#Variable declaration\nT=0.1; #time period(sec)\nA=4; #amplitude of motion(cm)\nx=0.2; #distance from mean position(cm)\n\n#Calculation\nomega=(2*math.pi)/T; #angular frequency(sec-1)\na=(omega**2)*x; #acceleration(cm/sec^2)\na=math.ceil(a*10**2)/10**2; #rounding off to 2 decimals\n#maximum velocity is when particle is in the mean position\nv_max=omega*A; #maximum velocity(cm/sec)\nv_max=math.ceil(v_max*10**2)/10**2; #rounding off to 2 decimals\n\n#Result\nprint \"acceleration is\",a, \"cm/sec^2\"\nprint \"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\nmaximum 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": "#To calculate the damping constant\n\n#import modules\nimport math\nimport numpy as np\n\n#Variable declaration\nA1 = 40; #First amplitude of oscillation(cm)\nAn_plus_1 = 4; #Amplitude after 100 oscillations(cm)\nn = 100; #Number of oscillations\nT = 2.5; #Time period of oscillations(s)\n\n#Calculation\nt = 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)\nx=A1/An_plus_1;\nlamda=np.log(x)/(n*T); #Damping constant(per sec)\nlamda=lamda*10**2;\nlamda=math.ceil(lamda*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"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": "#To calculate the amplitude and period of oscillation\n\n#import modules\nimport math\n\n#Variable declaration\nx1 = 3; #First position of the particle(cm)\nx2 = 4; #Second position of the particle(cm)\nv1 = 16; #Velocity of particle executing SHM at 1st position(cm/s)\nv2 = 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\nA=math.sqrt((((v1**2)*(x2**2))-((v2**2)*(x1**2)))/((v1**2)-(v2**2))); #amplitude in cm\nomega=v1/math.sqrt(A**2-x1**2); #Angular speed of the particle(per sec)\nT=2*math.pi/omega; #Time period of oscillation(sec)\nT=math.ceil(T*10**3)/10**3; #rounding off to 3 decimals\n\n#Result\nprint \"The amplitude of SHM is\",A, \"cm\"\nprint \"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\nThe 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": "#To calculate the spring constant, amplitude and maximum velocity\n\n#import modules\nimport math\n\n#Variable declaration\nm = 0.3; #Mass attached to the string(kg)\ng = 9.8; #Acceleration due to gravity(m/sec**2)\nx = 0.15; #Stretchness produced in the spring(m)\ns = 0.1; #spring is stretched and released(m)\n\n#Calculation\nF = m*g; #Restoring force acting on the mass(N)\nk = F/x; #Spring constant(N/m)\nA = s; #amplitude equals to the spring stretched and released\nomega = math.sqrt(k/m); #Angular frequency of oscillation(rad per sec)\nv0 = omega*A; #Maximum velocity during the oscillations(m/s)\nv0=math.ceil(v0*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"The spring constant is\",k, \"N/m\"\nprint \"The amplitude of oscillation is\",A, \"m\"\nprint \"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\nThe amplitude of oscillation is 0.1 m\nThe 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": "#To calculate the frequency equivalent of visible region\n\n#import modules\nimport math\n\n#Variable declaration\nlambda1 = 400; #Lower limit of wavelength of visible region(nm)\nlambda2 = 700; #Upper limit of wavelength of visible region(nm)\nc = 3*10**8; #Speed of light in vacuum(m/s)\n\n#Calculation\nlambda1 = lambda1*10**-9 #Lower limit of wavelength(m) \nlambda2 = lambda2*10**-9 #upper limit of wavelength(m) \nnew_1 = c/lambda1; #Upper limit of frequency of visible region(m)\nnew_2 = c/lambda2; #Lower limit of frequency of visible region(m)\n\n#Result\nprint \"The frequency equivalent of 400 nm is\",new_1, \"Hz\"\nprint \"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\nThe 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": "#To calculate the amplitude, wavelength, frequency and velocity of the wave\n\n#import modules\nimport math\nfrom __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\nA = 1.5*10**-3; #Amplitude of the sound wave(m)\nlamda = 8; #Wavelength of the sound wave(m)\nT = 1/40; #Time period of the sound wave(s)\n\n#Calculation\nA = A*10**3;\nnew = 1/T; #Frequency of the sound wave(Hz)\nv = new*lamda; #Velocity of the sound wave(m/s)\nT=math.ceil(T*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"The amplitude of the sound wave is\",A,\"*10**-3 m\"\nprint \"The wavelength of the sound wave is\",lamda, \"m\"\nprint \"The time period of the sound wave is\",T, \"s\"\nprint \"The frequency of the sound wave is\",new, \"Hz\"\nprint \"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\nThe wavelength of the sound wave is 8 m\nThe time period of the sound wave is 0.03 s\nThe frequency of the sound wave is 40.0 Hz\nThe 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": "#To find the equation of a wave\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nA = 2; #Amplitude of the wave(cm)\nT = 0.5; #Time period of the wave(sec)\nv = 200; #Wave velocity(cm/s)\n\n#Calculation\nf = 1/T; #Frequency of the wave(Hz)\nlamda = v/f; #Wavelength of the wave(cm)\n\n#Result\nprint \"frequency of wave is\",f, \"Hz\"\nprint \"wavelength of wave is\",lamda, \"cm\"\nprint \"The Equation of the wave moving along X-axis :\"\nprint \"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\nwavelength of wave is 100.0 cm\nThe Equation of the wave moving along X-axis :\nu = 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": "#To find the velocity and frequency of the wave\n\n#import modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nT = 1000; #Tension in the wire(N)\nM=15; #mass of the wire(kg)\nl=300; #length of the wire(m)\nlamda = 0.30; #Wavelength of wave along wire(m)\n\n#Calculation\nm = M/l; #Mass per unit length of the wire(kg/m)\nv = math.sqrt(T/m); #Velocity of wave through wire(m/s)\nv=math.ceil(v*100)/100; #rounding off to 2 decimals\nnew = v/lamda; #Frequency of wave through string(Hz)\nnew=math.ceil(new*100)/100; #rounding off to 2 decimals\n\n#Result\nprint \"The velocity of the wave through wire is\",v, \"m/s\"\nprint \"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\nThe 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": {} + } + ] +}
\ No newline at end of file |