summaryrefslogtreecommitdiff
path: root/Electronic_Devices_and_Circuits_by_J._Paul/Ch1_1.ipynb
blob: fd90a68719410892f595299fcc7e531496e18b61 (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
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 1 - Semiconductor Physics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 24 example 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "minority concentration   =   2.25e+12 per metre square\n",
      "shift in fermi   =   0.23 volt\n",
      "minority concentration when n doubled   =   9.00e+12 per cubic metre\n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "incaco=1.5*10**16##cubic metre\n",
    "resist=2*10**3##ohm metre\n",
    "dopcon=10**20##metre\n",
    "q=26*10**-3##electron volt\n",
    "#(1)\n",
    "w=2.25*10**32/dopcon#\n",
    "#(3)\n",
    "shifer=q*log(dopcon/incaco)##shift in fermi level\n",
    "ni=9*10**32#\n",
    "#(3)\n",
    "w1=ni/dopcon#\n",
    "print \"minority concentration   =   %0.2e\"%((w)),\"per metre square\"#\n",
    "print \"shift in fermi   =   %0.2f\"%((shifer)),\"volt\"#\n",
    "print \"minority concentration when n doubled   =   %0.2e\"%((w1)),\"per cubic metre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 25 example 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "conductivity   =   7.12e+24 second per metre\n",
      "drift velocity   =   10.44 metre per second\n",
      "density   =   2.14e+28 ampere per cubic metre\n"
     ]
    }
   ],
   "source": [
    "numfre=7.87*10**28##per cubic metre\n",
    "molity=34.8##square centimetre/velocity second\n",
    "e=30##volt per centimetre\n",
    "#(1)\n",
    "molity=molity*10**-4#q=1.6*10**-19#\n",
    "conduc=numfre*q*molity#\n",
    "#(2)\n",
    "e=e*10**2#\n",
    "veloci=(molity*e)#\n",
    "curden=conduc*e#\n",
    "print \"conductivity   =   %0.2e\"%((conduc)),\"second per metre\"#\n",
    "print \"drift velocity   =   %0.2f\"%((veloci)),\"metre per second\"#\n",
    "print \"density   =   %0.2e\"%((curden)),\"ampere per cubic metre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 26 example 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "conductivity   =   0.0224 second per centimetre\n",
      "conductivity at extent of 1 impurity   =   0.30 second per centimetre\n",
      "conductivity  acceptor to extent of 1 impurity   =   1.30 second per centimetre\n"
     ]
    }
   ],
   "source": [
    "ni=2.5*10**13##per square centimetre\n",
    "moe=3800#square centimetre/velocity second\n",
    "mo1=1800##square centimetre/velocity second\n",
    "num=4.51*10**22##number of atoms\n",
    "q=1.6*10**-19#\n",
    "conduc=ni*q*(moe+mo1)#\n",
    "num=num/10**7#\n",
    "impura=(ni**2)/num#\n",
    "ni=5*10**14#\n",
    "condu1=ni*q*moe#\n",
    "print \"conductivity   =   %0.4f\"%((conduc)),\"second per centimetre\"#\n",
    "print \"conductivity at extent of 1 impurity   =   %0.2f\"%((condu1)),\"second per centimetre\"##there is mistake in book as 3.04s/cm\n",
    "conduc=num*q*mo1#\n",
    "print \"conductivity  acceptor to extent of 1 impurity   =   %0.2f\"%((conduc)),\"second per centimetre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 27 example 4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "conductivity intrinisc at 300kelvin   =   4.32e-06 second per centimetre\n",
      "conductivity when donor atom added to extent of 1 impurity   =   0.104 second per centimetre\n",
      "conductivity when acceptor added to extent of 1 impurity   =   0.040 second per centimetre\n"
     ]
    }
   ],
   "source": [
    "ni=1.5*10**10##per cubic centimetre\n",
    "moe=1300##square centimetre/velocity second\n",
    "mo1=500##square centimetre/velocity second\n",
    "w=5*10**22##atoms per cubic centimetre\n",
    "q=1.6*10**-19#\n",
    "#(a) conductivity intrinisc at 300kelvin\n",
    "conduc=ni*q*(moe+mo1)##conductivity\n",
    "u=((ni)/(5*10**14))#\n",
    "ni=5*10**14#\n",
    "#(b)conductivity when donor atom added to extent of 1 impurity\n",
    "condu1=ni*q*moe#\n",
    "print \"conductivity intrinisc at 300kelvin   =   %0.2e\"%((conduc)),\"second per centimetre\"#\n",
    "print \"conductivity when donor atom added to extent of 1 impurity   =   %0.3f\"%((condu1)),\"second per centimetre\"#\n",
    "#conductivity when acceptor added to extent of 1 impurity\n",
    "conduc=ni*q*mo1#\n",
    "print \"conductivity when acceptor added to extent of 1 impurity   =   %0.3f\"%((conduc)),\"second per centimetre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 28 example 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "conductivity intrinisc at 300kelvin   =   0.022 second per centimetre\n",
      "conductivity with donor impurity 1   =   27.36 second per centimetre\n",
      "conductivity with acceptor impurity 1   =   2.88e-09 second per centimetre\n",
      "conductivity on both   =   24.62 second per centimetre\n"
     ]
    }
   ],
   "source": [
    "ni=2.5*10**13##per cubic centimetre\n",
    "moe=3800##square centimetre/velocity second\n",
    "mo1=1800##square centimetre/velocity second\n",
    "w=4.5*10**22##atoms per cubic centimetre\n",
    "q=1.6*10**-19#\n",
    "#(1) conductivity intrinisc at 300kelvin\n",
    "conduc=ni*q*(moe+mo1)#\n",
    "u=10**6#\n",
    "u=((w)/(u))#\n",
    "#(2) conductivity with donor impurity 1\n",
    "condu1=u*q*moe#\n",
    "print \"conductivity intrinisc at 300kelvin   =   %0.3f\"%((conduc)),\"second per centimetre\"#\n",
    "print \"conductivity with donor impurity 1   =   %0.2f\"%((condu1)),\"second per centimetre\"#\n",
    "u=10**7#u=w/u#\n",
    "#(3) conductivity with acceptor impurity 1\n",
    "conduc=u*q*mo1#\n",
    "print \"conductivity with acceptor impurity 1   =   %0.2e\"%((conduc)),\"second per centimetre\"#\n",
    "u=0.9*(w/10**6)#\n",
    "#(4) conductivity on both\n",
    "conduc=u*q*moe#\n",
    "print \"conductivity on both   =   %0.2f\"%((conduc)),\"second per centimetre\"#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 29 example 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "fermi   =   0.33 electron volt\n",
      "fermi below the conduction band\n"
     ]
    }
   ],
   "source": [
    "ferlev=0.3##electron volt\n",
    "u=300##kelvin\n",
    "u1=330##kelvin\n",
    "ferlev=ferlev*u1/u#\n",
    "print \"fermi   =   %0.2f\"%((ferlev)),\"electron volt\"#\n",
    "print \"fermi below the conduction band\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 29 example 7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "fermi   =   0.17 electron volt\n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "ferlev=0.02##electron volt\n",
    "q=4##donor impurity added\n",
    "w=0.025##electron volt\n",
    "ferlev=-((log(q)-8))/40#\n",
    "print \"fermi   =   %0.2f\"%((ferlev)),\"electron volt\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 30 example 8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resistance   =   1570.39 ohm\n"
     ]
    }
   ],
   "source": [
    "from sympy import symbols, solve\n",
    "area=1.5*10**-2##centimetre square\n",
    "w=1.6##centimetre\n",
    "resist=20##ohm centimetre\n",
    "durati=60*10**-6##second in book given as mili\n",
    "quanti=8*10**15##photons per second\n",
    "\n",
    "\n",
    "#(1) resistance at each photon gives a electron hole pair\n",
    "up=1800##centimetre square per velocity second\n",
    "un=3800##centimetre square per velocity second\n",
    "q=1.6*10**-19##coulomb\n",
    "ni=2.5*10**13##per cubic centimetre\n",
    "sigma1=1/resist#\n",
    "z1=3800#\n",
    "z=-sigma1/q#\n",
    "u=ni**2/up#\n",
    "#n=poly([(z1) z u],'n')#\n",
    "n=symbols('n')\n",
    "expr=z1*n**2+z*n+u\n",
    "n=solve(expr,n)[1]\n",
    "n=7.847*10**13##n>ni taken so it is admissible\n",
    "p1=ni**2/n#\n",
    "volume=w*area#\n",
    "nchang=quanti*durati/volume#\n",
    "pchang=nchang#\n",
    "sigm11=q*((n+nchang)*un+(pchang+p1)*up)#\n",
    "resis1=1/sigm11#\n",
    "r1=resis1*w/area#\n",
    "print \"resistance   =   %0.2f\"%((r1)),\"ohm\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 31 example 9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "concentration of electron   =   8660254037.84 per cubic centimetre\n",
      "concentration of holes   =   25980762113.53 per cubic centimetre\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt\n",
    "moe=1350##square centimetre/velocity second\n",
    "mo1=450##square centimetre/velocity second\n",
    "ni=1.5*10**10##per cubic centimetre\n",
    "concn1=ni*((sqrt(mo1/moe)))##concentration\n",
    "concne=((ni**2)/(concn1))\n",
    "\n",
    "print \"concentration of electron   =   %0.2f\"%((concn1)),\"per cubic centimetre\"#\n",
    "print \"concentration of holes   =   %0.2f\"%((concne)),\"per cubic centimetre\"#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 32 example 10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "concentration of hole   =   1.09e+21 per cubic centimetre\n",
      "concentration of electron   =   2.07e+11 per cubic centimetre\n"
     ]
    }
   ],
   "source": [
    "resist=0.12##ohm metre\n",
    "q=1.6*10**-19#\n",
    "concn1=((1/resist)/(0.048*q))##concentration of hole\n",
    "concne=((1.5*10**16)**(2))/concn1##concentration of electron\n",
    "print \"concentration of hole   =   %0.2e\"%((concn1)),\"per cubic centimetre\"#\n",
    "print \"concentration of electron   =   %0.2e\"%((concne)),\"per cubic centimetre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 32 example 11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "concentration of acceptor atoms   =   6.25e+19 per cubic metre\n"
     ]
    }
   ],
   "source": [
    "resist=1*10**3##ohm\n",
    "w=20*10**-6##wide metre\n",
    "w1=400*10**-6##long metre\n",
    "mo1=500##square centimetre/velocity second\n",
    "q=1.6*10**-19#\n",
    "conduc=(resist*w*4*10**-6)/w1#\n",
    "concentration=((1)/(conduc*mo1*q))#\n",
    "print \"concentration of acceptor atoms   =   %0.2e\"%((concentration)),\"per cubic metre\"##correction in the book"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 32 example 12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dn constants   =   98.80 square metre per second\n",
      "dp constants   =   33.80 square metre per second\n"
     ]
    }
   ],
   "source": [
    "w=0.026#\n",
    "moe=3800##square centimetre/velocitysecond\n",
    "mo1=1300##square centimetre/velocitysecond\n",
    "u=(moe*w)#\n",
    "u1=(mo1*w)#\n",
    "print \"dn constants   =   %0.2f\"%((u)),\"square metre per second\"##correction in the book\n",
    "print \"dp constants   =   %0.2f\"%((u1)),\"square metre per second\"##correction in the book"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 33 example 13"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "distance of fermi level from center   =   0.021    electron volt\n"
     ]
    }
   ],
   "source": [
    "from math import log\n",
    "w=0.026*(3/2)*log(3)/2#\n",
    "print \"distance of fermi level from center   =   %0.3f\"%((w)),\"   electron volt\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 33 example 14"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resistivity   =   44.64    ohm centimetre\n",
      "resistivity equal to 45\n",
      "resistivity   =   32.42    ohm centimetre\n",
      "resistivity equal to 32.4\n"
     ]
    }
   ],
   "source": [
    "up=1800##centimetre square per velocity second\n",
    "un=3800##centimetre square per velocity second\n",
    "\n",
    "#(1) resistivity is 45 ohm\n",
    "q=1.6*10**-19##coulomb\n",
    "ni=2.5*10**13#\n",
    "sigma1=(un+up)*q*ni#\n",
    "resist=1/sigma1#\n",
    "print \"resistivity   =   %0.2f\"%((resist)),\"   ohm centimetre\"#\n",
    "print \"resistivity equal to 45\"#\n",
    "#(2) impurity added to extent of 1 atom per 10**9\n",
    "n=4.4*10**22/10**9\n",
    "p1=ni**2/n#\n",
    "sigma1=(n*un+p1*up)*q#\n",
    "resist=1/sigma1\n",
    "print \"resistivity   =   %0.2f\"%((resist)),\"   ohm centimetre\"#\n",
    "print \"resistivity equal to 32.4\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 34 example 15"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "concentration of the a free electrons   =   1.05e+04\n",
      "concentration of the a free holes   =   1.00e+14\n",
      "sample p\n",
      "n   =   1.00e+15 electrons per cubic centimetre\n",
      "p   =   1.10e+15 holes per cubic centimetre\n",
      "essentially intrinsic\n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "from sympy import symbols, solve, exp\n",
    "nd=4*10**14##atoms per cubic centimetre\n",
    "na=5*10**14##atoms per cubic centimetre\n",
    "#(1) concentration\n",
    "ni=2.5*10**13#\n",
    "np=ni**2#\n",
    "#p1=n+10**14\n",
    "z=1#\n",
    "z1=10**14#\n",
    "u=-ni**2#\n",
    "#n=poly([z z1 u],'q')#\n",
    "n=symbols('n')\n",
    "expr = z*n**2+z1*n+u\n",
    "n = solve(expr,n)[1]\n",
    "n=1.05*10**4#\n",
    "print \"concentration of the a free electrons   =   %0.2e\"%((n))\n",
    "p1=n+10**14#\n",
    "print \"concentration of the a free holes   =   %0.2e\"%((p1))\n",
    "#(2)\n",
    "print \"sample p\"#\n",
    "a=ni**2/(300**3*exp(-(0.785/0.026)))#\n",
    "w=400##kelvin\n",
    "ni=sqrt(a*w**3*exp(-0.786/(8.62*10**-5*w)))#\n",
    "ni=((n)*(n+10**14))/10**3#\n",
    "n=ni-0.05*10**15#\n",
    "print \"n   =   %0.2e\"%((n)),\"electrons per cubic centimetre\"\n",
    "p1=n+10**14#\n",
    "print \"p   =   %0.2e\"%((p1)),\"holes per cubic centimetre\"\n",
    "\n",
    "print \"essentially intrinsic\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 35 example 16"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "concentration of n   =   6.00e+08 electrons per cubic centimetre\n",
      "concentration of holes   =   1.04e+18 holes per cubic centimetre\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "w=300##kelvin\n",
    "conduc=300##ohm centimetre inverse\n",
    "u=1800#\n",
    "p=conduc/(u*1.6*10**-19)##concentration holes\n",
    "n=(2.5*10**13)**2/(p)#\n",
    "print \"concentration of n   =   %0.2e\"%((n)),\"electrons per cubic centimetre\"\n",
    "print \"concentration of holes   =   %0.2e\"%((p)),\"holes per cubic centimetre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 35 example 17"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "current density   =   0.17 ampere per square centimetre\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from sympy import symbols, solve\n",
    "nd=10**14##atoms per cubic centimetre\n",
    "na=5*10**13##atoms per cubic centimetre\n",
    "un=3800#\n",
    "up=1800#\n",
    "q=1.6*10**-19##coulomb\n",
    "resist=80##ohm metre\n",
    "e1=5##volt per metre\n",
    "w=nd-na#\n",
    "ni=(un+up)*q*resist#\n",
    "n=symbols('n')\n",
    "#p1=oly([1 w -ni**2],'q')#\n",
    "expr = n**2+w*n-ni**2\n",
    "##p1=taken as 3.65*19**12\n",
    "p1=solve(expr, p1)\n",
    "p1=3.65*10**12#\n",
    "n=p1+w#\n",
    "j=(n*un+p1*up)*q*e1#\n",
    "print \"current density   =   %0.2f\"%((j)),\"ampere per square centimetre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 36 example 18"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resistivity   =   1.25 ohm centimetre\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "na=1*10**16##per cubic centimetre            correction in the book\n",
    "ni=1.48*10**10##per cubic centimetre\n",
    "un=0.13*10**4##centimetre square per velocity second\n",
    "u=0.05*10**4##centimetre square per velocity second\n",
    "n=ni**2/na#\n",
    "q=1/(1.6*10**-19*(un*n+(u*na)))#\n",
    "print \"resistivity   =   %0.2f\"%((q)),\"ohm centimetre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 37 example 19"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "voltage across sample   =   9.38 volt\n",
      "drift velocity   =   37.50 metre per second\n",
      "transverse force per  coulomb   =   1.88 newton per coulomb\n",
      "transverse electric field   =   1.88 volt per metre\n",
      "hall voltage   =   0.02 volt\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "e1=750##volt per metre\n",
    "b=0.05##metre square per velocity second\n",
    "un=0.05##metre square per velocity second\n",
    "up=0.14##metre square per velocity second\n",
    "#(1) voltage\n",
    "w=1.25*10**-2##metre\n",
    "v1=e1*w#\n",
    "print \"voltage across sample   =   %0.2f\"%((v1)),\"volt\"#\n",
    "#(2) drift velocity\n",
    "vd=un*e1#\n",
    "print \"drift velocity   =   %0.2f\"%((vd)),\"metre per second\"#\n",
    "#transverse force per  coulomb\n",
    "f1=vd*b#\n",
    "print \"transverse force per  coulomb   =   %0.2f\"%((f1)),\"newton per coulomb\"#\n",
    "#(4) transverse electric field\n",
    "e1=vd*b#\n",
    "print \"transverse electric field   =   %0.2f\"%((e1)),\"volt per metre\"#\n",
    "#(5) hall voltage\n",
    "q=0.9*10**-2#\n",
    "vh=e1*q\n",
    "print \"hall voltage   =   %0.2f\"%((vh)),\"volt\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 37 example 20"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resistivity at 300kelvin   =   2.31e+05 ohm centimetre\n",
      "resistivity at impurity of 1 atom included per 10**5 atoms   =   0.010 ohm centimetre\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "un=1300##centimetre square per velocity second\n",
    "#at 300kelvin\n",
    "ni=1.5*10**10#\n",
    "u=500##centimetre square per velocity second\n",
    "conduc=1.6*10**-19*1.5*10**10*(un+u)#\n",
    "q=1/conduc#\n",
    "#impurity of 1 atom included per 10**5 atoms\n",
    "print \"resistivity at 300kelvin   =   %0.2e\"%((q)),\"ohm centimetre\"#\n",
    "n=5*10**22/10**5#\n",
    "p=ni**2/n#\n",
    "q=1/(1.6*10**-19*(un*n+(u*p)))\n",
    "\n",
    "print \"resistivity at impurity of 1 atom included per 10**5 atoms   =   %0.3f\"%((q)),\"ohm centimetre\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 38 example 21"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ec-ef   =   -0.20\n",
      "ec-ef   =   0.04 electron volt   ef above ec\n",
      "impurities included per germanium atoms   =   0.0002\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, log, log10\n",
    "n=4.4*10**22#\n",
    "nd=n/10**7#\n",
    "w=300##kelvin\n",
    "nc=4.82*10**15*w**(3/2)/1/sqrt(8)#\n",
    "ec_ef1=-0.026*log((nc/(nd)))#\n",
    "print \"ec-ef   =   %0.2f\"%((ec_ef1))\n",
    "#(2) impurities included inratio 1 to 10**3\n",
    "n=4.4*10**22#\n",
    "nd=n/(10**3)#\n",
    "ec_ef1=-0.026*log(nc/nd)#\n",
    "print \"ec-ef   =   %0.2f\"%((ec_ef1)),\"electron volt   ef above ec\"#\n",
    "q=log10(nd/nc)/log10(10)#\n",
    "print \"impurities included per germanium atoms   =   0.0002\"#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 39 example 22"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ef-ec   =   0.15 electron volt\n",
      "ef-ec   =   0.03 electron volt\n",
      "temperature   =   240.33 kelvin\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import log\n",
    "n=5*10**22##atoms per cubic centimetre\n",
    "#(1) 1 atom per 10**6\n",
    "m=0.8##metre\n",
    "na=n/10**6#\n",
    "w=300##kelvin\n",
    "nv=4.82*10**15*(m)**(3/2)*w**(3/2)#\n",
    "ef_ec=0.026*log(nv/na)#\n",
    "print \"ef-ec   =   %0.2f\"%((ef_ec)),\"electron volt\"#\n",
    "#(2) impurity included 10*10**3 per atom\n",
    "na=n/(10*10**3)#\n",
    "ef_ec=0.026*log(nv/na)#\n",
    "print \"ef-ec   =   %0.2f\"%((ef_ec)),\"electron volt\"#\n",
    "#(3) condition to concide ec=ef\n",
    "na=4.81*10**15#\n",
    "w=(nv/na)**(2/3)#\n",
    "print \"temperature   =   %0.2f\"%((w)),\"kelvin\"##correction in the book"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 40 example 23 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hall voltage   =   0.17 volt\n",
      "remains the same but there change in polarity\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "#figure is not given in the book\n",
    "nd=10**7##per cubic centimetre\n",
    "na=10**17##per cubic centimetre\n",
    "voltag=0.1*3800*10**-4*1500*3*10**-3#\n",
    "print \"hall voltage   =   %0.2f\"%((voltag)),\"volt\"#\n",
    "print \"remains the same but there change in polarity\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## PageNumber 40 example 24"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mobilty   =   0.12 metre square per velocity second\n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "vh=60*10**-3##volt\n",
    "w=6*10**-3##metre\n",
    "bz=0.1##weber per metre square\n",
    "i1=10*10**-6##ampere\n",
    "resist=300000*10**-2##ohm metre\n",
    "#(1)\n",
    "#mobility\n",
    "rh=vh*w/(bz*i1)#\n",
    "u1=rh/resist#\n",
    "print \"mobilty   =   %0.2f\"%((u1)),\"metre square per velocity second\""
   ]
  }
 ],
 "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.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}