summaryrefslogtreecommitdiff
path: root/Engineering_Physics_(Volume-2)_by_S.K._Gupta/chapter6_3.ipynb
blob: 89f5d752865d9287fda2f45cfc5930a92fc300ff (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
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
{
 "metadata": {
  "name": "",
  "signature": "sha256:051dd4d8e63ef61b5430123d8cd0a562c5bdd2cd67fa5b75b947bfd8e0093f34"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter6:ELECTROMAGNETICS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg1:pg-206"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "r=1     #radius in meter\n",
      "H=2     #magnitude of field vector in amp/meter\n",
      "pi=1    #let\n",
      "I=H*2*pi*r                                                     \n",
      "print\"Current in the wire is %d*pi amp\"%I"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current in the wire is 4*pi amp\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg5:pg-212"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "sigma=1e-4           #conductivity in siemen/m\n",
      "Er=2.25              #relative permittivity \n",
      "E0=1/(4*math.pi*9e9) #permittivity of free space\n",
      "#E=5e-6*sin(9e9*t) is the electric field in the material volt/m (given)\n",
      "#J= sigma*E = 1e-4*5e-6*sin(9e9*t)= 5e-10sin(9e9*t)is Conduction current density in A/m**2 \n",
      "#d(E)/dt= 5e-6*9e9*cos(9e9*t)\n",
      "#Jd=E0*Er*(d(E)/dt) is Displacement current density in A/m**2\n",
      "print\"Conduction current density is %s*sin(9e9*t) A/m**2\"%(sigma*5e-6)\n",
      "print\"Displacement current density is %s*cos(9e9*t) A/m**2\"%round((E0*Er*5e-6*9e9),9)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Conduction current density is 5e-10*sin(9e9*t) A/m**2\n",
        "Displacement current density is 8.95e-07*cos(9e9*t) A/m**2\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg13:pg-236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "H0=1    #magnitude of field vector in amp/meter\n",
      "mu_0=4*round(math.pi,2)*1e-7 #permeability of free space in H/m\n",
      "e0=8.85e-12   #permittivity of free space in F/m\n",
      "E0=H0*math.sqrt(mu_0/e0)\n",
      "print\"Magnitude of electric field for plane wave in free space is \",round(E0,2),\"V/m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Magnitude of electric field for plane wave in free space is  376.72 V/m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg14:pg-236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "E0=1e2    #maximum electric field in plane electromagnetic wave in Newton/coul.\n",
      "c=3e8     #speed of light in m/sec\n",
      "B0=E0/c  \n",
      "print\"Maximum magnetic field is \",round(B0,9),\"Tesla\"\n",
      "print\"Maximum magnetic field will be in Z-direction.\"#this part is not printed in answer in book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum magnetic field is  3.33e-07 Tesla\n",
        "Maximum magnetic field will be in Z-direction.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg15:pg-236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "S=2*4.2e4/60   #energy flux per unit area per second at the earth surface\n",
      "mu_0=4*round(math.pi,2)*1e-7  #permeability of free space in H/m\n",
      "e0=8.85e-12    #permittivity of free space in F/m\n",
      "EH=S\n",
      "E_div_H=math.sqrt(mu_0/e0)\n",
      "E=math.sqrt(E_div_H*EH)\n",
      "H=EH/E\n",
      "E0=round(E,1)*round(math.sqrt(2.),3)\n",
      "H0=H*math.sqrt(2.)\n",
      "print\"Amplitude of electric field is \",round(E0,1),\"V/m\"\n",
      "print\"Amplitude of magnetic field is \",round(H0,3),\"A-turn m-1\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Amplitude of electric field is  1026.8 V/m\n",
        "Amplitude of magnetic field is  2.726 A-turn m-1\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg16:pg-236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "P0=1000   #power in watt\n",
      "r=2       #distance in meter\n",
      "Sav=P0/(4*round(math.pi,2)*r**2)\n",
      "mu_0=4*round(math.pi,2)*1e-7   #permeability of free space in H/m\n",
      "e0=8.85e-12   #permittivity of free space in F/m\n",
      "EH=Sav\n",
      "E_div_H=math.sqrt(mu_0/e0)\n",
      "E=math.sqrt(E_div_H*EH)\n",
      "H=EH/E\n",
      "print\"Average value of electric field intensity is \",round(E,2),\"V/m\"\n",
      "print\"Average value of magnetic field intensity is \",round(H,2),\"A-turn m-1\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Average value of electric field intensity is  86.59 V/m\n",
        "Average value of magnetic field intensity is  0.23 A-turn m-1\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg17:pg-237"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "S=1.38      #energy flux in KW/m**2\n",
      "c=3e8       #speed of light in m/sec\n",
      "mu_0=4*math.pi*1e-7   #permeability of free space in H/m\n",
      "E0=math.sqrt(2*mu_0*c*S*1e3)\n",
      "B0=E0/c\n",
      "print\"Peak value of electric field is \",round(E0*1e-3,2),\"KV/m\"\n",
      "print\"Peak value of magnetic field is \",round(B0,7),\"Wb/m**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Peak value of electric field is  1.02 KV/m\n",
        "Peak value of magnetic field is  3.4e-06 Wb/m**2\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg18:pg-237"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "E0=100      #in Newton/coul.\n",
      "A=1e-3      #area in m**2\n",
      "l=100       #length in cm\n",
      "e0=8.85e-12 #permittivity of free space in F/m\n",
      "V=A*l*1e-2\n",
      "U=e0*E0**2*V/2\n",
      "print\"Energy contained in cylinder is \",U,\"Joule\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy contained in cylinder is  4.425e-11 Joule\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg19:pg-238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "E0=0.05   #amplitude of electric field strength in V/m\n",
      "v=6       #frequency in MHz\n",
      "c=3e8     #speed of light in m/sec\n",
      "mu_0=4*math.pi*1e-7 #permeability of free space in H/m\n",
      "e0=8.85e-12         #permittivity of free space in F/m\n",
      "T=round(1/(v*1e6),9)\n",
      "lamda=c/(v*1e6)\n",
      "H0=E0/math.sqrt(mu_0/e0)\n",
      "Sx_av=E0*round(H0,6)/2\n",
      "print\"E=\",E0,\"*sin(\",\"{:.2e}\".format(2*math.pi/T),\"t -\",(2*round(math.pi,2)/lamda),\"x) V/m\"\n",
      "print\"H=\",\"{:.2e}\".format(H0),\"*sin(\",\"{:.2e}\".format(2*math.pi/T),\"t -\",(2*round(math.pi,2)/lamda),\"x) A/m\"   \n",
      "print\"B=\",round(E0/c,12),\"*sin(\",\"{:.2e}\".format(2*math.pi/T),\"t -\",(2*round(math.pi,2)/lamda),\"x) Wb/m**2\"         \n",
      "print\"Average poynting vector S=\",Sx_av,\"Wb/m**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "E= 0.05 *sin( 3.76e+07 t - 0.1256 x) V/m\n",
        "H= 1.33e-04 *sin( 3.76e+07 t - 0.1256 x) A/m\n",
        "B= 1.67e-10 *sin( 3.76e+07 t - 0.1256 x) Wb/m**2\n",
        "Average poynting vector S= 3.325e-06 Wb/m**2\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg20:pg-239"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "lamda=7   #wavelength in mm\n",
      "E0=42     #maximum magnitude of electric field in V/m\n",
      "c=3e8     #speed of light in m/sec\n",
      "print\"E=\",E0,\"*sin(2*pi*(ct-x)/\",lamda,\") V/m\"\n",
      "print\"B=\",E0/c,\"*sin(2*pi*(ct-x)/\",lamda,\") Wb/m**2 \\nThe magnetic field is along Z-axis.\"\n",
      "#unit is not mentioned in answer in book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "E= 42 *sin(2*pi*(ct-x)/ 7 ) V/m\n",
        "B= 1.4e-07 *sin(2*pi*(ct-x)/ 7 ) Wb/m**2 \n",
        "The magnetic field is along Z-axis.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg21:pg-239"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "er=81  #relative permittivity of distilled water\n",
      "e0=1   #let, permittivity of free space\n",
      "mu_0=1 #let, permeability of free space\n",
      "e=e0*er\n",
      "c=3e8  #speed of light in m/sec\n",
      "mu=mu_0#for distilled water\n",
      "MU=math.sqrt((mu*e)/(mu_0*e0))\n",
      "v=c/MU\n",
      "print\"Refractive index is \",MU\n",
      "print\"Velocity of light in distilled water is \",\"{:.2e}\".format(v),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refractive index is  9.0\n",
        "Velocity of light in distilled water is  3.33e+07 m/s\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg23:pg-241"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "E0=7.5     #electric field intensity in KV/m\n",
      "w=2e9      #angular frequency in rad/sec\n",
      "c=3e8      #speed of light in m/sec\n",
      "mu_0=4*round(math.pi,2)*1e-7 #permeability of free space in H/m\n",
      "e0=8.85e-12                  #permittivity of free space in F/m\n",
      "f=w/(2*round(math.pi,2))\n",
      "lamda=c/f\n",
      "T=1/f\n",
      "H0=E0*1e3/math.sqrt(mu_0/e0)\n",
      "print\"Wavelength is \",lamda,\"m\"\n",
      "print\"Frequency is \",round(f*1e-6,1),\"MHz\"\n",
      "print\"Time period is \",T,\"sec\"\n",
      "print\"Amplitude of magnetic field intensity is \",round(H0,2),\"A/m\"\n",
      "print\"Therefore, Hz=\",round(H0,2),\"*cos( (%.e*t)-(beta*x)) A/m\"%w#unit is not printed in book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength is  0.942 m\n",
        "Frequency is  318.5 MHz\n",
        "Time period is  3.14e-09 sec\n",
        "Amplitude of magnetic field intensity is  19.91 A/m\n",
        "Therefore, Hz= 19.91 *cos( (2e+09*t)-(beta*x)) A/m\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg24:pg-241"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "mu_0=4*math.pi*1e-7  #permeability of free space in H/m\n",
      "e0=8.854e-12         #permittivity of free space in F/m\n",
      "#E=45*sin(6e8*pi*t-(2*pi*x))j+15*cos(6e8*pi*t-(2*pi*x))k  volt/m   (given equation)  \n",
      "#E=Ey*sin((w*t)-(beta*x))j + Ez*cos((w*t)-(beta*x))k   (standard form)\n",
      "#compairing given equation with above equation\n",
      "pi=1      #let\n",
      "beta=2*pi\n",
      "w=6e8*pi\n",
      "f=w/(2*pi)\n",
      "n0=math.sqrt(mu_0/e0)\n",
      "print\"Phase constant is %d*pi rad/s\"%beta\n",
      "print\"Angular frequency is %.e*pi rad/s\"%w\n",
      "print\"Frequency is %.e Hz\"%f\n",
      "print\"Intrinsic impedance is %d Ohm\"%round(n0)\n",
      "print\"Magnetic field is [0  %s*cos(6*pi*10**8*t-(2*pi*x))  %s*sin(6*pi*10**8*t-(2*pi*x))] A/m\"%(round(15/n0,4),round(45/n0,3))  #unit is not printed in book"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Phase constant is 2*pi rad/s\n",
        "Angular frequency is 6e+08*pi rad/s\n",
        "Frequency is 3e+08 Hz\n",
        "Intrinsic impedance is 377 Ohm\n",
        "Magnetic field is [0  0.0398*cos(6*pi*10**8*t-(2*pi*x))  0.119*sin(6*pi*10**8*t-(2*pi*x))] A/m\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg25:pg-242"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sympy import symbols,diff,cos,sin\n",
      "import math\n",
      "x,y,B,Y=symbols('x y B Y')\n",
      "Hz=(6*x*cos(B))+(12*y*sin(Y))\n",
      "a=diff(Hz,y)\n",
      "b=diff(-Hz,x)\n",
      "c=0\n",
      "d=array([a,b,c])\n",
      "print\"J =\", d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "J = [12*sin(Y) -6*cos(B) 0]\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg26:pg-244"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "A=1.3   #area in m**2\n",
      "t=3     #time in hours\n",
      "S=1.1   #intensity of sun rays in KW/m**2\n",
      "c=3e8   #speed of light in m/sec\n",
      "p=A*(t*3600)*(S*1000)/c\n",
      "print\"Momentum is %se-4 Kg-m/s\"%(p*10000)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Momentum is 514.8e-4 Kg-m/s\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg27:pg-245"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "S=10      #energy flux in watt/m**2\n",
      "A=1       #area in m**2\n",
      "t=1       #time in hour\n",
      "c=3e8     #speed of light in m/sec\n",
      "p=2*S*A*(t*3600)/c\n",
      "F=2*S*A/c\n",
      "print\"Momentum is %.1e Kg-m/s\"%p\n",
      "print\"Force is %.2e N\"%F"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Momentum is 2.4e-04 Kg-m/s\n",
        "Force is 6.67e-08 N\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg29:pg-251"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "mu=4*math.pi*1e-7  #permeability in H/m\n",
      "f=71.6             #frequency in MHz\n",
      "sigma=3.54e7       #conductivity in siemens/m\n",
      "d=1/sqrt(math.pi*f*1e6*mu*sigma)\n",
      "print\"Depth of penetration is \",int(round(d*1e6)),\"micro meter\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Depth of penetration is  10 micro meter\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg30:pg-251"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "f=3e6    #frequency in Hz\n",
      "mu_r=1   \n",
      "mu_0=4*round(math.pi,2)*1e-7  # in H/m\n",
      "sigma=38e6                    # in S/m\n",
      "mu=mu_r*mu_0\n",
      "d=1/math.sqrt(round(math.pi,2)*f*mu*sigma)\n",
      "alpha=1/(d)\n",
      "beta=alpha\n",
      "magnitude=math.sqrt(alpha**2+beta**2)\n",
      "angle=math.degrees(math.atan(beta/alpha))\n",
      "v=2*round(math.pi,2)*f/round(beta)\n",
      "print\"Skin depth is \",round(d*1e3,5),\"mm\"\n",
      "print\"Propagation constant =[ %.4e , %s degree] m**-1\"%(magnitude,int(angle)) #in polar form\n",
      "print\"Wave velocity is \",round(v,2),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Skin depth is  0.04716 mm\n",
        "Propagation constant =[ 2.9987e+04 , 45 degree] m**-1\n",
        "Wave velocity is  888.51 m/s\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg31:pg-252"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "mu=4*math.pi*1e-7   # in H/m\n",
      "e0=8.854e-12        # in F/m\n",
      "e=70*e0\n",
      "sigma=5\n",
      "d=(2./sigma)*math.sqrt(e/mu)\n",
      "alpha=1/round(d,4)\n",
      "print\"skin depth is \",round(d,4),\"m\"\n",
      "print\"Attenuation constant is \",round(alpha,2),\"Np/m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "skin depth is  0.0089 m\n",
        "Attenuation constant is  112.36 Np/m\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg32:pg-253"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import cmath\n",
      "sigma=2e-3    #in S/m\n",
      "e0=8.854e-12  #in F/m\n",
      "e=80*e0\n",
      "f=10          #in KHz\n",
      "mu=4*math.pi*1e-7  #in H/m\n",
      "ratio=sigma/(2*round(math.pi,2)*f*1e3*e)\n",
      "\n",
      "#since ratio= sigma/(w*e) = 44.96 >>1,therefore, medium is a good conductor.\n",
      "#So calculations will be done considering medium as a good conductor.\n",
      "\n",
      "alpha=math.sqrt(2*math.pi*f*1e3*mu*sigma/2)\n",
      "beta=int(alpha*1e5)*1e-5\n",
      "magnitude=math.sqrt(alpha**2+beta**2)\n",
      "angle=math.degrees(math.atan(beta/alpha))\n",
      "ni=round(round(math.sqrt(2*math.pi*f*1e3*mu/sigma),2)/round(math.sqrt(2),2),3)*(1+1j)\n",
      "lamda=2*round(math.pi,2)/beta\n",
      "v=2*math.pi*f*1e3/beta\n",
      "print\"Attenuation constant is %.2e neper/m\"%(int(alpha*1e5)*1e-5)\n",
      "print\"Phase constant is %.2e rad/m\"%beta\n",
      "print\"Propagation constant = [ %.3e , %.f degree] m**-1\"%(magnitude,angle)#in polar form(unit is not printed in book)       \n",
      "print\"Intrinsic impedance is \",ni,\"ohm\"\n",
      "print\"Wavelength is %.2f m\"%lamda\n",
      "print\"Velocity of wave is %.2e m/s\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Attenuation constant is 8.88e-03 neper/m\n",
        "Phase constant is 8.88e-03 rad/m\n",
        "Propagation constant = [ 1.256e-02 , 45 degree] m**-1\n",
        "Intrinsic impedance is  (4.454+4.454j) ohm\n",
        "Wavelength is 707.21 m\n",
        "Velocity of wave is 7.08e+06 m/s\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg33:pg-254"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "f=100      #in MHz\n",
      "mu_r=1\n",
      "mu_0=4*round(math.pi,2)*1e-7  #in H/m\n",
      "mu=mu_0*mu_r\n",
      "sigma=58e6                    #in S/m\n",
      "alpha=math.sqrt(round(math.pi,2)*f*1e6*mu*sigma)\n",
      "alpha=int(alpha/10)*10\n",
      "beta=alpha\n",
      "magnitude=math.sqrt(alpha**2+beta**2)\n",
      "angle=math.degrees(math.atan(beta/alpha))\n",
      "sqrt_j=45\n",
      "ni=sqrt(2*round(math.pi,2)*f*1e6*mu/sigma)\n",
      "v=2*round(math.pi,2)*f*1e6/beta\n",
      "print\"Attenuation constant is %.4e neper/m\"%(int(alpha*1e5)*1e-5)\n",
      "print\"Phase constant is %.4e rad/m\"%beta\n",
      "print\"Propagation constant = [ %.4e , %.f degree] m**-1\"%(magnitude,angle)#in polar form(unit is not printed in book)         \n",
      "print\"Intrinsic impedance = [ %.3e , %s degree ] ohm\"%(ni,sqrt_j)#in polar form(unit is not printed in book)\n",
      "print\"Velocity of wave is %.3f Km/s\"%(v/1e3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Attenuation constant is 1.5124e+05 neper/m\n",
        "Phase constant is 1.5124e+05 rad/m\n",
        "Propagation constant = [ 2.1389e+05 , 45 degree] m**-1\n",
        "Intrinsic impedance = [ 3.688e-03 , 45 degree ] ohm\n",
        "Velocity of wave is 4.152 Km/s\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Eg34:pg-255"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "mu=4*math.pi*1e-7  #in H/m\n",
      "sigma=3.54e7       #in S/m\n",
      "d=0.0664           #penetration depth in mm\n",
      "f=1/(math.pi*mu*sigma*(d*1e-3)**2)\n",
      "print\"Frequency is %.2f MHz\"%(f/1e6)\n",
      "#answer is wrong in book because d=0.0644 is taken in calculation which is wrong(given d=0.0664 mm)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency is 1.62 MHz\n"
       ]
      }
     ],
     "prompt_number": 36
    }
   ],
   "metadata": {}
  }
 ]
}