summaryrefslogtreecommitdiff
path: root/ELECTRICAL_ENGINEERING_MATERIALS_by_R.K.Shukla/Chapter8_3.ipynb
blob: f08902b6e7afa4674c39d39f4bbdad630b459f6d (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
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 8:Mechanism of Conduction in Semiconductors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.1,Page No:8.13"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Kinetic Energy = 0.1 eV\n",
      "Momentum of electrons = 4.5e-26 kg m/s\n",
      "Momentum of holes = 4.4e-26 kg m/s\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "Ephoton = 1.5;               # energy of photon in eV\n",
    "Eg      = 1.4;               # energy gap in eV\n",
    "m       = 9.1*10**-31;       # mass of electron in kg\n",
    "e       = 1.6*10**-19;       #charge of electron in coulombs\n",
    "me_GaAs = 0.07;              #times of electro mass in kilograms\n",
    "mh_GaAs = 0.068;             #times of electro mass in kilograms\n",
    "\n",
    "# Calculations\n",
    "Eke     = Ephoton - Eg;                    #energy on eV\n",
    "pe      = math.sqrt(2*m*me_GaAs*Eke*e)     # momentum of electrons  in kg m/s\n",
    "ph      = math.sqrt(2*m*mh_GaAs*Eke*e)     # momentum of electrons in kg m/s\n",
    "\n",
    "# Result\n",
    "print'Kinetic Energy = %3.1f'%Eke,'eV';\n",
    "print'Momentum of electrons = %3.1e'%pe,'kg m/s';\n",
    "print'Momentum of holes = %3.1e'%ph,'kg m/s';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.2,Page No:8.27"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Thermal equilibrium hole concentration = 1.15e+16  cm**-3\n",
      "Note: Calculation mistake in textbook Nv is not multiplied by exponentiation\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "T1  = 300;               # temperature in kelvin\n",
    "nv  = 1.04*10**19;       #in cm**-3\n",
    "T2  = 400;               #temperature in K\n",
    "fl  = 0.25;              #fermi level position in eV\n",
    "\n",
    "#Calculations\n",
    "Nv  = (1.04*10**19)*(T2/float(T1))**(3/float(2));           #Nv at 400 k in cm**-3\n",
    "kT  = (0.0259)*(T2/float(T1));                              #kT in eV\n",
    "po  = Nv*math.exp(-(fl)/float(kT));                         #hole oncentration in cm**-3\n",
    "\n",
    "\n",
    "# Result\n",
    "print'Thermal equilibrium hole concentration = %3.2e '%po,'cm**-3';\n",
    "print'Note: Calculation mistake in textbook Nv is not multiplied by exponentiation';"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.3,Page No:8.27"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Intrinsic Carrier Concentration at 300K = 1.95e+06 cm**-3\n",
      "Intrinsic Carrier Concentration at 300K = 3.34e+10 cm**-3\n",
      " Note : Calculation mistake in textbook in finding carrier conc. at 450K\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "Nc  = 3.8*10**17;            #constant in cm**-3\n",
    "Nv  = 6.5*10**18;            #constant in cm**-3\n",
    "Eg  = 1.42;                  # band gap energy in eV\n",
    "KT1 = 0.03885;               # kt value at 450K\n",
    "T1  = 300;                   #temperature in K\n",
    "T2  = 450;                   #temperature in K\n",
    "\n",
    "# calculation\n",
    "n1i  = math.sqrt(Nc*Nv*math.exp(-Eg/float(0.0259)));               #intrinsic carrier concentration in cm**-3\n",
    "n2i  = math.sqrt(Nc*Nv*((T2/float(T1))**3) *math.exp(-Eg/float(KT1)));     # intrinsic carrier conc at 450K in cm**-3\n",
    "\n",
    "# Result\n",
    "print'Intrinsic Carrier Concentration at 300K = %3.2e'%n1i,'cm**-3';\n",
    "print'Intrinsic Carrier Concentration at 300K = %3.2e'%n2i,'cm**-3';\n",
    "print' Note : Calculation mistake in textbook in finding carrier conc. at 450K';"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.4,Page No:8.28"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The position of Fermi level with respect to middle of the bandgap is -12.7 meV\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "mh  = 0.56;             #masses interms of m0\n",
    "me  = 1.08;             #masses interms of m0\n",
    "t   = 27;               #temperature in °C\n",
    "k   = 8.62*10**-5;\n",
    "\n",
    "\n",
    "# Calculations\n",
    "T   = t+273;                                         #temperature in K\n",
    "fl  = (3/float(4))*k*T*math.log(mh/float(me));          #position of fermi level in eV\n",
    "\n",
    "#result\n",
    "print'The position of Fermi level with respect to middle of the bandgap is %3.1f'%(fl*10**3),'meV';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.5,Page No:8.30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Donor binding energy = 0.0052 eV\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "mo  = 9.11*10**-31;          #mass of electron inkilograms\n",
    "e   = 1.6*10**-19;           # charge of electron in coulombs\n",
    "er  = 13.2;                  #relative permitivity in F/m\n",
    "eo  = 8.85*10**-12;          # permitivity in F/m\n",
    "h   = 6.63*10**-34;          # plancks constant J.s\n",
    "         \n",
    "\n",
    "# Calculations\n",
    "me  = 0.067*mo;  \n",
    "E   = (me*(e**4))/float((8*(eo*er)**2)*(h**2)*e);         #energy in eV    \n",
    "\n",
    "# Result\n",
    "print'Donor binding energy = %3.4f'%E,'eV';"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.6,Page No:8.30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Equlibrium hole concentration = 2.25e+03 cm**-3\n",
      "Position of fermi energy level = 0.177 eV\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "no      = 10**17;            # doping carrier conc\n",
    "ni      = 1.5*10**10;        #intrinsic concentration\n",
    "kT      = 0.0259\n",
    "\n",
    "#Calculations\n",
    "po      = (ni**2)/float(no);             #Equlibrium hole concentration in cm**-3\n",
    "fl      = kT*math.log10(no/float(ni));   #Position of fermi energy level in eV\n",
    "\n",
    "#Result\n",
    "print'Equlibrium hole concentration = %3.2e'%po,'cm**-3';\n",
    "print'Position of fermi energy level = %3.3f'%fl,'eV';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.7,Page No:8.33"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "electrical conductivity of pure silicon =2.39e+03 ohm**-1.m**-1\n",
      "Note:calculation mistake in electrical conductivity,and units of conductivity\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "k   = 8.62*10**-5;            #in eV/K\n",
    "Eg  = 1.10;                   #energy in eV\n",
    "t1 = 200;                     #temperature in °C\n",
    "t2 = 27;                      #temperature in °C\n",
    "psi = 2.3*10**3;\n",
    "\n",
    "# Calculations\n",
    "# sigma = sigmao*exp(-Eg/(2kT))\n",
    "# k     = sigma_473/sigma_300;\n",
    "\n",
    "t3        = t1+273;                                 #temperature in K\n",
    "t4        = t2+273;                                 #temperature in K\n",
    "k1        = math.exp((-Eg)/float(2*k*t3));          #electrical conductivity in cm**-1.m**-1\n",
    "k2        = math.exp((-Eg)/float(2*k*t4));          #lectrical conductivity in cm**-1.m**-1\n",
    "k         = k1/float(k2);\n",
    "pm        = k/float(psi);\n",
    "\n",
    "#Result\n",
    "\n",
    "print'electrical conductivity of pure silicon =%3.2e'%k,'ohm**-1.m**-1';\n",
    "print'Note:calculation mistake in electrical conductivity,and units of conductivity';\n",
    " "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.8,Page No:8.33"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Resistivity = 0.5 Ω-m\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "ni  = 2.5*10**19;            # carrier density in per m**3\n",
    "q   = 1.6*10**-19;           # charge of electron in coulombs\n",
    "un  = 0.35;                 #mobility of electrons in m**2/V-s\n",
    "up  = 0.15;                 #mobility of electrons in m**2/V-s\n",
    "\n",
    "# Calculations\n",
    "sigma = ni*q*(un + up);         #conductivity in per Ω-m\n",
    "p     = 1/float(sigma);                #resistivity in Ω-m\n",
    "\n",
    "\n",
    "# Result\n",
    "print'Resistivity = %3.1f'%p,'Ω-m';"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.9,Page No:8.33"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Intrinsic Carrier Concentration = 1.04e+16 m**-3\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "p  = 3.16*10**3;            # resistivity Ω-m\n",
    "e  = 1.6*10**-19;           # charge of electron in coulombs\n",
    "ue = 0.14;                 #mobility of electrons in m**2/V-s\n",
    "uh = 0.05;                  #mobility of holes in m**2/V-s\n",
    "\n",
    "# Calculations\n",
    "\n",
    "n  = 1/float((p*e)*(ue + uh));           #carrier density  in m**-3\n",
    "\n",
    "# Result\n",
    "print'Intrinsic Carrier Concentration = %3.2e'%n,'m**-3';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.10,Page No:8.34"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The factor by which the majority conc. is more than the intrinsic carrier conc = 2942\n",
      "Hole concentration = 5.1e+15 m**-3\n",
      "Conductivity = 2542 ohm**-1 m**-1\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "p   = 5.32*10**3;        #density of germanium\n",
    "Nav = 6.023*10**26;      # Avagadros number\n",
    "AW  = 72.59;            # atomic wt\n",
    "ni  = 1.5*10**19;        # carrier density\n",
    "ue  = 0.36;\n",
    "uh  = 0.18;\n",
    "e   = 1.6*10**-19;\n",
    "\n",
    "# calculations\n",
    "N   = (p*Nav)/float(AW);            # no of germanium atoms per unit volume\n",
    "Nd  = N*10**-6 ;                   # no of pentavalent impurity atoms/m**3\n",
    "f   = Nd/float(ni);\n",
    "nh  = (ni**2)/float(Nd);           # hole concentration\n",
    "sigma = e*((Nd*ue)+(nh*uh));\n",
    "\n",
    "#Result\n",
    "print'The factor by which the majority conc. is more than the intrinsic carrier conc = %d'%f;\n",
    "print'Hole concentration = %3.1e'%nh,'m**-3';\n",
    "print'Conductivity = %d'%sigma,'ohm**-1 m**-1';\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.11,Page No:8.34"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Carrier Density = 3.1e+21 m**-3\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "p   = 5*10**-3;          # resistivity in Ω-m\n",
    "ue  = 0.3;              # electron mobility m**2/volt-s\n",
    "uh  = 0.1;              # hole mobility m**2/volt-s\n",
    "e   = 1.6*10**-19        # charge of electron in coulombs\n",
    "\n",
    "# calculations\n",
    "sigma   = 1/float(p);                        # conductivity in per Ω -m\n",
    "n       = sigma/float(e*(ue + uh));          # carrier density per m**3\n",
    "\n",
    "#Result\n",
    "print'Carrier Density = %3.1e'%n,'m**-3';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.12,Page No:8.35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Drift velocity = 10 m/s\n",
      " time = 1e-05 s\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "Jd  = 500;                   # current density A/m**2\n",
    "p   = 0.05;                  # resistivity in Ω-m\n",
    "l   = 100*10**-6;            #  travel length m\n",
    "ue  = 0.4;                   # electron mobility m**2/Vs\n",
    "e   = 1.6*10**-19;            # charge of electron in coulombs\n",
    "\n",
    "\n",
    "# Calculations\n",
    "ne  = 1/float(p*e*ue);            #in per m**3\n",
    "vd  = Jd/float(ne*e);            #drift velocity in m/s\n",
    "t   = l/float(vd);                 #time teken in s\n",
    "\n",
    "#result\n",
    "print'Drift velocity = %d'%vd,'m/s';\n",
    "print' time = %3.0e'%t,'s';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.13,Page No:8.35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "temperature rise is of = 5.91 K\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "\n",
    "#psi1 is increased by 30%, psi1/ps2 is 130/100\n",
    "a    = 1.3;                  #ratio of psi1/psi2\n",
    "K    = 8.82*10**-5;              #constant in eV/K\n",
    "Eg   = 0.719;                  #band gap in eV/K\n",
    "T    = 300;                      #temperature in K\n",
    "\n",
    "#calculation\n",
    "d=1/float((1/float(T))-((2*K/float(Eg))*math.log(1.3)));\n",
    "dT=d-T;                                             #temperature rise in  K\n",
    "\n",
    "\n",
    "#result\n",
    "print'temperature rise is of = %3.2f'%dT,'K';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.14,Page No:8.39"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Conductivity of the compensated p-type semiconductor is 0.492\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "v   = 5;            # voltage in volts\n",
    "r   = 10;           # resistance in k-ohm\n",
    "J   = 60;           # current density in A/cm**2\n",
    "E   = 100;          # electric field in V.m**-1\n",
    "Nd  = 5*10**15;      # in cm**-3\n",
    "up  = 410;          # approx hole mobility cm**2/V-s\n",
    "Na  = 1.25*10**16;   # approx in cm**-3\n",
    "e   = 1.6*10**-19;   # charge of electron in coulombs\n",
    "\n",
    "#Calculations\n",
    "I       = v/float(r);              # total current A\n",
    "A       = I/float(J);               # cross sectional area cm**2\n",
    "L       = v/float(E)                 # length of resistor cm\n",
    "sigma   = L/float(r*A);        #conductivity in (Ω-cm)**-1\n",
    "sigma_comp = e*up*(Na - Nd);        #conductivity in (Ω-cm)**-1\n",
    "\n",
    "# Result\n",
    "print'Conductivity of the compensated p-type semiconductor is %3.3f'%sigma_comp;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.15,Page No:8.39"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Diffusion Current Density = 120  A/cm**2\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "e   = 1.6*10**-19;       # charge of electron in coulombs\n",
    "Dn  = 250;              # electron diffusion co-efficient cm**2/s\n",
    "n1  = 10**18;             # electron conc. in cm**-3\n",
    "n2  = 7*10**17;         # electron conc. in cm**-3\n",
    "dx  = 0.10;              # distance in cm\n",
    "\n",
    "# Calculations\n",
    "Jdiff   = e*Dn*((n1-n2)/float(dx));    #diffusion current density A/cm**2\n",
    "\n",
    "#Result\n",
    "print'Diffusion Current Density = %d '%Jdiff,'A/cm**2';"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.16,Page No:8.43"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wavelength at which Ge starts to absorb light = 16550  Å\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "# Variable declaration\n",
    "e   = 1.6*10**-19;         # charge of electron in coulombs\n",
    "Eg  = 0.75;                #bandgap energy eV\n",
    "c   = 3*10**8;             # velocity of light in m\n",
    "h   = 6.62*10**-34;        # plancks constant in J.s\n",
    "\n",
    "# Calculations\n",
    "lamda   = (h*c)/float(Eg*e);     # wavelength in Å\n",
    "\n",
    "#Result\n",
    "print'Wavelength at which Ge starts to absorb light = %d '%(lamda*10**10),'Å';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.17,Page No:8.43"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "cutoff wavelength =0.92  um\n"
     ]
    }
   ],
   "source": [
    "# import math\n",
    "\n",
    "#variable declaration\n",
    "Eg        = 1.35*1.6*10**-19;           #energy in eV\n",
    "h         = 6.63*10**-34;               #plancks constant in J.s\n",
    "c         = 3*10**8;                    #velocity in m\n",
    "  \n",
    "#calculation\n",
    "lamda     = (h*c)/float(Eg);             #wavelength in m\n",
    "  \n",
    "#result\n",
    "print'cutoff wavelength =%3.2f '%(lamda*10**6),'um';\n",
    "  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.18,Page No:8.43"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "bandgap energy = 0.701 eV\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "h     = 6.62*10**-34            # plancks constant J.s\n",
    "c     = 3*10**8;                # velocity of light in m\n",
    "lamda = 1771*10**-9;            # wavelengthg in m\n",
    "e     = 1.6*10**-19             # charge of electron in coulombs\n",
    "\n",
    "# Calculations\n",
    "Eg  = (h*c)/float(lamda*e);      #bandgap energy eV\n",
    "\n",
    "#Result\n",
    "print'bandgap energy = %3.3f'%Eg,'eV';"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.19,Page No:8.45"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hall Voltage = 5.6  mV\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "Nd  = 10**21;             # donar density per in  m**3\n",
    "H   = 0.6;                # magnetic field in T\n",
    "J   = 500;                # current density A/m**2\n",
    "d   = 3*10**-3;           # width in m\n",
    "e   = 1.6*10**-19         # charge of electron coulombs\n",
    "\n",
    "#Calculations\n",
    "Ey  = (J*H)/float(Nd*e);      # field in V/m \n",
    "vh  = Ey*d;                   # hall voltage V\n",
    "\n",
    "#Result\n",
    "print'Hall Voltage = %3.1f '%(vh*10**3),'mV';"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.20,Page No:8.46"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Current density = 2304  Ampere/m**2\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "e   = 1.6*10**-19;        # charge of electron in coulomb\n",
    "Rh  = -0.0125;          # hall co-efficient\n",
    "ue  = 0.36;             # electron mobility\n",
    "E   = 80;               # electric field\n",
    "\n",
    "# Calculations\n",
    "n   = -1/float(Rh*e);\n",
    "J   = n*e*ue*E          # current density in Ampere/m**2\n",
    "\n",
    "# Result\n",
    "print'Current density = %d '%J,'Ampere/m**2';\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8.21,Page No:8.46"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hall angle = 1.1740  °\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#variable declaration\n",
    "p   = 0.00893;                # resistivity  in ohm-m  \n",
    "Hz  = 0.5;                    # field in weber/m**2\n",
    "Rh  = 3.66*10**-4;             # hall co-efficient hall coefficient in m**3\n",
    "\n",
    "# Calculations\n",
    "\n",
    "u      = Rh/float(p);                                   #mobility of charge cerrier in m**2*(V**-1)*s**-1\n",
    "theta_h = (math.atan(u*Hz))*(180/float(math.pi));      # hall angle in degrees\n",
    "\n",
    "# Result\n",
    "print'Hall angle = %3.4f '%theta_h,'°';"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}