summaryrefslogtreecommitdiff
path: root/Engineering_Physics_Malik/Chapter_7.ipynb
diff options
context:
space:
mode:
authornice2014-09-16 17:48:17 +0530
committernice2014-09-16 17:48:17 +0530
commitb8bb8bbfa81499ad7fc3f3508be257da65f543af (patch)
tree204976d3209b79a52e8518c65fa27a4ca48f8489 /Engineering_Physics_Malik/Chapter_7.ipynb
parent2792e8d6ecab454e3cb8fb1ea1f26f1613bc1e1c (diff)
downloadPython-Textbook-Companions-b8bb8bbfa81499ad7fc3f3508be257da65f543af.tar.gz
Python-Textbook-Companions-b8bb8bbfa81499ad7fc3f3508be257da65f543af.tar.bz2
Python-Textbook-Companions-b8bb8bbfa81499ad7fc3f3508be257da65f543af.zip
updating repo
Diffstat (limited to 'Engineering_Physics_Malik/Chapter_7.ipynb')
-rw-r--r--Engineering_Physics_Malik/Chapter_7.ipynb569
1 files changed, 569 insertions, 0 deletions
diff --git a/Engineering_Physics_Malik/Chapter_7.ipynb b/Engineering_Physics_Malik/Chapter_7.ipynb
new file mode 100644
index 00000000..6762cbc5
--- /dev/null
+++ b/Engineering_Physics_Malik/Chapter_7.ipynb
@@ -0,0 +1,569 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Waves and Oscillations"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.1, Page 7.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi, sin, sqrt\n",
+ "\n",
+ "# Given \n",
+ "E = 1.024e-3 # total energy of particle in J\n",
+ "T = 2 * pi # time period of S.H.M. in sec\n",
+ "x = 0.08 * sqrt(2) # distance of partile in meter\n",
+ "t = pi / 4 # time in second\n",
+ "\n",
+ "#Calculations\n",
+ "A = x / sin((2 * pi * t) / T)\n",
+ "M = (E * T**2) / (2 * pi**2 * A**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"Amplitude = %.2f meter\\nMass of particle = %.f g\"%(A,M/1e-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amplitude = 0.16 meter\n",
+ "Mass of particle = 80 g\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.2, Page 7.22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi\n",
+ "\n",
+ "# Given \n",
+ "A = 0.05 # amplitude in meter\n",
+ "T = 10 # time period of S.H.M. in sec\n",
+ "\n",
+ "#Calculations\n",
+ "v = (A * 2 * pi) / T\n",
+ "\n",
+ "#Result\n",
+ "print \"Maximum amplitude of velocity = %.4f meter/sec\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum amplitude of velocity = 0.0314 meter/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.3, Page 7.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi, sqrt\n",
+ "\n",
+ "# Given \n",
+ "E = 9 # total energy of particle in J\n",
+ "U = 5 # potential energy in J\n",
+ "A = 1 # amplitude in meter\n",
+ "m = 2. # mass of harmonic oscillator in kg\n",
+ "\n",
+ "#Calculations\n",
+ "kE = E - U# calculation for kinetic energy\n",
+ "k = (2 * kE) / A**2# calculation for force constant\n",
+ "T = (2 * pi) * sqrt(m / k)# calculation for time period\n",
+ "\n",
+ "#Result\n",
+ "print \"Force constant = %.f J/m\\nTime period = %.2f sec\"%(k,T)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Force constant = 8 J/m\n",
+ "Time period = 3.14 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.4, Page 7.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import asin, sin, pi\n",
+ "\n",
+ "# Given \n",
+ "A = 0.06 # amplitude in meter\n",
+ "T = 6 # time period of S.H.M. in sec\n",
+ "x = 0.03 # position of particle in meter\n",
+ "\n",
+ "#Calculations\n",
+ "delta = asin(1) # by the formula x=Asin(wt+delta) and (at t = 0,x=A) \n",
+ "t = x / (A * sin(((2 * pi) / T) + delta))\n",
+ "\n",
+ "#Result\n",
+ "print \"Time taken by the particle = %.f sec\"%t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time taken by the particle = 1 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.5, Page 7.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi\n",
+ "\n",
+ "# Given \n",
+ "A = 0.05# amplitude in meter\n",
+ "T = 10 * pi # time period of s.h.m. in sec\n",
+ "\n",
+ "#Calculations\n",
+ "v = A * (2 * pi / T)\n",
+ "a = A * (2 * pi / T)**2\n",
+ "\n",
+ "#Result\n",
+ "print \"Maximum velocity = %.e meter/sec\\nacceleration = %.e m/sec^2\"%(v,a)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum velocity = 1e-02 meter/sec\n",
+ "acceleration = 2e-03 m/sec^2\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.6, Page 7.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi\n",
+ "\n",
+ "# Given \n",
+ "A = 0.06# amplitude in meter\n",
+ "T = 10 * pi # time period of s.h.m. in sec\n",
+ "\n",
+ "#Calculation\n",
+ "v = A * (2 * pi / T)\n",
+ "\n",
+ "#Result\n",
+ "print \"Maximum velocity = %.1e meter/sec\"%v"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum velocity = 1.2e-02 meter/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.7, Page 7.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt, pi\n",
+ "\n",
+ "# Given \n",
+ "k = 16 # stiffness constant of spring n/m\n",
+ "m = 1 # mass of particle in kg\n",
+ "\n",
+ "#Calculations\n",
+ "n = sqrt(k / m) / (2 * pi)\n",
+ "\n",
+ "#Result\n",
+ "print \"natural frequency = %.2f Hz\"%n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "natural frequency = 0.64 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.8, Page 7.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt, pi\n",
+ "\n",
+ "# Given \n",
+ "l = 1 # length of pendulum in meter\n",
+ "m = 2 # mass of particle in kg\n",
+ "g = 9.8 # acceleration due to gravity in m/sec^2\n",
+ "\n",
+ "#Calculation\n",
+ "T = 2 * pi * sqrt(l / g)\n",
+ "\n",
+ "#Result\n",
+ "print \"The time period of pendulum = %.f sec\"%T"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The time period of pendulum = 2 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.9, Page 7.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt, pi\n",
+ "\n",
+ "# Given \n",
+ "m = 100. # mass of particle in gm\n",
+ "\n",
+ "#Calculation\n",
+ "n = (1 / (2 * pi)) * sqrt(10 / m) # by using given formula \n",
+ "\n",
+ "#Result\n",
+ "print \"Frequency = %.2f Hz\"%n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency = 0.05 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.10, Page 7.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt, pi\n",
+ "\n",
+ "# Given \n",
+ "f = 3 # acceleration of pendulum in m/sec^2\n",
+ "l = 1 # length of pendulum in meter\n",
+ "g = 9.8 # acceleration due to gravity in m/sec^2\n",
+ "\n",
+ "#calculatiom\n",
+ "T = 2 * pi * sqrt(l / (g + f))\n",
+ "\n",
+ "#Result\n",
+ "print \"Time period of pendulum = %.2f sec\"%T"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time period of pendulum = 1.76 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.11, Page 7.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt, pi\n",
+ "\n",
+ "# Given \n",
+ "x = 0.3 # stretch in spring in meter\n",
+ "m1 = 6 # mass of first body in kg\n",
+ "m2 = 1 # mass of second body in kg\n",
+ "g = 9.8 # gravitational acceleration of earth in m/sec^2\n",
+ "\n",
+ "#Calculations\n",
+ "k = (m1 * g) / x\n",
+ "T = (2 * pi) * sqrt(m2 / k)\n",
+ "\n",
+ "#Result\n",
+ "print \"Time period of motion = %.2f sec \"%T"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time period of motion = 0.45 sec \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.12, Page 7.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt, pi\n",
+ "\n",
+ "# Given \n",
+ "x = 0.1 # compression in spring in m\n",
+ "F = 10 # restoring force in N\n",
+ "m = 4 # mass of body in kg\n",
+ "g = 9.8 # acceleration due to gravity in m/sec^2\n",
+ "\n",
+ "#Calculations\n",
+ "k = F / x\n",
+ "F_ = m * g\n",
+ "x_ = F_ / k\n",
+ "T = (2 * pi) * sqrt(m / k)\n",
+ "\n",
+ "#Result\n",
+ "print \"Time period of motion = %.2f sec \\nCompression of the spring due to the weight of the body = %.3f m \"%(T,x_)\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time period of motion = 1.26 sec \n",
+ "Compression of the spring due to the weight of the body = 0.392 m \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.13, Page 7.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp\n",
+ "\n",
+ "# Given \n",
+ "t = 50. # relaxation time in sec\n",
+ "r = 1 / exp(1) # falls in amplitude and energy\n",
+ "\n",
+ "#Calculations\n",
+ "s = 1 / (2 * t)\n",
+ "T = 1 / s # by using formula A=A_exp(-st) and using r=A/A_\n",
+ "\n",
+ "#Result\n",
+ "print \"Time = %.f sec\"%T\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time = 100 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 7.14, Page 7.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi, exp\n",
+ "\n",
+ "# Given \n",
+ "n = 260 # frequency in Hz\n",
+ "Q = 2000 # quality factor\n",
+ "r = 1 / (exp(1)**2) # decrease in amplitude \n",
+ "\n",
+ "#Calculations\n",
+ "tou = Q / (2 * pi * n)\n",
+ "t = 2 * tou # by using formula A=A_exp(-st) and using r=A/A_\n",
+ "\n",
+ "#Result\n",
+ "print \"Time = %.3f sec\"%t\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time = 2.449 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file