summaryrefslogtreecommitdiff
path: root/Engineering_Physics_Vijaya/.ipynb_checkpoints/chapter2_2-checkpoint.ipynb
blob: 2ff5590c99fdcc61c47064cd08510e5fd9dd612b (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:04561aafd347865fa8c83acfb9b60eb84db275f85862655b442f546023cadd1e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Electron Theory of Metals"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.1, Page number 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#import module\n",
      "import math\n",
      "\n",
      "#Calculation\n",
      "# given that E-Ef = kT\n",
      "# fermi function FE = 1/(1+exp((E-Ef)/kT)\n",
      "# therefore FE = 1/(1+exp(kT/kT));\n",
      "# FE = 1/(1+exp(1))\n",
      "FE=1/(1+math.exp(1));\n",
      "FE=math.ceil(FE*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"fermi function is\",FE);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('fermi function is', 0.27)\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.2, Page number 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "\n",
      "#Calculation\n",
      "# given that E-Ef = kT\n",
      "# fermi function FE = 1/(1+exp((E-Ef)/kT)\n",
      "# therefore FE = 1/(1+exp(kT/kT));\n",
      "# FE = 1/(1+exp(1))\n",
      "FE=1/(1+math.exp(1));\n",
      "FE=math.ceil(FE*10**3)/10**3;   #rounding off to 3 decimals\n",
      "\n",
      "#Result\n",
      "print(\"fermi function is\",FE);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('fermi function is', 0.269)\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.3, Page number 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "FE=10/100;    #fermi function is 10%\n",
      "Ef=5.5;   #fermi energy of silver in eV\n",
      "k=1.38*10**-23;\n",
      "\n",
      "#Calculation\n",
      "E=Ef+(Ef/100);\n",
      "#FE=1/(1+math.exp((E-Ef)/(k*T)))\n",
      "#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n",
      "#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n",
      "#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n",
      "#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n",
      "#let X=E-Ef;    \n",
      "X=E-Ef;     #energy in eV\n",
      "X=X*1.6*10**-19;    #energy in J\n",
      "T = (X/(k*math.log((1/FE)-1)));\n",
      "T=math.ceil(T*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"temperature in K is\",T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('temperature in K is', 290.23)\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.4, Page number 70 **************************************"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "#let X=E-Ef\n",
      "X=0.5;   #E-Ef=0.5 in eV\n",
      "\n",
      "#Calculation\n",
      "X=X*1.6*10**-19;   #X in J\n",
      "FE=1/100;    #fermi function is 1% \n",
      "k=1.38*10**-23;\n",
      "#FE=1/(1+exp(X/(k*T)))\n",
      "#therefore 1/FE = 1+math.exp(X/(k*T))\n",
      "#therefore (1/FE)-1 = math.exp(X/(k*T))\n",
      "#therefore log((1/FE)-1) = X/(k*T)\n",
      "#but log(x) = 2.303*math.log10(x)\n",
      "#therefore T = X/(k*math.log((1/FE)-1))\n",
      "#but log(x)=2.303*math.log10(x)\n",
      "#therefore T = X/(k*2.303*math.log10((1/FE)-1))\n",
      "T = X/(k*2.303*math.log10((1/FE)-1));\n",
      "\n",
      "#Result\n",
      "print(\"temperature in K is\",T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('temperature in K is', 1261.3505710887953)\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.5, Page number 71 *******"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "rho_s=10.5*10**3;   #density in kg/m^3\n",
      "NA=6.02*10**26;    #avagadro number per kmol\n",
      "MA=107.9; \n",
      "\n",
      "#Calculation\n",
      "n=(rho_s*NA)/MA;\n",
      "sigma=6.8*10**7;\n",
      "e=1.6*10**-19;   #charge in coulomb\n",
      "mew=sigma/(n*e);\n",
      "mew=math.ceil(mew*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"density of electrons is\",n);\n",
      "print(\"mobility of electrons in silver in m^2/Vs is\",mew);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('density of electrons is', 5.85820203892493e+28)\n",
        "('mobility of electrons in silver in m^2/Vs is', 0.007255)\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.6, Page number 71 ***"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "d=8.92*10**3;   #density in kg/m^3\n",
      "rho=1.73*10**-8;  #resistivity in ohm-m\n",
      "m=9.1*10**-31;    #mass in kg\n",
      "w=63.5;    #atomic weight\n",
      "e=1.6*10**-19;    #charge in coulomb\n",
      "A=6.02*10**26;    #avagadro number\n",
      "\n",
      "#Calculation\n",
      "n=(d*A)/w;\n",
      "mew=1/(rho*n*e);\n",
      "tow=m/(n*(e**2)*rho);\n",
      "mew=math.ceil(mew*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"mobility of electrons in Copper in m/Vs is\",mew);\n",
      "print(\"average time of collision of electrons in copper in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('mobility of electrons in Copper in m/Vs is', 0.004273)\n",
        "('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.7, Page number 72"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "rho=1.54*10**-8;    #resistivity in ohm-m\n",
      "n=5.8*10**28;       #electron/m^3\n",
      "m=9.108*10**-31;   #mass in kg\n",
      "e=1.602*10**-19;   #charge in coulomb\n",
      "\n",
      "#Calculation\n",
      "tow=m/(n*(e**2)*rho);\n",
      "\n",
      "#Result\n",
      "print(\"relaxation time of conduction electrons in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('relaxation time of conduction electrons in sec is', 3.973281032516849e-14)\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.8, Page number 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "FE=10/100;    #fermi function is 10%\n",
      "Ef=5.5;   #fermi energy of silver in eV\n",
      "k=1.38*10**-23;\n",
      "\n",
      "#Calculation\n",
      "E=Ef+(Ef/100);\n",
      "#FE=1/(1+math.exp((E-Ef)/(k*T)))\n",
      "#therefore 1/FE = 1+math.exp((E-Ef)/(k*T))\n",
      "#therefore (1/FE)-1 = math.exp((E-Ef)/(k*T))\n",
      "#therefore log((1/FE)-1) = (E-Ef)/(k*T)\n",
      "#therefore T = (E-Ef)/(k*math.log((1/FE)-1))\n",
      "#let X=E-Ef;    \n",
      "X=E-Ef;     #energy in eV\n",
      "X=X*1.6*10**-19;    #energy in J\n",
      "T = (X/(k*math.log((1/FE)-1)));\n",
      "T=math.ceil(T*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"temperature in K is\",T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('temperature in K is', 290.23)\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.9, Page number 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "\n",
      "#Calculation\n",
      "# given that E-Ef = kT\n",
      "# fermi function FpE = 1/(1+exp((E-Ef)/kT)\n",
      "# therefore FpE = 1/(1+exp(kT/kT));\n",
      "# FpE = 1/(1+exp(1))\n",
      "FpE=1/(1+math.exp(1));\n",
      "FpE=math.ceil(FpE*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"fermi function is\",FpE);\n",
      "#the presence of electron at that energy level is not certain"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('fermi function is', 0.27)\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.10, Page number 74  ****************************"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "m=9.1*10**-31;   #mass in kg\n",
      "h=6.626*10**-34;\n",
      "A=(8*m)**(3/2);\n",
      "\n",
      "#Calculation\n",
      "B=math.pi/(2*h**3);\n",
      "EfeV=3.10;    #fermi energy in eV\n",
      "Ef=EfeV*1.6*10**-19;    #fermi energy in J\n",
      "EFeV=EfeV+0.02;    #energy after interval in eV\n",
      "EF=EFeV*1.6*10**-19;    #energy after interval in J\n",
      "def f(E):\n",
      "    Q=A*B*math.sqrt(E)\n",
      "    \n",
      "I=(Ef,EF,f)\n",
      "\n",
      "#Result\n",
      "print(\"number of energy states per unit volume is\",I);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('number of energy states per unit volume is', (4.960000000000001e-19, 4.992000000000001e-19, <function f at 0x7f1495202848>))\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.11, Page number 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "T=300;   #temperature in K\n",
      "n=8.5*10**28;   #density per m^3\n",
      "rho=1.69*10**-8;   #resistivity in ohm/m^3\n",
      "me=9.11*10**-31;    #mass of electron in kg\n",
      "e=1.6*10**-19;    #charge in coulomb\n",
      "KB=1.38*10**-23;    #boltzmann constant in J/k\n",
      "\n",
      "#Calculation\n",
      "lamda=math.sqrt(3*KB*me*T)/(n*(e**2)*rho);\n",
      "\n",
      "#Result\n",
      "print(\"mean free path of electron in m is\",lamda);\n",
      "\n",
      "#answer given in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('mean free path of electron in m is', 2.892506814374228e-09)\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.12, Page number 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "rho=1.43*10**-8;    #resistivity in ohm-m\n",
      "n=6.5*10**28;    #electron/m^3\n",
      "m=9.11*10**-34;  #mass in kg\n",
      "e=1.6*10**-19;   #charge in coulomb\n",
      "\n",
      "#Calculation\n",
      "tow=m/(n*(e**2)*rho);\n",
      "\n",
      "#Result\n",
      "print(\"relaxation time of conduction electrons in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('relaxation time of conduction electrons in sec is', 3.8285032275416887e-17)\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.13, Page number 75 ******"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "d=8.92*10**3;   #density in kg/m^3\n",
      "rho=1.73*10**-8;  #resistivity in ohm-m\n",
      "m=9.1*10**-31;    #mass in kg\n",
      "M=63.5;    #atomic weight\n",
      "e=1.6*10**-19;    #charge in coulomb\n",
      "A=6.02*10**26;    #avagadro number\n",
      "\n",
      "#Calculation\n",
      "n=(d*A)/M;\n",
      "mew=1/(rho*n*e);\n",
      "tow=m/(n*(e**2)*rho);\n",
      "mew=math.ceil(mew*10**6)/10**6;   #rounding off to 6 decimals\n",
      "\n",
      "#Result\n",
      "print(\"mobility of electrons in Copper in m/Vs is\",mew);\n",
      "print(\"average time of collision of electrons in copper in sec is\",tow);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('mobility of electrons in Copper in m/Vs is', 0.004273)\n",
        "('average time of collision of electrons in copper in sec is', 2.4297841992299697e-14)\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.14, Page number 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "MH=1.008*2*1.67*10**-27;    #mass in kg\n",
      "T=30;   #temperature in C\n",
      "\n",
      "#Calculation\n",
      "T=T+273;   #temperature in K\n",
      "KB=1.38*10**-23;    #boltzmann constant in J/k\n",
      "KE=(3/2)*KB*T;   #kinetic energy in J\n",
      "KEeV=KE*6.24*10**18;   #kinetic energy in eV\n",
      "cbar=math.sqrt((3*KB*T)/MH);\n",
      "\n",
      "#Result\n",
      "print(\"average kinetic energy in J is\",KE);\n",
      "print(\"average kinetic energy in eV is\",KEeV);\n",
      "print(\"velocity of molecules in m/s is\",cbar);\n",
      "\n",
      "#answers for average kinetic energy in eV and velocity of electrons given in the book are wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('average kinetic energy in J is', 6.2720999999999986e-21)\n",
        "('average kinetic energy in eV is', 0.039137903999999994)\n",
        "('velocity of molecules in m/s is', 1930.269663853336)\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.15, Page number 77 ****"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "Ee=10;   #electron kinetic energy in eV\n",
      "Ep=10;   #proton kinetic energy in eV\n",
      "me=9.1*10**-31;   #mass of electron in kg\n",
      "mp=1.67*10**-27;   #mass of proton in kg\n",
      "\n",
      "#Calculation\n",
      "EeeV=Ee*1.6*10**-19;   #electron kinetic energy in J\n",
      "EpeV=Ep*1.6*10**-19;   #proton kinetic energy in J\n",
      "cebar=math.sqrt((2*EeeV)/me);\n",
      "cpbar=math.sqrt((2*EpeV)/mp);\n",
      "\n",
      "#Result\n",
      "print(\"velocity of electron in m/s is\",cebar);\n",
      "print(\"velocity of proton in m/s is\",cpbar);\n",
      "\n",
      "#answers given in the book are wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('velocity of electron in m/s is', 1875228.9237539817)\n",
        "('velocity of proton in m/s is', 43774.05241316662)\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.16, Page number 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "A=10;   #area of cross section in mm^2\n",
      "A=A*10**-6;   #area of cross section in m^2\n",
      "i=100;   #current in amp\n",
      "n=8.5*10**28;    #number of electrons per mm^3\n",
      "e=1.6*10**-19;    #electron charge in coulumb\n",
      "\n",
      "#Calculation\n",
      "vd=1/(n*A*e);\n",
      "\n",
      "#Result\n",
      "print(\"drift velocity in m/s is\",vd);\n",
      "\n",
      "#answer given in the book is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('drift velocity in m/s is', 7.3529411764705884e-06)\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.17, Page number 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "#import module\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable decleration\n",
      "tow=3*10**-14;    #relaxation time in sec\n",
      "n=8*10**28;    #density of electrons per m^3\n",
      "KB=1.38*10**-23;   #boltzmann constant in J/k\n",
      "T=0;   #temperature in C\n",
      "\n",
      "#Calculation\n",
      "T=T+273;   #temperature in K\n",
      "m=9.1*10**-31;   #mass of electron in kg\n",
      "sigma_T=((3*n*tow*(KB**2)*T)/(2*m));\n",
      "sigma_T=math.ceil(sigma_T*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print(\"thermal conductivity of copper in ohm-1 is\",sigma_T);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "('thermal conductivity of copper in ohm-1 is', 205.68)\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}