summaryrefslogtreecommitdiff
path: root/Elements_of_electrical_science_by_Mukopadhyay,_Pant/Chapter5.ipynb
blob: 194573ff61e8897cf2811448b6baaa6a8020cea0 (plain)
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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 5 : Electrical Measurements"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1 : pg 81"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "required resistance is,(ohm)= 15000.0\n"
     ]
    }
   ],
   "source": [
    "# Example 5.1 : resistance\n",
    "#calculate the resistance \n",
    "# given :\n",
    "n=50.;#number of turns\n",
    "B=1.;#magnetic field in tesla\n",
    "I=1.;#current in amperes\n",
    "L=4.;#length in cm\n",
    "d=3.;#dia in cm\n",
    "#calculations\n",
    "Td=n*B*I*L*d*10**-4;#torque in N-m\n",
    "cd1=2.4*10**-4;#controlling torque\n",
    "id=cd1/Td;#current in amperes\n",
    "fsv=100;#full scale voltage\n",
    "trv=fsv/id;#ohms\n",
    "adr=10000;#ohms\n",
    "r=trv-adr;#ohms\n",
    "#results\n",
    "print \"required resistance is,(ohm)=\",r\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2 : pg 82"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total resistance of the voltmeter is,(ohm)= 49990.0\n"
     ]
    }
   ],
   "source": [
    "# Example 5.2 : resistance\n",
    "#calculate the total resistance \n",
    "# given :\n",
    "fsf=20.;#full scale deflection current in mA\n",
    "v=200.;#voltage in mV\n",
    "#calculations\n",
    "ri=v/fsf;#resistance in ohms\n",
    "x=199.98;#current in amperes\n",
    "rsh=(v*10**-3)/x;#ohms\n",
    "fs2=1000;#volts\n",
    "trv=fs2/(fsf*10**-3);#ohms\n",
    "rse=trv-ri;#reqquired resistance in ohms\n",
    "#results\n",
    "print \"total resistance of the voltmeter is,(ohm)=\",rse\n",
    "#in the text book approximately value of resistance is taken as 50000 ohm\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3 : pg 82"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part (a)\n",
      "power factor is ,= 0.693\n",
      "part (b)\n",
      "power factor is ,= 0.327\n"
     ]
    }
   ],
   "source": [
    "# Example 5.3 : power factor\n",
    "#calculate the power factor\n",
    "from math import sqrt, atan, cos\n",
    "# given :\n",
    "w1=2000.;#power in watts\n",
    "w2=500.;#power in watts\n",
    "#calculations and results\n",
    "an=atan(sqrt(3)*(((w1-w2)/(w1+w2))));#angle in radians\n",
    "print \"part (a)\"\n",
    "pf=cos(an);#power factor\n",
    "print \"power factor is ,=\",round(pf,3)\n",
    "print \"part (b)\"\n",
    "w1=2000.;#power in watts\n",
    "w2=-500.;#power in watts\n",
    "an=atan(sqrt(3)*(((w1-w2)/(w1+w2))));#angle in degree\n",
    "pf=cos(an);#power factor\n",
    "print \"power factor is ,=\",round(pf,3)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4 : pg 83"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part (i)\n",
      "indication of moving iron instrument is,(A)= 5.64\n",
      "part (ii)\n",
      "indication of moving coil instrument is,(A)= 3.18\n"
     ]
    }
   ],
   "source": [
    "# Example 5.4;reading\n",
    "#calculate the reading of the instrument\n",
    "from math import sqrt, pi, sin\n",
    "from scipy import integrate\n",
    "import numpy\n",
    "print \"part (i)\"\n",
    "# given :\n",
    "vm=100.;#volts\n",
    "rc=10.;#ohms\n",
    "#calculations and results\n",
    "im=vm/rc;#amperes\n",
    "t= numpy.linspace(0,2*pi, num =3);#time rane\n",
    "#x=intsplin(t,(sin(t))**2);#variable\n",
    "x=2.0;\n",
    "Irms=sqrt((1/(2*pi))*im**2*x);#current in amperes\n",
    "print \"indication of moving iron instrument is,(A)=\",round(Irms,2)\n",
    "print \"part (ii)\"\n",
    "t1=0;#time interval\n",
    "t2=pi;#time inerval\n",
    "def function(t):\n",
    "    return sin(t)\n",
    "    \n",
    "x=integrate.quad(function,t1,t2)[0];#variable\n",
    "Iav=(1/pi)*x*(im/2);#current in amperes\n",
    "print \"indication of moving coil instrument is,(A)=\",round(Iav,2)\n",
    "#answer of part a is calculated wrong in the textbook\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5 : pg 86"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "current read by meter 1 is,(A)= 55.56\n",
      "current read by meter 2 is,(A)= 44.44\n"
     ]
    }
   ],
   "source": [
    "# Example 5.5;reading\n",
    "#calculate the current reading\n",
    "# given :\n",
    "fsd=100.;#full scale division in amperes\n",
    "fsd1=100.;#full scale division in mA\n",
    "#calculations\n",
    "csh=fsd-(fsd*10**-3);#difference in currents in amperes\n",
    "rx=0.8;#resistance in ohms\n",
    "r1=((fsd1*10**-3*rx)/csh);#resistance in ohms\n",
    "rx1=1;#resistance in ohms\n",
    "r2=((fsd1*10**-3*rx1)/csh);#resistance in ohms\n",
    "em1=((rx*r1)/(rx+r1));#resistance in ohms\n",
    "em2=((rx1*r2)/(rx1+r2));#resistance in ohms\n",
    "crm1=((em2*10**4*fsd)/((em2*10**4)+(em1*10**4)));#current in amperes\n",
    "crm2=((em1*10**4*fsd)/((em1*10**4)+(em2*10**4)));#current in amperes\n",
    "#results\n",
    "print \"current read by meter 1 is,(A)=\",round(crm1,2)\n",
    "print \"current read by meter 2 is,(A)=\",round(crm2,2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6 : pg 90"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part (a)\n",
      "multiplier resistance Rs is,(Ohm)= 1825.0\n",
      "part (b)\n",
      "sensivity is,(Ohm/V)= 225.0\n"
     ]
    }
   ],
   "source": [
    "# Example 5.6;\n",
    "#calculate the multiplier resistance and sensivity\n",
    "# given :\n",
    "rm=50.;#resistance in ohms\n",
    "rsh=rm;#shunt resistance in ohms\n",
    "it=2.;#current in mA\n",
    "erms=10.;#rms voltage in volts\n",
    "#calculations\n",
    "ede=0.45*erms;#voltage in volts\n",
    "rd1=400.;#resistance in ohms\n",
    "x=(rm*rsh)/(rm+rsh);#resistance in ohms\n",
    "r1=ede/(it*10**-3);#resistance in ohms\n",
    "rs=r1-x-rd1;#resistance in ohms\n",
    "S=r1/erms;#sensivity in ohms/V\n",
    "#results\n",
    "print \"part (a)\"\n",
    "print \"multiplier resistance Rs is,(Ohm)=\",rs\n",
    "print \"part (b)\"\n",
    "print \"sensivity is,(Ohm/V)=\",S\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7 : pg 91"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part (a)\n",
      "apparent resistance of unknown resistor is,(kilo-Ohm)= 40.0\n",
      "part (b)\n",
      "actual resistance of unknown resistor is,(kilo-Ohm)= 47.619\n",
      "part (c)\n",
      "percentage error is,(%)= 16.0\n"
     ]
    }
   ],
   "source": [
    "# Example 5.7;\n",
    "#calculate the apparent resistance of the unknown resistor,actual resistance of the unknown resistor and percentage error\n",
    "# given :\n",
    "v=200.;#voltage in volts\n",
    "i=5.;#current in mA\n",
    "#calculations and results\n",
    "tr=v/i;#resistance in kilo ohms\n",
    "print \"part (a)\"\n",
    "print \"apparent resistance of unknown resistor is,(kilo-Ohm)=\",tr\n",
    "S=1000.;#sensivity in ohms/V\n",
    "V1=250.;#voltage in volts\n",
    "rv=V1*S*10**-3;#resistance in kilo ohms\n",
    "rx=(V1*tr)/(V1-tr);#resistance in kilo ohms\n",
    "print \"part (b)\"\n",
    "print \"actual resistance of unknown resistor is,(kilo-Ohm)=\",round(rx,3)\n",
    "per=(rx-tr)/rx;#percentage error\n",
    "print \"part (c)\"\n",
    "print \"percentage error is,(%)=\",per*100\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8 : pg 92"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resolution is, (V)= 0.2\n"
     ]
    }
   ],
   "source": [
    "# Example 5.8;resolution\n",
    "#calculate the resolution\n",
    "# given :\n",
    "fsr=200.;#full scale reading in volts\n",
    "d=100.;#number of divisions\n",
    "sc=1/10.;#scale\n",
    "#calculations\n",
    "sd1=fsr/d;#one sccale divisions\n",
    "R=sc*sd1;#resolution\n",
    "#results\n",
    "print \"resolution is, (V)=\",R\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 9 : pg 93"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resolution is ,(mV)= 1.0\n"
     ]
    }
   ],
   "source": [
    "# Example 5.9;resolution\n",
    "#calculate the resolution\n",
    "# given :\n",
    "fsr=9.999;#full scale reading in volts\n",
    "d=9999.;#number of divisions\n",
    "#calculations\n",
    "R=(1/d)*fsr*10**3;#resolution\n",
    "#results\n",
    "print \"resolution is ,(mV)=\",R\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10 : pg 95"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part (i)\n",
      "true value of resistance is,(Ohm)= 91.65\n",
      "part (ii)\n",
      "percentage error is,(%)= 1.8\n",
      "part (iii)\n",
      "reading of voltmeter is,(V)= 18.35\n"
     ]
    }
   ],
   "source": [
    "# Example 5.10;\n",
    "#calculate the true resistance of the unknown resistor  , percentage error and reading voltmeter\n",
    "# given :\n",
    "print \"part (i)\"\n",
    "ra=0.1;#ohms\n",
    "vr=18.;#voltage in volts\n",
    "am=0.2;#current in amperes\n",
    "#calculations and results\n",
    "apr=vr/am;#in ohms\n",
    "rv=5000.;#ohms\n",
    "im=vr/rv;#amperes\n",
    "rxi=am-(im);#in amperes\n",
    "rx=vr/rxi;#ohms\n",
    "print \"true value of resistance is,(Ohm)=\",round(rx,3)\n",
    "per=((rx-apr)/rx)*100;#percentage error\n",
    "print \"part (ii)\"\n",
    "print \"percentage error is,(%)=\",per\n",
    "rvv=am*(ra+rx);#reading of voltmeter\n",
    "print \"part (iii)\"\n",
    "print \"reading of voltmeter is,(V)=\",round(rvv,3)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 11 : pg 96"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "part (i)\n",
      "resistance of shunt (range 0-100mA) Rsh1 is,(Ohm)= 5.556\n",
      "part (ii)\n",
      "resistance of shunt (range 0-500mA) Rsh2 is,(Ohm)= 1.02\n",
      "part (iii)\n",
      "resistance of shunt (range 0-1A) Rsh2 is,(Ohm)= 0.505\n",
      "part (iv)\n",
      "resistance of shunt (range 0-5A) Rsh2 is,(Ohm)= 0.1\n"
     ]
    }
   ],
   "source": [
    "# Example 5.11;resistance\n",
    "#calculate the resistance in all cases\n",
    "# given :\n",
    "im=10.;#mA\n",
    "i=100.;#mA\n",
    "#calculations and results\n",
    "m=i/im;#multiplying factor\n",
    "rm=50;#ohms\n",
    "rsh=rm/(m-1);#in ohms\n",
    "print \"part (i)\"\n",
    "print \"resistance of shunt (range 0-100mA) Rsh1 is,(Ohm)=\",round(rsh,3)\n",
    "i1=500.;#mA\n",
    "m1=i1/im;#multiplying factor\n",
    "rm1=50.;#ohms\n",
    "rsh1=rm1/(m1-1);#in ohms\n",
    "print \"part (ii)\"\n",
    "print \"resistance of shunt (range 0-500mA) Rsh2 is,(Ohm)=\",round(rsh1,3)\n",
    "im2=1;#A\n",
    "i2=100.;#A\n",
    "m2=i2/im2;#multiplying factor\n",
    "rm2=50.;#ohms\n",
    "rsh2=rm2/(m2-1);#in ohms\n",
    "print \"part (iii)\"\n",
    "print \"resistance of shunt (range 0-1A) Rsh2 is,(Ohm)=\",round(rsh2,3)\n",
    "im3=1;#A\n",
    "i3=500.;#A\n",
    "m3=i3/im3;#multiplying factor\n",
    "rm3=50.;#ohms\n",
    "rsh3=rm3/(m3-1);#in ohms\n",
    "print \"part (iv)\"\n",
    "print \"resistance of shunt (range 0-5A) Rsh2 is,(Ohm)=\",round(rsh3,3)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 12 : pg 98"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "load power is,(kW)= 1.5\n"
     ]
    }
   ],
   "source": [
    "# Example 5.12;load power\n",
    "#calculate the load power\n",
    "# given :\n",
    "k=600.;#in rev./kwh.\n",
    "nr=5.;#number of revolutions\n",
    "t=20.;#time in seconds\n",
    "#calculations\n",
    "lp=(1/k)*nr*((60*60)/t);#power in kW\n",
    "#results\n",
    "print \"load power is,(kW)=\",lp\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}