summaryrefslogtreecommitdiff
path: root/BASIC_ELECTRICAL_ENGINEERING_/Chapter5.ipynb
blob: 3a8210b44ed2a3ae71ca3bb347411cd20da22309 (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
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
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 5: ELECTROMAGNETISM"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.1,Page number: 143"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the current necessary to produce a magnetic field inside the solenoid.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "B=20e-03                #Magnitude of magnetic field inside the solenoid(in Tesla)\n",
      "n=20e02                 #Number of turns per cm in the long solenoid\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "abs_per=(4*pi)*(1e-07)\n",
      "I=B/(abs_per*n)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The required current is %.2f A.\" %(I)  "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required current is 7.96 A.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.2,Page number: 143"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the magnetic field near the centre and the ends of a solenoid.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "abs_per=4*pi*(1e-07)      #Absolute permeability of free space(in Henry per metre)\n",
      "I=6.0                     #Current carried by the solenoid(in Amperes)\n",
      "l=50e-02                  #Length of solenoid(in metres)\n",
      "r=1.4e-02                 #Radius of the lowest layer(in metres)\n",
      "turns_per_layer=350       #Number of turns per layer\n",
      "number_of_layers=4        #Number of layers\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "n=(turns_per_layer*number_of_layers)/l\n",
      "B_centre=abs_per*n*I\n",
      "B_end=(abs_per*n*I)/2\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The magnetic field inside the solenois is quite uniform,its strength near the centre on its axis and\" \n",
      "print \"   off its axis is the same and its magnitude is %e T.\" %(B_centre)\n",
      "print \"(b)The magnetic field strength at the end of the solenoid is %e T.\" %(B_end)\n",
      "print \"(c)The magnetic field far outside the solenoid near its axis is negligible,compared to the internal field.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The magnetic field inside the solenois is quite uniform,its strength near the centre on its axis and\n",
        "   off its axis is the same and its magnitude is 2.111150e-02 T.\n",
        "(b)The magnetic field strength at the end of the solenoid is 1.055575e-02 T.\n",
        "(c)The magnetic field far outside the solenoid near its axis is negligible,compared to the internal field.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.3,Page number: 148"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the force between two long straight parallel wires.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "r=2                      #Distance between the parallel current carrying wires(in metres) \n",
      "abs_per=(4*pi)*(1e-07)   #Absolute permeability of free space(in Henry per metre)\n",
      "I1=80                    #Current in the first wire(in Amperes)\n",
      "I2=30                    #Current in the second wire(in Amperes)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "F=(abs_per*I1*I2)/(2*pi*r)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The magnitude of the force between the two wires is %e N/m.\" %(F)\n",
      "print \"Since the two currents are in the same direction,the force will be attractive.\"  "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The magnitude of the force between the two wires is 2.400000e-04 N/m.\n",
        "Since the two currents are in the same direction,the force will be attractive.\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.4,Page number: 148 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the force due to current flowing in two straight,parallel wires.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "I1=4.0                 #Current in the first wire(in Amperes)\n",
      "I2=6.0                 #Current in the second wire(in Amperes)\n",
      "r=3e-02                #Distance between the parallel current carrying wires(in metres) \n",
      "abs_per=(4*pi)*(1e-07) #Absolute permeability of free space(in Henry per metre)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "F=(abs_per*I1*I2)/(2*pi*r)\n",
      "l=15e-02\n",
      "F_net=F*l\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The net force on 15cm(=0.15 m) section of wire B near its centre is %e N.\" %(F_net)\n",
      "print \"Since the currents are in opposite directions,the force F_net is repulsive.\"\n",
      "print \"It means that its direction is normal to wire A away from it.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The net force on 15cm(=0.15 m) section of wire B near its centre is 2.400000e-05 N.\n",
        "Since the currents are in opposite directions,the force F_net is repulsive.\n",
        "It means that its direction is normal to wire A away from it.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.5,Page number: 154"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the emf produced in a conductor placed in an uniform magnetic field.\"\"\"\n",
      "\n",
      "from math import sin,radians\n",
      "\n",
      "#Variable Declaration:\n",
      "B=0.5                  #Magnitude of magnetic field(in Tesla)\n",
      "l=20e-02               #Active length of the conductor(in metres) \n",
      "v=5                    #Velocity of the conductor(in metres per second)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "angle_a=0\n",
      "e_a=B*l*v*sin(radians(angle_a))\n",
      "angle_b=90\n",
      "e_b=B*l*v*sin(radians(angle_b))\n",
      "angle_c=30\n",
      "e_c=B*l*v*sin(radians(angle_c))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The emf induced in the straight conductor when its motion is parallel to the magnetic field is %.2f V.\" %(e_a)\n",
      "print \"(b)The emf induced in the straight conductor when its motion is perpendicular to the magnetic field is %.2f V.\" %(e_b)\n",
      "print \"(c)The emf induced in the straight conductor when its motion is at an angle 30 degrees to the magnetic field is %.2f V.\" %(e_c)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The emf induced in the straight conductor when its motion is parallel to the magnetic field is 0.00 V.\n",
        "(b)The emf induced in the straight conductor when its motion is perpendicular to the magnetic field is 0.50 V.\n",
        "(c)The emf induced in the straight conductor when its motion is at an angle 30 degrees to the magnetic field is 0.25 V.\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.6,Page number: 154"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the emf generated between the wing-tips of an aeroplane.\"\"\"\n",
      "\n",
      "from math import sin,radians\n",
      "\n",
      "#Variable Declaration:\n",
      "l=52                      #Wing span of the aeroplane(in metres)\n",
      "B=38e-06                  #Magnitude of magnetic field(in Tesla)\n",
      "v=1100.0*(1000.0/3600.0)  #Velocity of the aeroplane(in metres per second)\n",
      "angle=90                  #Angle between the magnetic field vector and the velocity vector(in degrees)   \n",
      "\n",
      "\n",
      "#Calculations:\n",
      "e=B*l*v*sin(radians(angle))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The emf generated between the wing tips is %.5f V.\" %(e)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The emf generated between the wing tips is 0.60378 V.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.7,Page number: 154"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the emf developed between the centre and the metallic ring.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "\"\"\" A=(1/2)*R*R*theta; where theta is the angle between the rod and the rod OP(in figure) at time t  \"\"\"\n",
      "B=1.0       #Magnitude of magnetic field(in Tesla)\n",
      "R=1         #Radius of circular ring(in metres)\n",
      "f=50        #Frequency of rotation(in revolutions per second) \n",
      "\n",
      "\"\"\" B=d(flux)/dt= d(B*A)/dt= (1/2)*B*R*R*d(theta)/dt= (1/2)*B*R*R*ang_freq \"\"\"\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "ang_freq=2*pi*f\n",
      "e=(1.0/2)*B*R*R*ang_freq\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The emf developed between the centre and the metallic ring is %.2f V.\" %(e)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The emf developed between the centre and the metallic ring is 157.08 V.\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.8,Page number: 155"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the force needed to pull a rectangular loop placed in an uniform magnetic field.\"\"\"\n",
      "\n",
      "#Variable Declaration:\n",
      "B=0.5                 #Magnitude of magnetic field(in Tesla)\n",
      "w=3e-02               #Width of the rectangular loop(in metres)\n",
      "l=10e-02              #Length of the rectangular loop(in metres)\n",
      "v=1e-02               #Velocity of the rectangular loop(in metre per second)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "e1=B*w*v\n",
      "t1=l/v\n",
      "e2=B*l*v\n",
      "t2=w/v\n",
      "R=1e-03\n",
      "F_a=(pow((B*w),2)*v)/R\n",
      "F_b=(pow((B*l),2)*v)/R\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The induced emf is %e V and the time for which the induced voltage lasts is %.2f secs.\" %(e1,t1)\n",
      "print \"(b)The induced emf is %e V and the time for which the induced voltage lasts is %.2f secs.\" %(e2,t2)\n",
      "print \"(c)Because of the gap,no current can flow.Hence there is no heat produced(or no I*I*R losses).\"\n",
      "print \"   If we neglect friction,no force is required to pull the coil.\"\n",
      "print \"(d)The force required to pull the loop if it has no cut and has a resistance of 1 mill ohm is :\"\n",
      "print \"   For fig (a): F=%e N.\" %(F_a)\n",
      "print \"   For fig (b): F=%e N.\" %(F_b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The induced emf is 1.500000e-04 V and the time for which the induced voltage lasts is 10.00 secs.\n",
        "(b)The induced emf is 5.000000e-04 V and the time for which the induced voltage lasts is 3.00 secs.\n",
        "(c)Because of the gap,no current can flow.Hence there is no heat produced(or no I*I*R losses).\n",
        "   If we neglect friction,no force is required to pull the coil.\n",
        "(d)The force required to pull the loop if it has no cut and has a resistance of 1 mill ohm is :\n",
        "   For fig (a): F=2.250000e-03 N.\n",
        "   For fig (b): F=2.500000e-02 N.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.9,Page number: 156"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the magnetic field due  to a line caryying current.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "I=90.0                #Current flowing through the line(in Amperes)\n",
      "x=1.5                 #Distance of point of observation from the line(in metres)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "abs_per=(4*pi)/(1e07)\n",
      "B=(abs_per*I)/(2*pi*x)\n",
      "  \n",
      "\n",
      "#Result:\n",
      "print \"The magnetic field due to the current at a point 1.5 m below the line is %e T.\" %(B)\n",
      "print \"By applying the right-hand thumb rule,we find that the direction of the magnetic field is from north to south.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The magnetic field due to the current at a point 1.5 m below the line is 1.200000e-05 T.\n",
        "By applying the right-hand thumb rule,we find that the direction of the magnetic field is from north to south.\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.10,Page number: 156"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the force per unit length on a current carrying wire.\"\"\"\n",
      "\n",
      "from math import sin,radians\n",
      "\n",
      "#Variable Declaration:\n",
      "I=8.0                 #Current flowing through the wire(in Amperes)\n",
      "B=0.15                #Magnitude of uniform magnetic field(in Tesla)\n",
      "angle=30              #Angle between the direction of current and the uniform magnetic field(in degrees)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Fu=I*B*sin(radians(angle))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The force per unit length of the wire is %.2f N/m.\" %(Fu)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The force per unit length of the wire is 0.60 N/m.\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.11,Page number: 156"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the torque experienced by a square coil.\"\"\"\n",
      "\n",
      "from math import sin,radians\n",
      "\n",
      "#Variable Declaration:\n",
      "I=12.0                #Current flowing through the square coil(in Amperes)\n",
      "N=20.0                #Number of turns in the square coil\n",
      "l=10e-02              #Length of each side of the square coil(in metres)\n",
      "B=0.8                 #Magnitude of uniform horizontal magnetic field(in Tesla)\n",
      "angle=30.0            #Angle made by normal to the plane of the coil with the direction of horizontal magnetic field(in degrees)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "F=I*B*l*N\n",
      "x=l*sin(radians(angle))\n",
      "T=F*x\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The torque experienced by the coil is %.3f Nm.\" %(T)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The torque experienced by the coil is 0.960 Nm.\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.12,Page number: 156"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the net force on a rectangular loop.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "I1=15.0               #Current carried by the rectangular loop(in Amperes)\n",
      "I2=25.0               #Current carried by the straight conductor(in Amperes)\n",
      "l=25e-02              #Length of the rectangular loop(in metres)\n",
      "w=10e-02              #Width of the rectangular loop(in metres)\n",
      "r=2e-02               #Separation between the nearer side of the loop and the conductor(in metres)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "abs_per=(4*pi)/(1e07)\n",
      "\"\"\"Parts AD and BC do not experience any force,since these conductors are at right angles to the long straight conductor.\n",
      "   \n",
      "   The current I1 in AB and the current I2 in the straight conductor are in the same direction.\n",
      "   Hence,the force F_AB is attractive.\"\"\"\n",
      "\n",
      "F_AB=((abs_per*I1*I2)/(2*pi*r))*l\n",
      "\n",
      "\"\"\"  The current I1 in CD and the current I2 in the straight conductor are in opposite directions.\n",
      "     Hence,the force F_CD is repulsive.\"\"\"\n",
      "\n",
      "F_CD=((abs_per*I1*I2)/(2*pi*(r+w)))*l\n",
      "F_net=F_AB-F_CD\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The net force on the rectangular loop is %.5f mN.\" %(F_net*1000.0) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The net force on the rectangular loop is 0.78125 mN.\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.13,Page number: 157"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the location of a point where the resultant magnetic field is zero.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "I=10.0                #Current flowing through the wire(in Amperes)\n",
      "B=2.0e-03             #Horizontal component of Earth's magnetic field(in Tesla)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "\"\"\" To make the resultant magnetic field zero,the magnetic filed produced by the long vertical wire must be equal and opposite \n",
      "    to the horizontal component of Earth's magnetic field.This is possible at a point P,west of the wire. \"\"\"\n",
      "\n",
      "abs_per=(4*pi)/(1e07)\n",
      "x=(abs_per*I)/(2*pi*B)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The distance between the required point from the wire is %e m,to the west of the wire.\" %(x)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distance between the required point from the wire is 1.000000e-03 m,to the west of the wire.\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.14,Page number: 157"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the force per unit length between two current carrying wires.\"\"\"\n",
      "\n",
      "from math import pi \n",
      "\n",
      "#Variable Declaration:\n",
      "I=300.0               #Current flowing through each wire(in Amperes)\n",
      "r=1.5e-02             #Separation between the wires(in metres)\n",
      "l=70e-02              #Length of each wire(in metres)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "abs_per=(4*pi)/(1e07)\n",
      "\"\"\"Since the length of the wires is 70 cm and their separation is only 1.5 cm(i.e, l>>r),\n",
      "   we can conclude that for the given separation the two wires are infinitely long. \"\"\"\n",
      "F=(abs_per*I*I)/(2*pi*r)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The force per unit length between the two wires is %.2f N/m.\" %(F)\n",
      "print \"Since the currents in the two wires are in the opposite directions,the force between them will be repulsive.\"\"\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The force per unit length between the two wires is 1.20 N/m.\n",
        "Since the currents in the two wires are in the opposite directions,the force between them will be repulsive.\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.15,Page number: 158"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the counter torque to prevent a coil from turning.\"\"\"\n",
      "\n",
      "from math import pi,sin,radians\n",
      "\n",
      "#Variable Declaration:\n",
      "N=30.0                #Number of turns in the circular coil\n",
      "r=8e-02               #Radius of circular coil(in metres)\n",
      "I=6.0                 #Current flowing through the circular coil(in Amperes)\n",
      "B=1.0                 #Magnitude of uniform magnetic field(in Tesla)\n",
      "angle=60              #Angle made by the field lines with the normal to the coil(in degrees)\n",
      "\n",
      " \n",
      "#Calculations:\n",
      "\"\"\"The counter torque required to prevent the coil from moving must be equal(and opposite) to the torque developed.\"\"\"\n",
      "A=pi*r*r\n",
      "tor=B*I*N*A*sin(radians(angle))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The counter torque that must be applied to prevent the coil from turning is %.2f Nm.\" %(tor) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The counter torque that must be applied to prevent the coil from turning is 3.13 Nm.\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.16,Page number: 158"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the maximum voltage induced in a coil.\"\"\"\n",
      "\n",
      "#Variable Declaration:\n",
      "A=300e-04             #Area of circular coil(in square-m)\n",
      "N=25.0                #Number of turns in the circular coil\n",
      "w=40.0                #Angluar frequency(in radians per second)\n",
      "B=0.05                #Magnitude of uniform magnetic field(in Tesla)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Em=N*B*A*w\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The maximum value of emf induced in the coil is %.2f V.\" %(Em)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum value of emf induced in the coil is 1.50 V.\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5.17,Page number: 158"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the induces emf in a circular conducting loop.\"\"\"\n",
      "\n",
      "from math import pi\n",
      "\n",
      "#Variable Declaration:\n",
      "B=0.02                #Magnitude of uniform magnetic field(in Tesla)\n",
      "r=2e-02               #Radius of the circular loop(in metres)\n",
      "rate=1.0e-03          #Rate of shrinking of the radius(in metre per second)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "\"\"\" flux=B*A; A=(pi*r*r);\n",
      "    e=d(flux)/dt; \n",
      "    \n",
      "    e=(B*pi*2*r)*(dr/dt);  \"\"\"\n",
      "\n",
      "e=B*pi*2*r*rate\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The emf induced in the loop at an instant when the radius is 2 cm is %e V.\" %(e) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The emf induced in the loop at an instant when the radius is 2 cm is 2.513274e-06 V.\n"
       ]
      }
     ],
     "prompt_number": 32
    }
   ],
   "metadata": {}
  }
 ]
}