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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 22: Electric Charge"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 22.1: Sample_Problem_1.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"exec('electrostatics.sci', -1)\n",
"exec('degree_rad.sci', -1)\n",
"\n",
"//Given that\n",
"q1 = 1.60*10^-19 //in C\n",
"q2 = 3.20*10^-19 //in C\n",
"R = 0.0200 //in meter\n",
"\n",
"//Sample Problem 22-1a\n",
"printf('**Sample Problem 22-1a**\n')\n",
"F12 = coulomb(q1, q2, R)\n",
"printf('The coulombic force between the charged particle is %eN\n', F12)\n",
"\n",
"//Sample Problem 22-1b\n",
"printf('\n**Sample Problem 22-1b**\n')\n",
"q3 = -3.20*10^-19 //in C\n",
"R13 = 3/4*R\n",
"F1 = coulomb(q1, q3, R13) + F12\n",
"printf('The net force on particle 1 is equal to %eN\n', abs(F1))\n",
"\n",
"//Sample Problem 22-1c\n",
"printf('\n**Sample Problem 22-1c**\n')\n",
"q4 = -3.20*10^-19 //in C\n",
"R14 = 3/4*R\n",
"theta = dtor(60)\n",
"F14 = coulomb(q1, q4, R14)\n",
"F1net = [F12+F14*cos(theta), F14*sin(theta)]\n",
"printf('The net force on particle 1 is equal to %eN', norm(F1net))"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 22.2: Sample_Problem_2.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"exec('electrostatics.sci', -1)\n",
"\n",
"//Given that\n",
"q = 1 //(say)\n",
"q1 = 8*q\n",
"q2 = -2*q\n",
"L = 1 //(say)\n",
"x = L\n",
"\n",
"//Sample Problem 22-2\n",
"printf('**Sample Problem 22-2**\n')\n",
"//let the distance of proton from q1 is y\n",
"//We know that y>L\n",
"y = poly(0, 'y')\n",
"F1 = coulomb(q1, e, y)\n",
"F2 = coulomb(q2, e, y-L)\n",
"p = F1 + F2\n",
"r = roots(denom(inv(p)))\n",
"printf('the proton should be placed at a distance %1.1fL from q1', r(2))"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 22.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",
"Q = 1 //(say)\n",
"q1 = Q\n",
"q2 = 0\n",
"a = 1 //(say)\n",
"\n",
"//Sample Problem 22-3a\n",
"printf('**Sample Problem 22-3a**\n')\n",
"q1 = (q1 + q2)/2\n",
"q2 = q1\n",
"F = coulomb(q1, q2, a)\n",
"printf('The net force between the two sphere is %eQ^2/a^2\n', F)\n",
"\n",
"\n",
"//Sample Problem 22-3b\n",
"printf('\n**Sample Problem 22-3b**\n')\n",
"q1 = 0\n",
"F = coulomb(q1, q2, a)\n",
"printf('The net force between the two sphere is %fN', F)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 22.4: Sample_Problem_4.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"exec('electrostatics.sci', -1)\n",
"exec('gravitation.sci', -1)\n",
"\n",
"//Given that\n",
"r = 4*10^-15 //in meter\n",
"n = 26\n",
"mp = 1.67*10^-27 //in kg\n",
"\n",
"//Sample Problem 22-4a\n",
"printf('**Sample Problem 22-4a**\n')\n",
"Fpp = coulomb(e, e, r)\n",
"printf('The force of repulsion is %eN\n', Fpp)\n",
"\n",
"//Sample Problem 22-4b\n",
"printf('\n**Sample Problem 22-4b**\n')\n",
"Fg = GForce(mp, mp, r)\n",
"printf('The magnitude of gravitational force between two proton is %eN', Fg)"
]
}
],
"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
}
|