summaryrefslogtreecommitdiff
path: root/Unified_Physics_by_S.L._Gupta,_Sanjeev_Gupta/Chapter1.ipynb
blob: 5f9944644af0a3b024a6e3b3b085408e552f964b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1: Atomic Spectra"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 1, Page number 42"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength separation is 0.168 angstrom\n",
      "answer in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration    \n",
    "e=1.6*10**-19;      #charge(coulomb)\n",
    "B=1;    #flux density(Wb/m**2)\n",
    "lamda=6000*10**-10;      #wavelength(m)\n",
    "m0=9.1*10**-31;        #mass(kg)\n",
    "c=3*10**8;      #velocity of light(m/sec)\n",
    "\n",
    "#Calculations\n",
    "d_lamda=B*e*(lamda**2)/(4*math.pi*m0*c);     #wavelength separation(m)\n",
    "d_lamda=d_lamda*10**10;      #wavelength separation(angstrom)\n",
    "\n",
    "#Result\n",
    "print \"wavelength separation is\",round(d_lamda,3),\"angstrom\"\n",
    "print \"answer in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example number 2, Page number 42"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "magnetic field is 5.89 *10**-2 tesla\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration    \n",
    "h=6.6*10**-34;        #planck's constant\n",
    "delta_v=8.3*10**8;     #frequency separation(Hz)\n",
    "mewB=9.3*10**-24;      #magnetic moment\n",
    "\n",
    "#Calculations\n",
    "B=h*delta_v/mewB;       #magnetic field(tesla)\n",
    "\n",
    "#Result\n",
    "print \"magnetic field is\",round(B*10**2,2),\"*10**-2 tesla\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 3, Page number 42"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ratio of charge to mass of electron is 1.753 *10**11 coulomb/kg\n",
      "answer in the book varies due to rounding off errors\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration    \n",
    "dv=120*10**6;      #frequency(Hz)\n",
    "B=8.6*10**-3;      #flux density(T)\n",
    "\n",
    "#Calculations\n",
    "r=4*math.pi*dv/B;       #ratio of charge to mass of electron(coulomb/kg)\n",
    "\n",
    "#Result\n",
    "print \"ratio of charge to mass of electron is\",round(r/10**11,3),\"*10**11 coulomb/kg\"\n",
    "print \"answer in the book varies due to rounding off errors\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 4, Page number 42"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the three wavelengths are 4226.4 angstrom 4226.73 angstrom 4227.06 angstrom\n",
      "answers for wavelengths given in the book are wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration    \n",
    "e=1.6*10**-19;      #charge(coulomb)\n",
    "B=4;    #flux density(Wb/m**2)\n",
    "lamda=4226.73*10**-10;      #wavelength(m)\n",
    "m0=9.1*10**-31;        #mass(kg)\n",
    "c=3*10**8;      #velocity of light(m/sec)\n",
    "\n",
    "#Calculations\n",
    "d_lamda=B*e*(lamda**2)/(4*math.pi*m0*c);     #wavelength separation(m)\n",
    "d_lamda=round(d_lamda*10**10,2);      #wavelength separation(angstrom)\n",
    "l1=(lamda*10**10)-d_lamda;\n",
    "l2=lamda*10**10;\n",
    "l3=(lamda*10**10)+d_lamda;       #three wavelengths\n",
    "\n",
    "#Result\n",
    "print \"the three wavelengths are\",l1,\"angstrom\",l2,\"angstrom\",l3,\"angstrom\"\n",
    "print \"answers for wavelengths given in the book are wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 5, Page number 43"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ratio of charge to mass of electron is 1.75 *10**11 C/kg\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration    \n",
    "dlamda=0.0116*10**-9;      #frequency(m)\n",
    "B=1;      #flux density(T)\n",
    "lamda=500*10**-9;         #wavelength(m)\n",
    "c=3*10**8;         #velocity of light(m/sec)\n",
    "\n",
    "#Calculations\n",
    "r=4*math.pi*c*dlamda/(B*lamda**2);       #ratio of charge to mass of electron(coulomb/kg)\n",
    "\n",
    "#Result\n",
    "print \"ratio of charge to mass of electron is\",round(r/10**11,2),\"*10**11 C/kg\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}