summaryrefslogtreecommitdiff
path: root/sample_notebooks/MohdAsif/Chapter5.ipynb
diff options
context:
space:
mode:
authorhardythe12015-06-11 17:31:11 +0530
committerhardythe12015-06-11 17:31:11 +0530
commit79c59acc7af08ede23167b8455de4b716f77601f (patch)
tree2d6ff34b6f131d2671e4c6b798f210b3cb1d4ac7 /sample_notebooks/MohdAsif/Chapter5.ipynb
parentdf60071cf1d1c18822d34f943ab8f412a8946b69 (diff)
downloadPython-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.tar.gz
Python-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.tar.bz2
Python-Textbook-Companions-79c59acc7af08ede23167b8455de4b716f77601f.zip
add books
Diffstat (limited to 'sample_notebooks/MohdAsif/Chapter5.ipynb')
-rwxr-xr-xsample_notebooks/MohdAsif/Chapter5.ipynb247
1 files changed, 247 insertions, 0 deletions
diff --git a/sample_notebooks/MohdAsif/Chapter5.ipynb b/sample_notebooks/MohdAsif/Chapter5.ipynb
new file mode 100755
index 00000000..e36093b9
--- /dev/null
+++ b/sample_notebooks/MohdAsif/Chapter5.ipynb
@@ -0,0 +1,247 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:abf9f7aa50395283288e62f0f85bd91bae92b4155380f5c281c2602a3861ceb7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter - 5 Wave Motion and speed"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1, page : 115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from math import pi\n",
+ "#frequency\n",
+ "r=3 #m\n",
+ "w=10 #s**-1\n",
+ "vs=r*w #m/s\n",
+ "A=6 #m\n",
+ "fd=5/pi #s**-1\n",
+ "vmax=A*2*pi*fd #m/s\n",
+ "v=330 #m/s\n",
+ "n=340 #Hz\n",
+ "nmax=((v+vmax)/(v-vs))*n #Hz\n",
+ "nmin=((v-vmax)/(v+vs))*n #Hz\n",
+ "print \"Maximum frequency is \",nmax,\" Hz\"\n",
+ "print \"Minimum frequency is \",nmin,\" Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum frequency is 442.0 Hz\n",
+ "Minimum frequency is 255.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2, page : 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# frequency\n",
+ "#given data :\n",
+ "N=400 #hZ\n",
+ "V=340 #M/S\n",
+ "VS=60 #M/S\n",
+ "N2=((V/(V-VS))*N) #Hz\n",
+ "print \"Frequency when engine is approaching to the listner is \",round(N2,2),\" Hz\"\n",
+ "N3=((V/(V+VS))*N) #Hz\n",
+ "print \"Frequency when engine is moving away from the listner is \",round(N3,2),\" Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency when engine is approaching to the listner is 485.71 Hz\n",
+ "Frequency when engine is moving away from the listner is 340.0 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 3, page : 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "#frequency\n",
+ "v=1200 #km/h\n",
+ "w=40 #km/h\n",
+ "vs=40 #km/h\n",
+ "n=580 #Hz\n",
+ "nd=((v+vs)/((v+vs)-vs))*n #Hz\n",
+ "print \"Frequency of the whistle as heared by an observer on the hill is \",round(nd,2),\" Hz\"\n",
+ "x=29/30 #km\n",
+ "x*=1000 #m\n",
+ "print \"Distance is \",round(x,2),\" m\"\n",
+ "ndd=((v-w)+vs)/((v-w))*nd #Hz\n",
+ "print \"Frequency heared by driver is \",round(nd,2),\" Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of the whistle as heared by an observer on the hill is 599.33 Hz\n",
+ "Distance is 966.67 m\n",
+ "Frequency heared by driver is 599.33 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 5, page :125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "#frequency\n",
+ "v=340 #m/s\n",
+ "n=600 #Hz\n",
+ "vs=36 #km h**-1\n",
+ "vs1=vs*(1000/3600) #m/s\n",
+ "apf=((v)/(v-vs1))*n #Hz\n",
+ "vs2=54 #km h**-1\n",
+ "vs3=vs2*(1000/3600) #m/s\n",
+ "apf1=((v)/(v+vs3))*n #Hz\n",
+ "print \"Two apparent frequencies are \",round(apf,2),\" Hz and \",round(apf1,2),\" Hz\"\n",
+ "df=apf-apf1 #Hz\n",
+ "print \"Difference in frequencies is \",round(df,2),\" Hz\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Two apparent frequencies are 618.18 Hz and 574.65 Hz\n",
+ "Difference in frequencies is 43.53 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 9, page : 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from math import sqrt, pi\n",
+ "#foce constant,displacement , acceleration and energy\n",
+ "x1=.10 # in m\n",
+ "F1=4 # in N\n",
+ "K=F1/x1 \n",
+ "x2=0.12 # in m\n",
+ "print \"(a) The force constant, K = \",K,\" N/m \"\n",
+ "F=-K*x2 \n",
+ "print \"(b) The force, F = \",F, \" N\"\n",
+ "m=1.6 # in kg\n",
+ "T=2*pi*sqrt(m/K) \n",
+ "print \"(c) Period of pscillation, T = \",round(T,2), \" s\"\n",
+ "A=x2 \n",
+ "print \"(d) Amplitude of motion,A = \",A, \" m\"\n",
+ "alfa=A*K/m \n",
+ "print \"(e) Maximum acceleration,alfa = \",alfa,\" m/s**2\"\n",
+ "x=A/2 # in m\n",
+ "w=sqrt(K/m) \n",
+ "v=w*sqrt(A**2-x**2) \n",
+ "a=w**2*x # in m/s**2\n",
+ "KE=(1/2)*m*v**2 # in J\n",
+ "PE=(1/2)*K*x**2 # in J\n",
+ "TE=KE+PE \n",
+ "print \"\"\"(f) velocity is %0.2f m/s\n",
+ "acceleration %0.2f m/s**2\n",
+ "Kinetic energy is %0.2f J\n",
+ "Potential energy is %0.2f J\"\"\" %(v,a,KE,PE)\n",
+ "print \"(g) Total energy of the oscillating system %0.2f J\" %TE"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The force constant, K = 40.0 N/m \n",
+ "(b) The force, F = -4.8 N\n",
+ "(c) Period of pscillation, T = 1.26 s\n",
+ "(d) Amplitude of motion,A = 0.12 m\n",
+ "(e) Maximum acceleration,alfa = 3.0 m/s**2\n",
+ "(f) velocity is 0.52 m/s\n",
+ "acceleration 1.50 m/s**2\n",
+ "Kinetic energy is 0.22 J\n",
+ "Potential energy is 0.07 J\n",
+ "(g) Total energy of the oscillating system 0.29 J\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file