diff options
author | nice | 2014-08-27 16:12:51 +0530 |
---|---|---|
committer | nice | 2014-08-27 16:12:51 +0530 |
commit | 238d7e632aecde748a97437c2b5774e136a3b4da (patch) | |
tree | a05d96f81cf72dc03ceec32af934961cf4ccf7dd /Modern_Physics/Chapter1.ipynb | |
parent | 7e82f054d405211e1e8760524da8ad7c9fd75286 (diff) | |
download | Python-Textbook-Companions-238d7e632aecde748a97437c2b5774e136a3b4da.tar.gz Python-Textbook-Companions-238d7e632aecde748a97437c2b5774e136a3b4da.tar.bz2 Python-Textbook-Companions-238d7e632aecde748a97437c2b5774e136a3b4da.zip |
adding book
Diffstat (limited to 'Modern_Physics/Chapter1.ipynb')
-rwxr-xr-x | Modern_Physics/Chapter1.ipynb | 404 |
1 files changed, 404 insertions, 0 deletions
diff --git a/Modern_Physics/Chapter1.ipynb b/Modern_Physics/Chapter1.ipynb new file mode 100755 index 00000000..d442fd97 --- /dev/null +++ b/Modern_Physics/Chapter1.ipynb @@ -0,0 +1,404 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d8ffd8fd29d5d24b3cc8b2545e898e818e9d8ef837edfe4af93ac3d5f1b9fea0" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 1: RELATIVITY" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.2, page no. 18" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "#Variable declaration\n", + "T1 = 3.0 #proper time(s)\n", + "c = 3 * 10**8 #Speed of light(m/s)\n", + "v = 0.95 * c #speed of observer(m/s)\n", + "\n", + "#calculation\n", + "\n", + "Y = 1/math.sqrt((1-(v/c)**2)) #factor by which it runs slower\n", + "T = Y * T1 #Period of the pendulum (s)\n", + "\n", + "#result\n", + "print \"The Period of the pendulum when measured by the observer is\",round(T,1),\"s\"\n", + "\n", + "\n", + "#Variable declaration\n", + "T1 = 3.0 #proper time(s)\n", + "c = 3 * 10**8 #Speed of light(m/s)\n", + "Vnew = (0.95 + 0.05*0.95) * c #speed of observer(m/s)\n", + "\n", + "#calculation\n", + "\n", + "Y = 1/math.sqrt((1-(Vnew/c)**2))\n", + "T = Y * T1 \n", + "\n", + "#result\n", + "print \"Exercise:The Period of the pendulum when measured by the observer is\",round(T,1),\"s\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Period of the pendulum when measured by the observer is 9.6 s\n", + "Exercise:The Period of the pendulum when measured by the observer is 42.5 s\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.3, page no. 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "\n", + "import math\n", + "\n", + "#variable declaration\n", + "\n", + "Lp = 100 #proper length of the spaceship(m)\n", + "c = 3 * 10**8 #speed of light(m/s)\n", + "v = 0.99 * c #speed of the observer(m/s)\n", + "\n", + "#calculation\n", + "\n", + "L = Lp * math.sqrt((1-(v/c)**2)) #Length of the spaceship (m)\n", + "\n", + "#result\n", + "\n", + "print \"The length measured as the spaceship flies by is\",round(L),\"m\"\n", + "\n", + "#variable declaration\n", + "\n", + "Lp = 100 #proper length of the spaceship(m)\n", + "c = 3 * 10**8 #speed of light(m/s)\n", + "v = 0.01 * c #speed of the observer(m/s)\n", + "\n", + "#calculation\n", + "\n", + "L = Lp * math.sqrt((1-(v/c)**2))\n", + "\n", + "#result\n", + "\n", + "print \"Exercise:The length measured as the spaceship flies by is\",round(L,2),\"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The length measured as the spaceship flies by is 14.0 m\n", + "Exercise:The length measured as the spaceship flies by is 99.99 m\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.4, page no. 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#variable declaration\n", + "\n", + "Lp = 435 #proper length of the spaceship(m)\n", + "c = 3 * 10**8 #speed of light(m/s)\n", + "v = 0.97 * c #speed of the spaceship(m/s)\n", + "\n", + "#calculation\n", + "\n", + "L = Lp * math.sqrt((1-(v/c)**2)) #altitude of the spaceship (m)\n", + "\n", + "#result\n", + "\n", + "print \"The altitude of the spaceship as measured by an observer in the spaceship is\",round(L),\"m\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The altitude of the spaceship as measured by an observer in the spaceship is 106.0 m\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.5, page no. 20" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#variable declaration\n", + "\n", + "Lp = 50 #horizontal length of the spaceship (m)\n", + "c = 3 * 10**8 #speed of light (m/s)\n", + "v = 0.95 * c #speed of the observer (m/s)\n", + "\n", + "#calculation\n", + "\n", + "L = Lp * math.sqrt((1-(v/c)**2)) #length (m)\n", + "\n", + "#result\n", + "\n", + "print \"The horizontal length measured as seen by the observer\",round(L,1),\"m.\\nThe 25m vertical height is unchanged because it is perpendicular to the direction of relative motion between the observer and the spaceship.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The horizontal length measured as seen by the observer 15.6 m.\n", + "The 25m vertical height is unchanged because it is perpendicular to the direction of relative motion between the observer and the spaceship.\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.6, page no. 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#variable declaration\n", + "\n", + "Yobs = 475.0 #observed wavelength (nm)\n", + "Ysource = 394.0 #source wavelength (nm)\n", + "c = 3 * 10**8 #speed of light (m/s)\n", + "\n", + "#calculation\n", + "\n", + "v = c*(((Yobs**2)-(Ysource**2))/((Yobs**2)+(Ysource**2))) #velocity (m/s)\n", + "\n", + "#result\n", + "\n", + "print \"The Hydra is receding from us at\",round(v/10**7,2),\"x 10^7 m/s\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Hydra is receding from us at 5.54 x 10^7 m/s\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.8, page no. 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Variable declaration\n", + "\n", + "c = 3 * 10 **8 #speed of light (m/s)\n", + "v = 0.750 * c #speed of spacecraft A relative to an observer on Earth(m/s)\n", + "ux = -0.850 *c #speed of spacecraft B relative to an observer on Earth(m/s)\n", + "\n", + "#calculation\n", + "\n", + "ux1 = (ux-v)/(1-((ux*v)/(c**2))) #velocity (m/s)\n", + "\n", + "#results\n", + "\n", + "print \"The velocity of B with respect to A is\",round(ux1/c,4),\"c\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The velocity of B with respect to A is -0.9771 c\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.9, page no. 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "#Variable declaration\n", + "\n", + "c = 3 * 10 **8 #speed of light (m/s)\n", + "v = 0.800 * c #velocity of the motorcycle with respect to the stationary observer (m/s)\n", + "ux1 = 0.700 *c #velocity of the ball in the frame of reference of the motorcyclist (m/s)\n", + "\n", + "#calculation\n", + "\n", + "ux = (ux1+v)/(1+((ux1*v)/(c**2))) #velocity (m/s)\n", + "\n", + "#results\n", + "\n", + "print \"The velocity of the ball relative to the stationary observer is\",round(ux/c,4),\"c\"\n", + "\n", + "\n", + "#Variable declaration\n", + "\n", + "c = 3 * 10 **8 #speed of light (m/s)\n", + "v = 0.800 * c #velocity of the motorcycle with respect to the stationary observer (m/s)\n", + "ux1 = c #velocity of the beam of light in the frame of reference of the motorcyclist (m/s)\n", + "\n", + "#calculation\n", + "\n", + "ux = (ux1+v)/(1+((ux1*v)/(c**2))) #velocity (m/s)\n", + "\n", + "#results\n", + "\n", + "print \"The speed of the beam of light relative to the stationary observer is\",round(ux/c,4),\"c\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The velocity of the ball relative to the stationary observer is 0.9615 c\n", + "The speed of the beam of light relative to the stationary observer is 1.0 c\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 1.10, page no. 30" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "#Variable declaration\n", + "\n", + "c = 3 * 10 **8 #speed of light (m/s)\n", + " #observations of stationary police officer\n", + "uxa = 0.75 * c # velocity of pack leader Alpha in x direction (m/s)\n", + "uya = 0 # velocity of pack leader Alpha in y direction (m/s)\n", + "uxb = 0 # velocity of pack leader Beta in x direction (m/s)\n", + "uyb = -0.9 * c # velocity of pack leader Beta in y direction (m/s) \n", + " \n", + "#calculation\n", + "\n", + "ux1 = (uxb-uxa)/(1-((uxb*uxa)/(c**2))) #speed in X axis (m/s)\n", + "uy1 = (math.sqrt(1-((uxa**2)/(c**2)))*(uyb))#/(1-((uxb*uxa)/(c**2))) #speed in Y axis (m/s)\n", + "u1 = math.sqrt(ux1**2 + uy1**2) #total speed (m/s)\n", + "\n", + "#results\n", + "\n", + "print \"The speed of recession of Beta away from Alpha as observed by Alpha is then found to be\",round(u1/c,2),\"c\"\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The speed of recession of Beta away from Alpha as observed by Alpha is then found to be 0.96 c\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |