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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 1: Electric field"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.10: calculating_voltage.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"a=20; //amplitude in cm\n",
"n=6; //frequency per second\n",
"w=2*(%pi)*n; //omega in radians/sec\n",
"disp(w,'Omega in radians/sec = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.11: calculating_power_dissipated.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"a=6; //amplitude in cm\n",
"n=9; //frequency in Hz.\n",
"vmax=2*(%pi)*n*6; //calculating velocity in cm/sec\n",
"acc=-((18*(%pi))^2)*6; //calculating acc. in m/sec square\n",
"disp(vmax,'Maximum velocity in cm/sec = '); //displaying result\n",
"disp('Velocity at extreme position = 0'); //displaying result\n",
"disp('Accelaration at mean position = 0'); //displaying result\n",
"disp(acc,'Accelaration at extreme position in m/sec square = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.12: calculating_power_dissipated.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"g=9.8; //gravitational constant\n",
"m=50; //mass in kg\n",
"l=0.2; //length in m\n",
"T=0.6; //time period\n",
"k=(m*g)/l; //calculating constant\n",
"m=2450*((T/(2*(%pi)))^2); //calcualting mass using given time period\n",
"disp(m,'Mass of body in kg = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.13: calculating_the_power_level.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"v=4; //volts\n",
"t=8; //time in sec\n",
"ch=4; //charge in Coloumb\n",
"c=ch/t; //current\n",
"p=c*v; //power\n",
"e=p*t; //energy\n",
"disp(c,'Current in Ampere = '); //displaying current\n",
"disp(p,'Power in Watt = '); //displaying power\n",
"disp(e,'Energy in Joule = '); //displaying energy"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.14: finding_configuration.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"disp('In a)parallel b)series c)Two pairs of parallel and then in series'); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.15: no_of_resistances.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"p=1/8; //power disipation per resistor\n",
"v=sqrt(100/8); //voltage across each resistor\n",
"disp(14.14,'a)Voltage in Series in Ohm = '); //displaying result\n",
"disp(v,'b)Voltage in Parallel in Ohm ='); //displaying result\n",
"disp(7.07,'c)Voltage in Series-Parallel in Ohm = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.16: calculating_wattage_rating.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"v=10; //voltage in volt\n",
"t=2; //time in sec\n",
"r=40; //resistance in ohm\n",
"p=(v^2)/r; //power\n",
"e=5/5; //energy in Watt\n",
"disp(p,'Power in Watt = '); //displaying power\n",
"disp('2 W resistor is adequate.'); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.17: calculating_power_dissipation.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"v=24; //voltage in volt\n",
"t=2; //time in sec\n",
"r=48; //resistance in ohm\n",
"p=(v^2)/r; //calculating power\n",
"disp(p,'Power in Watt = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.18: calculating_joules.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"i=60; //current in ampere\n",
"v=12; //voltage in volt\n",
"t=3600; //time in sec\n",
"p=i*v*t; //calculating power\n",
"disp(p,'Number of joules = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.19: calculating_wattage.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"v=12; //voltage in volt\n",
"ah=720; //ampere-hours\n",
"am=ah/24; //calculating amperage\n",
"r=v/am; //calculating resistance\n",
"disp(r,'Load in Ohm = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.1: calculating_Electric_field_intensity.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"n=512; //frequency in Hz\n",
"l=67; //wavelength in cm\n",
"v=n*l; //calculating velocity\n",
"disp(v,'Velocity in cm/sec = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.20: calculating_current.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"p=200; //power in Watt\n",
"v=12; //voltage in volt\n",
"i=p/v; //calculating current in Ampere\n",
"I=p/6; //calculating\n",
"disp(i,'Current in Ampere = '); //displaying\n",
"disp(I,'Current in Ampere if voltage were 6V = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.21: calculating_energy.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"E=10^6; //in volt/m\n",
"e=8.85*10^-12; //constant in F/m\n",
"v=10^-5; //volume in m cube\n",
"en=(1/2)*e*E*E*v; //calculating energy\n",
"disp(en,'Energy in Joule = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.22: calculating_voltage.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"en=4.42*10^-5; //energy in Joule\n",
"v=10^6;\n",
"q=(2*en)/v; //calculating q\n",
"disp(q,'Charge in Coloumb = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.23: calculating_force.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"e=4.42*10^-5; //energy in Joule\n",
"v=1.1*10^-5; //volume in m cube\n",
"dv=(10/100)*e; //calculating change in energy\n",
"dd=10^-4; //change in dimension in metre\n",
"f=dv/dd; //calculating force\n",
"disp(f,'Force in kg = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.24: calculating_average_power.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"disp('a)1A for 1 sec = 10J/sec '); //displaying\n",
"disp('b)10A for 0.1 sec = 100 J/sec'); //displaying\n",
"disp('c)100A for 0.01 sec = 1000 J/sec'); //displaying"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.25: calculating_peak_power.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"disp('Peak power is when 100 A flows for 0.01 sec = 1000J/sec'); //displaying"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.2: calculating_current.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"v=340; //velocity in m/sec\n",
"l=0.68; //wavelength in m\n",
"n=v/l; //calculating frequency\n",
"disp(n,'Frequency in Hz = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.3: calculating_resistance_and_conductance.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"v=3*10^8; //velocity in m/sec\n",
"n=500*10^3; //frequency in Hz\n",
"l=v/n; //calculating wavelength\n",
"disp(l,'Wavelength in m = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.4: calculating_current.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"v=330; //velocity in m/sec\n",
"n=560; //frequency in Hz\n",
"l=v/n; //calculating wavelength\n",
"disp(l*30,'Distance travelled in 30 vibrations in m = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.5: calculating_work.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"s=90; //distance in m\n",
"u=0; //initial velocity in m/sec\n",
"t=sqrt(90/4.9); //calculating time using kinematical equation\n",
"t1=4.56-t; //calculating time taken by sound to travel\n",
"v=s/t1; //calculating velocity\n",
"disp(v,'Velocity in m/sec = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.6: calculating_resistance.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"l1=1.5; //wavelength in m\n",
"l2=2; //wavelength in m\n",
"v1=120; //velocity in m/sec\n",
"n=v1/l1; //calculating frequency\n",
"v2=n*l2; //calculating velocity\n",
"disp(v2,'Velocity in m/sec = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.7: calculating_voltage.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"l=5641*10^-10; //wavelength in m\n",
"c=3*10^8; //velocity in m/sec\n",
"n=c/l; //calculating frequency\n",
"u=1.58; //refractive index of glass\n",
"cg=c/u; //calculating velocity of light in glass\n",
"l1=cg/n; //calculating wavelegth in glass\n",
"disp(l1*10^10,'Wavelength in glass in Angstrom ='); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.8: calculating_voltage.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"n=12*10^6; //frequency in Hz\n",
"v=3*10^8; //velocity in m/sec\n",
"l=v/n; //calculating wavelength\n",
"disp(l,'Wavelength in m = '); //displaying result"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1.9: calculating_internal_resistance.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc;\n",
"n=400; //frequency in Hz\n",
"v=300; //velocity in m/sec\n",
"l=v/n; //calculating wavelength\n",
"disp(l,'Wavelength in m = '); //displaying result"
]
}
],
"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
}
|