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
|
{
"metadata": {
"name": "",
"signature": "sha256:2693d83b10c8e62fc8d3ef78c9959c4d8327c36ed1f7884372585d33796bcbc3"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"2: Electromagnetic Theory"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 2.1, Page number 46"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
"#importing modules\n",
"from __future__ import division\n",
"from sympy import *\n",
"import math\n",
"\n",
"#Variable declaration\n",
"C = 10; #Capacitance of the capacitor(pF)\n",
"#given V=0.2*sin(120*math.pi*t) in volts\n",
"\n",
"#Calculation\n",
"C=C*10**-12; #Capacitance of the capacitor(F)\n",
"x, y, z, t = symbols('x y z t')\n",
"k, m, n = symbols('k m n', integer=True)\n",
"f, g, h = symbols('f g h', cls=Function)\n",
"#I = C*dV/dt\n",
"#let dV/dt be a\n",
"a=diff(0.2*sin(120*math.pi*t),t) #dV/dt\n",
"#value of dV/dt is 75.398223686155*cos(376.991118430775*t)\n",
"#for cosine function peak value occurs when 120*math.pi*t = 0\n",
"#therefore value of dV/dt becomes d = 75.398223686155\n",
"d = 75.398223686155; #value of dV/dt \n",
"I=C*d; #displacement current(A)\n",
"\n",
"#Result\n",
"print \"value of dV/dt is\",a\n",
"print \"displacement current is\",I, \"A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"value of dV/dt is 75.398223686155*cos(376.991118430775*t)\n",
"displacement current is 7.53982236862e-10 A\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 2.2, Page number 46"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
"#importing modules\n",
"from __future__ import division\n",
"from sympy import *\n",
"import math\n",
"\n",
"#Variable declaration\n",
"epsilon_r = 1; #Relative electrical permittivity of free space\n",
"epsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\n",
"#given E=sin(120*math.pi*t) in volts\n",
"\n",
"#Calculation\n",
"x, y, z, t = symbols('x y z t')\n",
"k, m, n = symbols('k m n', integer=True)\n",
"f, g, h = symbols('f g h', cls=Function)\n",
"#J2 = epsilon*dE/dt\n",
"epsilon=epsilon_0*epsilon_r;\n",
"#let dE/dt be a\n",
"a=diff(sin(120*math.pi*t),t) #dE/dt\n",
"#value of dE/dt is 376.991118430775*cos(376.991118430775*t)\n",
"#for cosine function peak value occurs when 120*math.pi*t = 0\n",
"#therefore value of dE/dt becomes d = 376.991118430775\n",
"d = 376.991118430775; #value of dE/dt\n",
"J2=epsilon*d; #displacement current density(A/m**2)\n",
"\n",
"#Result\n",
"print \"value of dE/dt is\",a\n",
"print \"The peak value of displacement current density is\",J2, \"A/m**2\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"value of dE/dt is 376.991118430775*cos(376.991118430775*t)\n",
"The peak value of displacement current density is 3.33787936259e-09 A/m**2\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 2.3, Page number 47 (Theoritical proof)"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 2.4, Page number 47"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
"#importing modules\n",
"from __future__ import division\n",
"import math\n",
"\n",
"#Variable declaration\n",
"p = 60; #Power rating of bulb(W)\n",
"d = 0.5; #Distance from the bulb(m)\n",
"\n",
"#Calculation\n",
"A=4*math.pi*d**2; #area(m**2)\n",
"P = p/A; #Value of Poynting vector(W/m**2)\n",
"P = math.ceil(P*100)/100; #rounding off value of P to 1 decimal\n",
"\n",
"#Result\n",
"print \"The value of Poynting vector is\",P, \"W/m**2\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The value of Poynting vector is 19.1 W/m**2\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 2.5, Page number 47"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
"#importing modules\n",
"from __future__ import division\n",
"import math\n",
"\n",
"#Variable declaration\n",
"E_peak = 6; #Peak value of electric field intensity(V/m)\n",
"c = 3*10**8; #Speed of electromagnetic wave in free space(m/s)\n",
"mew_0 = 4*math.pi*10**-7; #Absolute permeability of free space(Tm/A)\n",
"epsilon_0 = 8.854*10**-12; #Absolute permittivity of free space(F/m)\n",
"mew_r = 1; #Relative permeability of medium\n",
"epsilon_r = 3; #Relative permittivity of the medium\n",
"\n",
"#Calculation\n",
"v = c/math.sqrt(mew_r*epsilon_r); #Wave velocity(m/s)\n",
"v = v/10**8;\n",
"v = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\n",
"eta = math.sqrt((mew_0/epsilon_0)*(mew_r/epsilon_r)); #Intrinsic impedance of the medium(ohm)\n",
"eta = math.ceil(eta*10)/10; #rounding off the value of v to 1 decimal\n",
"H_P = E_peak/eta; #Peak value of the magnetic intensity(A/m)\n",
"H_P = H_P*10**2;\n",
"H_P = math.ceil(H_P*10**2)/10**2; #rounding off the value of v to 2 decimals\n",
"\n",
"#Result\n",
"print \"The wave velocity is\",v,\"*10**8 m/s\"\n",
"print \"The intrinsic impedance of the medium is\",eta, \"ohm\"\n",
"print \"The peak value of the magnetic intensity is\",H_P,\"*10**-2 A/m\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The wave velocity is 1.7321 *10**8 m/s\n",
"The intrinsic impedance of the medium is 217.6 ohm\n",
"The peak value of the magnetic intensity is 2.76 *10**-2 A/m\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|