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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 24: Gauss Law"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 24.1: Sample_Problem_1.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"exec('degree_rad.sci', -1)\n",
"\n",
"//Given that\n",
"R = 1 //(say)\n",
"E = 1 //(say)\n",
"A = 1 //cuve surface area of cylinder(say)\n",
"\n",
"//Sample Problem 24-1\n",
"printf('**Sample Problem 24-1**\n')\n",
"flux = E*A + (-E*A) + E*A*cos(dtor(90))\n",
"printf('The net flux passing through the cylinder is equal to %fN.m^2/C', flux)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 24.2: Sample_Problem_2.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Given that\n",
"x = poly(0, 'x')\n",
"E = [3*x, 4, 0]\n",
"x1 = 1.0 //in m\n",
"x2 = 3.0 //in m\n",
"y1 = 0.0 //in m\n",
"y2 = 2.0 //in m\n",
"z1 = 0.0 //in m\n",
"z2 = 2.0 //in m\n",
"\n",
"//Sample Problem 24-2\n",
"printf('**Sample Problem 24-2**\n')\n",
"//top face\n",
"A = [0; 2; 0] //area per unit x\n",
"Phi_top = integrate('[3*x, 4, 0]*A', 'x', x1, x2)\n",
"printf('The flux through the top face is equal to %fN.m^2/C\n', Phi_top)\n",
"//left face\n",
"A = [-2*2; 0; 0]\n",
"Phi_left = horner(E, x1)*A\n",
"printf('The flux through the left face is equal to %fN.m^2/C\n', Phi_left)\n",
"//Right face\n",
"A = [2*2; 0; 0]\n",
"Phi_right = horner(E, x2)*A\n",
"printf('The flux through the right face is equal to %fN.m^2/C', Phi_right)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 24.3: Sample_Problem_3.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"exec('electrostatics.sci', -1)\n",
"\n",
"//Given that\n",
"q1 = +3.1*10^-9 //in C\n",
"q4 = q1\n",
"q2 = -5.9*10^-9 //in C\n",
"q5 = q2\n",
"q3 = -3.1*10^-9 //in C\n",
"\n",
"//Sample Problem 24-3\n",
"printf('**Sample Problem 24-3**\n')\n",
"//Using gauss law\n",
"flux = (q1+q2+q3)/Eo\n",
"printf('The flux through the surface is equal to %fN.m^2/C', flux)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 24.4: Sample_Problem_4.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"//Given that\n",
"q = -5 //in micro coulomb\n",
"\n",
"//Sample Problem 24-4\n",
"printf('**Sample Problem 24-4**\n')\n",
"qin = -q\n",
"qout = -qin\n",
"printf('Charge on the inner surface is equal to %dmicroCoulomb\n', qin)\n",
"printf('Charge on the outer surface is equal to %dmicroCoulom', qout)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 24.5: Sample_Problem_5.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"exec('electrostatics.sci', -1)\n",
"\n",
"//Given that\n",
"lambda = -1*10^-3 //in C/m\n",
"Eb = 3*10^6 //in N/C\n",
"\n",
"//Sample Problem 24-5\n",
"printf('**Sample Problem 24-5**\n')\n",
"r = lambda/(2*%pi*Eo*Eb)\n",
"printf('The radius of the column is equal to %fm', abs(r))"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 24.6: Sample_Problem_6.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"exec('electrostatics.sci', -1)\n",
"\n",
"//Given that\n",
"sigmaP = 6.8*10^-6 //in C.m^2\n",
"sigmaN = 4.3*10^-6 //in C.m^2\n",
"\n",
"Ep = sigmaP/(2*Eo) //field due to positive plate\n",
"En = sigmaN/(2*Eo) //field due to negative plate\n",
"//Sample Problem 24-6a\n",
"printf('**Sample Problem 24-6a**\n')\n",
"El = En - Ep\n",
"printf('Electric field on the left of the sheets is equal to %eN/C\n', El)\n",
"\n",
"//Sample Problem 24-6b\n",
"printf('\n**Sample Problem 24-6b**\n')\n",
"Eb = En + Ep\n",
"printf('Field in between is equal to %eN/C\n', Eb)\n",
"\n",
"//Sample Problem 24-6c\n",
"printf('\n**Sample Problem 24-6c**\n')\n",
"Er = -En + Ep\n",
"printf('Field in between is equal to %eN/C', Er)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sce",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "scilab",
"version": "0.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|