summaryrefslogtreecommitdiff
path: root/Oscillations_and_Waves_by_S._Prakash/chapter17.ipynb
blob: d7df3137c2284458314b0fb57f40bf27d4507837 (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
245
246
{
 "metadata": {
  "name": "",
  "signature": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 17, Electromagnetic waves"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1, page 550"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "from numpy import pi\n",
      "# magnitude\n",
      "#given data :\n",
      "R=7*10**8 # in m\n",
      "P=3.8*10**26 # in Watt\n",
      "S=P/(4*pi*R**2) \n",
      "print \"Magnitude of poynting vector, S = %0.3e W/m^2 \" %S"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnitude of poynting vector, S = 6.171e+07 W/m^2 \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2, page 551"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "# Poynting vector\n",
      "#given data :\n",
      "R=1.5*10**11 # in m\n",
      "P=3.8*10**26 # in Watt\n",
      "S=P/(4*pi*R**2) # in W/m**2\n",
      "Se=round(S*60/(4.2*10**4)) \n",
      "print \"Poynting vector, Se = %0.2f cal/cm^2-m \" %Se"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Poynting vector, Se = 2.00 cal/cm^2-m \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3, page 560"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import sqrt\n",
      "# Amplitude and magnetic field\n",
      "#given data :\n",
      "S=2 # in cal/cm**2- min\n",
      "EH=S*4.2*10**4/60 # joule/m**2 sec\n",
      "mu0=4*pi*10**-7 \n",
      "epsilon0=8.85*10**-12 \n",
      "EbyH=sqrt(mu0/epsilon0) \n",
      "E=sqrt(EH*EbyH) \n",
      "H=EH/E \n",
      "E0=E*sqrt(2) \n",
      "H0=H*sqrt(2) \n",
      "print \"E = %0.2f V/m \"%E\n",
      "print \"H  = %0.3f Amp-turn/m \"%H\n",
      "print \"Amplitude of electric fields of radiation, E0 = %0.f V/m  \" %E0\n",
      "print \"Magnetice field of radition, H0 = %0.2f Amp-turn/m \" %H0"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "E = 726.32 V/m \n",
        "H  = 1.928 Amp-turn/m \n",
        "Amplitude of electric fields of radiation, E0 = 1027 V/m  \n",
        "Magnetice field of radition, H0 = 2.73 Amp-turn/m \n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4, page 560"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "# electric and magnetic field\n",
      "#given data :\n",
      "r=2 # in m\n",
      "mu0=4*pi*10**-7 \n",
      "epsilon0=8.85*10**-12 \n",
      "EbyH=sqrt(mu0/epsilon0) \n",
      "EH=1000/(4*r**2*pi**2) # in W/m**2\n",
      "E=sqrt(EH*EbyH) \n",
      "H=(EH/E) \n",
      "print \"Intensities of electric, E = %0.2f V/m\" %E\n",
      "print \"Magnetic field of radiation, H = %0.4f Amp-turn/m  \" %H"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Intensities of electric, E = 48.85 V/m\n",
        "Magnetic field of radiation, H = 0.1296 Amp-turn/m  \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5, page 593"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import degrees, pi, asin, sin, tan\n",
      "# Degree of polarization\n",
      "#given data :\n",
      "thetai=45 # in degree\n",
      "n=1.5 #/ index\n",
      "thetar=asin(sin(thetai*pi/180)/n) # radian\n",
      "thetar= degrees(thetar)\n",
      "Rl=sin((thetai-thetar)*pi/180)**2/sin((thetai+thetar)*pi/180)**2 \n",
      "Rp=tan(thetai-thetar*pi/180)**2/tan((thetai+thetar)*pi/180)**2 \n",
      "D=((Rl-Rp)/(Rl+Rp))*100 \n",
      "print \"Degree of polarization, D = %0.2f %%\" %D\n",
      "# answer is wrong in the textbook"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Degree of polarization, D = 49.44 %\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6, page 594"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Frequency\n",
      "#given data :\n",
      "Del=1 # in m\n",
      "mu=4*pi*10**-7 # in H/m\n",
      "sigma=4 # in siemen/m\n",
      "v=1*10**-3/(pi*Del**2*mu*sigma) \n",
      "print \"Frequency, v = %0.1f kHz \" %v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency, v = 63.3 kHz \n"
       ]
      }
     ],
     "prompt_number": 16
    }
   ],
   "metadata": {}
  }
 ]
}