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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 7: Electricity"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.1: Electric_potential_strength.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"e=1.6*10^-19 //charge of electron\n",
"r=0.075*10^-3 // radius of electron\n",
"ep=8.85*10^-12 //permittivity of free space\n",
"//calculation\n",
"v=-e/(4*%pi*ep*r)//electric potential\n",
"e=-e/(4*%pi*ep*r*r)//electric field strength\n",
"//output\n",
"printf('resultant potential is %3.3e V',v)\n",
"printf('\n resultant electric field strength %3.3f V/m',e)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.2: ratio_of_force.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"q=2.4*10^-19 //charge1\n",
"Q=3.8*10^-19//charge2\n",
"ep=8.85*10^-12//permittivity of free space\n",
"G=6.7*10^-11\n",
"m=8.9*10^-31//mass 1\n",
"M=1.5*10^-30//mass 2\n",
"//calculation\n",
"x=q*Q/(4*%pi*ep*m*M*G)//coulumbs law\n",
"//output\n",
"printf('the ratio of electrostatic force between charges %3.3e',x)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.3: emf_and_internal_resistance.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"i=0.5 //current in circuit\n",
"R=6 //resistance of circuit\n",
"i1=0.3//dropped current\n",
"//calculation\n",
"r=1.2/0.2\n",
"e=i*(r+R)//ohms law\n",
"//output\n",
"printf('the battery emf is %3.3f V',e)\n",
"printf('\n the internal resistence is %3.3f ohm',r)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.4: power_output.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"d=8.2*10^-7 //resistivity of coil\n",
"l=15 //length of wire\n",
"r=0.3*10^-3 //radius of wires\n",
"v=160 //power output\n",
"//calculations\n",
"R=d*l/(%pi*r*r)\n",
"p=v*v/R //for one coil\n",
"p1=v*v/(R+R) //for two coils in series\n",
"rp=(R*R)/(R+R)//total resistence \n",
"pp=(v*v)/rp//total power\n",
"//output\n",
"printf('the power when one coil is %3.3f W',p)\n",
"printf('\nthe power when two coils in series is %3.3f W',p1)\n",
"printf('\n the power when coils in parallel is %3.3f W',pp)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.5: percent_of_pd.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"r1=40//resistance 1\n",
"r2=20//resistamce 2\n",
"r3=10//resistance 3\n",
"v=1.6//voltage\n",
"//calculation\n",
"R=r1+r2+r3//total resistance in series\n",
"x=((v*r1)*70)/((2*50)*(1.6*40))//fraction of pd\n",
"x=x*100//percentage pd\n",
"//output\n",
"printf('the percentage of pd is %3.0f percent',x)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.6: final_resistance_calculation.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"a=4.3*10^-3//temperature co-efficient of resistance\n",
"//calculation\n",
"r2=((60*a+1)/(20*a+1))*10//resistance \n",
"//output\n",
"printf('the final resistence is %3.3f ohm',r2)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.7: internal_resistance_calculation.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"l1=82.3//balance length with switch open\n",
"l2=75.8//balance length with switch closed\n",
"R=9//resistance\n",
"//calculation\n",
"r=(R*l1/l2)-R//internal resistance\n",
"//output\n",
"printf('the internal resistence is %3.3f ohm',r)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7.8: calculation_of_resistance.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"//input\n",
"p=2*10^-6//pd across wire\n",
"v=1.5//voltage \n",
"l=1.5*10^3//length of potentiometer\n",
"R=7//resistance\n",
"//calculation\n",
"vw=p*l//pd across the wire\n",
"x=(7*v/vw)-R//resistace of x\n",
"//output\n",
"printf('the resistance of x is %3.0f ohm',x)"
]
}
],
"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
}
|