Bipolar Junction Transistor - Summary

ECE 4339
Han Q. Le (copyrighted) U. of Houston

Calculation package

Start package

Please excute the below to get start

Manipulate[
If[ONOFF==1,
NDOS0[SemiParm_]:= Module[{ Eg, me, gc, mh,ϵ},
{ Eg, me, gc, mh,ϵ}=SemiParm ;
4.829415887919019`*^15  {gc  (me^(3/2)) , (mh^(3/2))} 
];
FermiLevel[Dopant_,T_,SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, NC0,NV0,type, DopeDensity, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{NC0,NV0}= NDOS0[SemiParm] ;
{type, DopeDensity}=Dopant ;
If[type>0  , 
kB T Log[DopeDensity/(NC0 (T^(3/2)))] 
,-kB T Log[DopeDensity/(NV0 (T^(3/2))) ] ]
] ;
DepletionW[T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
,Dopant1, Dopant2,
ContactV, V0, W,
,aB=5.29177*10^(-9)
,Ryd=13.6057},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{Dopant1, Dopant2}=JuncDopant ;
ContactV=Eg+Sign[Dopant1[[1]] ]*FermiLevel[Dopant1,T,SemiParm]+Sign[Dopant2[[1]] ]*FermiLevel[Dopant2,T,SemiParm] ;
V0=ContactV-Vbias ;
W=Sqrt[(ϵ V0/(aB  Ryd))* (1/Dopant1[[2]] +1/Dopant2[[2]]) ]  ;
10^4* W {1, Dopant2[[2]]/(Dopant1[[2]] +Dopant2[[2]])
,Dopant1[[2]]/(Dopant1[[2]] +Dopant2[[2]])  }] ;
ϕJ[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
]
] ;
BandDiagram[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W,w, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

FermiLine[x_, T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
If[x≥- x1,-Sign[JuncDopant[[1,1]] ]*Vbias,  ]
];
CarrierEqui[x_, T_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ 
,NC0,NV0, F
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{NC0,NV0}= NDOS0[SemiParm] ;
F=BandDiagram[x, T,0.,JuncDopant, SemiParm] ;
If[JuncDopant[[1,1]]>0, 
{NC0 (T^(3/2)) (E^(-F[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[2]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[1]]/(kB T)))} 
, {NC0 (T^(3/2)) (E^(-F[[1]]/(kB T))), NV0 (T^(3/2)) (E^(F[[2]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[1]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[2]]/(kB T)))}
]
];
CarrierJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]≥ 0., NV0 (T^(3/2.)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2.)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]≥ 0., NC0 (T^(3/2.)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2.)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]≥ 0.,
If[x≤ -x1, q1 G  (E^((x+x1)/Lp)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Ln)), ]
]
, If[x≤ -x1, q1 G  (E^((x+x1)/Ln)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Lp)), ]
]
]
]  ;
DiffJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
1.602176487`*^-23*If[JuncDopant[[1,1]]>0,
If[x≤ -x1,Lp q1 G  (E^((x+x1)/Lp))/τ,
If [x≥ x2,Ln q2 G  (E^(-(x-x2)/Ln))/τ, ]
]
, If[x≤ -x1,Ln q1 G  (E^((x+x1)/Ln))/τ,
If [x≥ x2,Lp q2 G  (E^(-(x-x2)/Lp))/τ, ]
]
]
]  ;
DiodeC[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
1.602176487`*^-23*If[JuncDopant[[1,1]]>0,
( Lp q1 +Ln q2 ) G  /τ ,( Ln q1 +Lp q2 ) G /τ]
]  ;
DiodeC1[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2,ContactV,Ef1,Ef2
,q1,q2,F1,F2,G,r1,r2,H
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
Ef1=  FermiLevel[JuncDopant[[1]],T,SemiParm];
Ef2=  FermiLevel[JuncDopant[[2]],T,SemiParm];
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
r1=  If[JuncDopant[[1,1]]>0,(mh/me)^3/2  *Exp[(F1[[1]]+F1[[2]])/(kB T)] , (me/mh)^3/2  *Exp[-(F1[[1]]+F1[[2]])/(kB T)] ] ;
r2=   If[JuncDopant[[1,1]]>0,(me/mh)^3/2  *Exp[-(F2[[1]]+F2[[2]])/(kB T)] , (mh/me)^3/2  *Exp[(F2[[1]]+F2[[2]])/(kB T)] ] ;
G=Exp[Vbias/(kB T)]-1; H=1-Exp[-2(ContactV-Vbias)/(kB T)] ;
1.602176487`*^-23*If[JuncDopant[[1,1]]>0,
( Lp q1 (1+r1 (G+1)) +Ln q2  (1+ r2 (G+1))) G  /(τ H)
,( Ln q1 (1+r1 (G+1)) +Lp q2 (1+ r2 (G+1)) ) G /(τ H)]
];
BandDiagramBJT[x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2, },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;
BandDiagramMODFET[y_,x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2, },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;
 ONOFF=0, ];
,
{{ONOFF,1,"Click to start"},{0,1}} ]

Modules for illustration

SemiParm={ Eg, me, gc, mh, ϵ} ;
NDOS0[SemiParm_]:= Module[{ Eg, me, gc, mh,ϵ},
{ Eg, me, gc, mh,ϵ}=SemiParm ;
4.829415887919019`*^15  {gc  (me^(3/2)) , (mh^(3/2))} 
];
FermiLevel[Dopant_,T_,SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, NC0,NV0,type, DopeDensity, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{NC0,NV0}= NDOS0[SemiParm] ;
{type, DopeDensity}=Dopant ;
If[type>0  , 
kB T Log[DopeDensity/(NC0 (T^(3/2)))] 
,-kB T Log[DopeDensity/(NV0 (T^(3/2))) ] ]
] ;

DepletionW[T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
,Dopant1, Dopant2,
ContactV, V0, W,
,aB=5.29177*10^(-9)
,Ryd=13.6057},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{Dopant1, Dopant2}=JuncDopant ;
ContactV=Eg+Sign[Dopant1[[1]] ]*FermiLevel[Dopant1,T,SemiParm]+Sign[Dopant2[[1]] ]*FermiLevel[Dopant2,T,SemiParm] ;
V0=ContactV-Vbias ;
W=Sqrt[(ϵ V0/(aB  Ryd))* (1/Dopant1[[2]] +1/Dopant2[[2]]) ]  ;
10^4* W {1, Dopant2[[2]]/(Dopant1[[2]] +Dopant2[[2]])
,Dopant1[[2]]/(Dopant1[[2]] +Dopant2[[2]])  }] ;

ϕJ[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
]
] ;
BandDiagram[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

FermiLine[x_, T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
If[x≥- x1,-Sign[JuncDopant[[1,1]] ]*Vbias,  ]
];

CarrierEqui[x_, T_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ 
,NC0,NV0, F
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{NC0,NV0}= NDOS0[SemiParm] ;
F=BandDiagram[x, T,0.,JuncDopant, SemiParm] ;
If[JuncDopant[[1,1]]>0, 
{NC0 (T^(3/2)) (E^(-F[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[2]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[1]]/(kB T)))} 
, {NC0 (T^(3/2)) (E^(-F[[1]]/(kB T))), NV0 (T^(3/2)) (E^(F[[2]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[1]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[2]]/(kB T)))}
]
]

CarrierJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ}=DiffParm  ;
Ln=10^4*Sqrt[μn kB T τ]; Lp=10^4*Sqrt[μp kB T τ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1, q1 G  (E^((x+x1)/Lp)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Ln)), ]
]
, If[x≤ -x1, q1 G  (E^((x+x1)/Ln)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Lp)), ]
]
]
]  ;

DiffJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp ,
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ}=DiffParm  ;
Dn=10^4*Sqrt[μn kB T τ]; Lp=10^4*Sqrt[μp kB T τ];
Ln=10^4*Sqrt[μn kB T τ]; Lp=10^4*Sqrt[μp kB T τ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,Lp q1 G  (E^((x+x1)/Lp))/τ,
If [x≥ x2,Ln q2 G  (E^(-(x-x2)/Ln))/τ, ]
]
, If[x≤ -x1,Ln q1 G  (E^((x+x1)/Ln))/τ,
If [x≥ x2,Lp q2 G  (E^(-(x-x2)/Lp))/τ, ]
]
]
]  ;

DiodeC[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp ,
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ}=DiffParm  ;
Ln=10^4*Sqrt[μn kB T τ]; Lp=10^4*Sqrt[μp kB T τ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
1.602176487`*^-19*If[JuncDopant[[1,1]]>0,
( Lp q1 +Ln q2 ) G  /τ ,( Ln q1 +Lp q2 ) G /τ]
]  ;

DiodeC1[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp ,
,NC0,NV0
, W, x1,x2,ContactV,Ef1,Ef2
,q1,q2,F1,F2,G,r1,r2,H
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ}=DiffParm  ;
Ln=10^4*Sqrt[μn kB T τ]; Lp=10^4*Sqrt[μp kB T τ];
{NC0,NV0}= NDOS0[SemiParm] ;
Ef1=  FermiLevel[JuncDopant[[1]],T,SemiParm];
Ef2=  FermiLevel[JuncDopant[[2]],T,SemiParm];
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
r1=  If[JuncDopant[[1,1]]>0,(mh/me)^3/2  *Exp[(F1[[1]]+F1[[2]])/(kB T)] , (me/mh)^3/2  *Exp[-(F1[[1]]+F1[[2]])/(kB T)] ] ;
r2=   If[JuncDopant[[1,1]]>0,(me/mh)^3/2  *Exp[-(F2[[1]]+F2[[2]])/(kB T)] , (mh/me)^3/2  *Exp[(F2[[1]]+F2[[2]])/(kB T)] ] ;
G=Exp[Vbias/(kB T)]-1; H=1-Exp[-2(ContactV-Vbias)/(kB T)] ;
1.602176487`*^-19*If[JuncDopant[[1,1]]>0,
( Lp q1 (1+r1 (G+1)) +Ln q2  (1+ r2 (G+1))) G  /(τ H)
,( Ln q1 (1+r1 (G+1)) +Lp q2 (1+ r2 (G+1)) ) G /(τ H)]
]  ;

BandDiagramBJT[x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2, },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

BandDiagramMODFET[y_,x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2, },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

Application

0. Overview and Summary

In the following, we will see illustration calculation for the following key aspects of the BJT:
a- Behavior of majority carrier in the base - in this example, holes.
b- The effect of long base (carriers die off) vs. short base (carriers transferred to collector)
c- Minority carriers in the emitter (in this case, electrons): the important of long emitter vs. short emitter.
d- Effects of asymmetric doping: heavy for emitter and light (relatively) for base.
e- Overall carrier behavior and currents
f- The I-V curve of BJT

In the follow, we will consider pnp structure. And we will consider only steady state (no explicit time-dependence).

1. Basic structure

Band structure with bias

Manipulate[
If[start==1,
NDOS0[SemiParm_]:= Module[{ Eg, me, gc, mh,ϵ},
{ Eg, me, gc, mh,ϵ}=SemiParm ;
4.829415887919019`*^15  {gc  (me^(3/2)) , (mh^(3/2))} 
];
FermiLevel[Dopant_,T_,SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, NC0,NV0,type, DopeDensity, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{NC0,NV0}= NDOS0[SemiParm] ;
{type, DopeDensity}=Dopant ;
If[type>0  , 
kB T Log[DopeDensity/(NC0 (T^(3/2)))] 
,-kB T Log[DopeDensity/(NV0 (T^(3/2))) ] ]
] ;
DepletionW[T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
,Dopant1, Dopant2,
ContactV, V0, W,
,aB=5.29177*10^(-9)
,Ryd=13.6057},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{Dopant1, Dopant2}=JuncDopant ;
ContactV=Eg+Sign[Dopant1[[1]] ]*FermiLevel[Dopant1,T,SemiParm]+Sign[Dopant2[[1]] ]*FermiLevel[Dopant2,T,SemiParm] ;
V0=ContactV-Vbias ;
W=Sqrt[(ϵ V0/(aB  Ryd))* (1/Dopant1[[2]] +1/Dopant2[[2]]) ]  ;
10^4* W {1, Dopant2[[2]]/(Dopant1[[2]] +Dopant2[[2]])
,Dopant1[[2]]/(Dopant1[[2]] +Dopant2[[2]])  }] ;
ϕJ[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
]
] ;
BandDiagram[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W,w, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

FermiLine[x_, T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
If[x≥- x1,-Sign[JuncDopant[[1,1]] ]*Vbias,  ]
];
CarrierEqui[x_, T_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ 
,NC0,NV0, F
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{NC0,NV0}= NDOS0[SemiParm] ;
F=BandDiagram[x, T,0.,JuncDopant, SemiParm] ;
If[JuncDopant[[1,1]]>0, 
{NC0 (T^(3/2)) (E^(-F[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[2]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[1]]/(kB T)))} 
, {NC0 (T^(3/2)) (E^(-F[[1]]/(kB T))), NV0 (T^(3/2)) (E^(F[[2]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[1]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[2]]/(kB T)))}
]
];
CarrierJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]≥ 0., NV0 (T^(3/2.)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2.)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]≥ 0., NC0 (T^(3/2.)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2.)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]≥ 0.,
If[x≤ -x1, q1 G  (E^((x+x1)/Lp)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Ln)), ]
]
, If[x≤ -x1, q1 G  (E^((x+x1)/Ln)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Lp)), ]
]
]
]  ;
DiffJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,Lp q1 G  (E^((x+x1)/Lp))/τ,
If [x≥ x2,Ln q2 G  (E^(-(x-x2)/Ln))/τ, ]
]
, If[x≤ -x1,Ln q1 G  (E^((x+x1)/Ln))/τ,
If [x≥ x2,Lp q2 G  (E^(-(x-x2)/Lp))/τ, ]
]
]
]  ;
DiodeC[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
1.602176487`*^-19*If[JuncDopant[[1,1]]>0,
( Lp q1 +Ln q2 ) G  /τ ,( Ln q1 +Lp q2 ) G /τ]
]  ;
DiodeC1[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2,ContactV,Ef1,Ef2
,q1,q2,F1,F2,G,r1,r2,H
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
Ef1=  FermiLevel[JuncDopant[[1]],T,SemiParm];
Ef2=  FermiLevel[JuncDopant[[2]],T,SemiParm];
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
r1=  If[JuncDopant[[1,1]]>0,(mh/me)^3/2  *Exp[(F1[[1]]+F1[[2]])/(kB T)] , (me/mh)^3/2  *Exp[-(F1[[1]]+F1[[2]])/(kB T)] ] ;
r2=   If[JuncDopant[[1,1]]>0,(me/mh)^3/2  *Exp[-(F2[[1]]+F2[[2]])/(kB T)] , (mh/me)^3/2  *Exp[(F2[[1]]+F2[[2]])/(kB T)] ] ;
G=Exp[Vbias/(kB T)]-1; H=1-Exp[-2(ContactV-Vbias)/(kB T)] ;
1.602176487`*^-19*If[JuncDopant[[1,1]]>0,
( Lp q1 (1+r1 (G+1)) +Ln q2  (1+ r2 (G+1))) G  /(τ H)
,( Ln q1 (1+r1 (G+1)) +Lp q2 (1+ r2 (G+1)) ) G /(τ H)]
];
BandDiagramBJT[x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2,w },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
If[ JuncDopant[[1,1]] ==-1,
w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{Sign[JuncDopant[[2,1]] ]*Eg,0.}
 ,w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{0.,Sign[JuncDopant[[2,1]] ]*Eg}]
] ;
 start=0, ];
Manipulate[
If[ONOFF=="ON",
Manipulate[
SemiParm={ Eg, me,gc, mh,ϵ } ;   
Manipulate[
dtype=If[dope=="p-n-p",-1,1] ;
ContactVEB=Eg+dtype*FermiLevel[{dtype,10^d1},T,SemiParm]-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm] ;
ContactVBC=Eg-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm]+dtype*FermiLevel[{-dtype,10^d3},T,SemiParm] ; 
JuncDopant={ {dtype,10^d1},{-dtype,10^d2} ,{dtype,10^d3}};
VEBL=Min[VEBf,ContactVEB] ;Plot[{BandDiagramBJT[x, T,dbase,{VEBL,VECr+VEBL},JuncDopant, SemiParm][[1]]
,BandDiagramBJT[x, T,dbase,{VEBL,VECr+VEBL},JuncDopant, SemiParm][[2]]}
,{x,xL,dbase+xR}, PlotRange-> {All,{1.2*dtype*Eg,-dtype*5}}, PlotStyle->{{ Thick,Hue[0.35,1,0.7]},{Thick,Purple}}
,Filling-> {{1-> {Top,Hue[0.25,1,1,0.3]}}
 ,{2-> {Bottom,Hue[0.85,1,1,0.3]}} }
,Frame-> True, GridLines-> Automatic
,FrameLabel->{"Position (μm)","Energy (eV)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]]
,
{{dope,"p-n-p"},{"p-n-p","n-p-n"}},{{d1,18.5,"Emitter doping ^10"},17,19},{{d2,16,"Base doping ^10"},14,17}
,{{d3,17,"Collector doping ^10"},16,18}
,{{T,300,"Temperature (K)"},100,400}
,{{dbase,5,"Base length (μm)"},4,50}
,{{xR,2," xR range (μm)"},0.1,20},{{xL,-2," xL range (μm)"},-20,-0.1}
,{{VEBf,0},0,1},{{VECr,0},-5,0}]
,Grid[{{ Control[{{Eg,1.1,"Bandgap (eV)"},0.3,4}]
,Control[{{ϵ,11.8,"Dielectric const."},4,20}]}
,{Control[{{me,0.33,"Elec eff mass me*"},0.02,0.5}]
,Control[{{mh,0.81,"Hole eff mass mh*"},0.02,1}]}
,{Control[{{gc,6,"Cond band degeneracy"},{1,6}}]}
}]
], ]
,{{ONOFF,"ON","Click OFF if not used"},{"ON","OFF"}}
],
{{start,1,"Click to start"},{0,1}} ]

2. Hole distribution and diffusion current in the base (PNP)

2.1 Discussion

To find the distribution of holes in the base, we solve the DE for excess carriers in the base.

Mathematical details

First, we set up to solve the differential equation

DSolve[p''[x] == p[x]/((Subscript[L, Bh])^2),p[x],x]

One difference from previous exercises we did with p-n junction diode is that we treated each side of the diode as infinite. Here we notice is that this is a finite section, hence we keep both terms.

Next, we set up the boundary condition.
At x=0: left side of the base (start from the E-B depletion boundary), the excess hole concentration has to be the excess carriers (see Chapter 5, section 3.2):
                (Subscript[p, 1])=(Subscript[p, Bo]) ((e^(q (Subscript[V, EB])/(Subscript[k, B])T))-1) 
At x=(Subscript[W, B]): right side of the base (at the C-B depletion boundary), the excess hole concentration has to be the excess carriers:
                (Subscript[p, 2])=(Subscript[p, Bo]) ((e^(q (Subscript[V, CB])/(Subscript[k, B])T))-1)
 Applying boundary condition:

(E^(-(x/(Subscript[L, Bh])))) (Subscript[c, 1])+(E^(x/(Subscript[L, Bh]))) (Subscript[c, 2]) /. x-> 0

(E^(-(x/(Subscript[L, Bh])))) (Subscript[c, 1])+(E^(x/(Subscript[L, Bh]))) (Subscript[c, 2])  /. x-> (Subscript[W, B])

Solve[ {(Subscript[p, 1])== (Subscript[c, 1])+(Subscript[c, 2]) , (Subscript[p, 2])== (E^(-((Subscript[W, B])/(Subscript[L, Bh])))) (Subscript[c, 1])+(E^((Subscript[W, B])/(Subscript[L, Bh]))) (Subscript[c, 2]) }, {(Subscript[c, 1]),(Subscript[c, 2])}]

We now substitute the coefficients into the solution:

(E^(-(x/(Subscript[L, Bh])))) (Subscript[c, 1])+(E^(x/(Subscript[L, Bh]))) (Subscript[c, 2]) /. (Subscript[c, 1])->(Subscript[p, 1])-(((E^((Subscript[W, B])/(Subscript[L, Bh]))) (Subscript[p, 2])-(Subscript[p, 1]))/(-1+(E^((2 (Subscript[W, B]))/(Subscript[L, Bh])))))  /. (Subscript[c, 2])->(((E^((Subscript[W, B])/(Subscript[L, Bh]))) (Subscript[p, 2])-(Subscript[p, 1]))/(-1+(E^((2 (Subscript[W, B]))/(Subscript[L, Bh])))))

FullSimplify[(((E^(x/(Subscript[L, Bh]))) ((E^((Subscript[W, B])/(Subscript[L, Bh]))) (Subscript[p, 2])-(Subscript[p, 1])))/(-1+(E^((2 (Subscript[W, B]))/(Subscript[L, Bh])))))+(E^(-(x/(Subscript[L, Bh])))) ((Subscript[p, 1])-(((E^((Subscript[W, B])/(Subscript[L, Bh]))) (Subscript[p, 2])-(Subscript[p, 1]))/(-1+(E^((2 (Subscript[W, B]))/(Subscript[L, Bh]))))))]

Or we can write: The excess hole concentration in the base is:  
(Subscript[p, e])[x]=(Subscript[p, 1]) ((sinh((((Subscript[W, B])-x)/(Subscript[L, Bh]))))/(sinh(((Subscript[W, B])/(Subscript[L, Bh]))))) +(Subscript[p, 2]) ((sinh((x/(Subscript[L, Bh]))))/(sinh(((Subscript[W, B])/(Subscript[L, Bh])))))

Full expression:

(Subscript[p, e])[x]=(Subscript[p, Bo]) (((e^(q (Subscript[V, EB])/(Subscript[k, B])T))-1) ((sinh((((Subscript[W, B])-x)/(Subscript[L, Bh]))))/(sinh(((Subscript[W, B])/(Subscript[L, Bh]))))) +((e^(q (Subscript[V, CB])/(Subscript[k, B])T))-1) ((sinh((x/(Subscript[L, Bh]))))/(sinh(((Subscript[W, B])/(Subscript[L, Bh]))))))

2.2 Hole distribution in base

The following is a function of the hole distribution in the base

peBase[x_,W_,L_,p1_,p2_]:=p1  ((Sinh[(W-x)/L])/(Sinh[W/L]))+p2 ((Sinh[x/L])/(Sinh[W/L])) ;

Plot the hole distribution in base

Manipulate[ kB=  8.61739*10^(-5);
p1=((E^( VEBf/(kB T)))-1) ;p2=((E^((VECr+ VEBf)/(kB T)))-1) ; 
{Plot[p1  ((Sinh[(W-x)/L])/(Sinh[W/L]))+p2 ((Sinh[x/L])/(Sinh[W/L]))  ,{x,0.,W} , PlotRange->All
,Frame-> True, GridLines-> Automatic
,PlotStyle->{Thick,Hue[0.6,1,1]}
, Filling->{{1-> {Axis,Hue[0.55,1,1,0.6]}}}
,FrameLabel->{"Position along Base (μm)","Carrier density (rel. unit)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]]
,LogPlot[p1  ((Sinh[(W-x)/L])/(Sinh[W/L]))+p2 ((Sinh[x/L])/(Sinh[W/L]))  ,{x,0.,W} , PlotRange->All
,Frame-> True, GridLines-> Automatic
,PlotStyle->{Thick,Blue}
, Filling->{{1-> {Bottom,Hue[0.55,1,1,0.6]}}}
,FrameLabel->{"Position along Base (μm)","Carrier density (rel. unit)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]]}
,{{W,10,"Base length (non-depl)(μm)"},1,25}
,{{L,1,"Diffusion length (μm)"},0.5,100}
,{{T,300,"Temperature (K)"},100,400}
,{{VEBf,0.25,"EB forward voltage (V)"},0.,0.5}
,{{VECr,-1,"EC voltage (V)"},-5,0}
]

The above calculation is an approximation that ignores the variation of the depletion regions in the base as a function of the the bias voltages. But it is useful and illustrative.

Exercise: plot hole distribution in base as a function of increasing emitter-base bias (forward). Use Si parameters to calculate

Eg=1.1 ;
me= 0.33 ; gc=6;
mh=0.81; eps0=11.8 ;
Nd1=5*10^20; Na=5*10^(18); Nd2=2*10^(17) ;

Exercise: Comparing long base vs short base relative to diffusion length (Vice versa, long vs. short (Subscript[L, D]) ). Discuss

2.3 Diffusion current

2.3.1 Holes diffusing current from emitter to base

It is given by: (note the sign - here q is positive for holes)

But we already know the hole distribution in the base

peBase[x_,W_,L_,p1_,p2_]:=p1  ((Sinh[(W-x)/L])/(Sinh[W/L]))+p2 ((Sinh[x/L])/(Sinh[W/L])) ;

Taking the derivative:

(∂_x)(peBase[x,W,L,p1,p2] )

At the emitter-base junction, x=0

((p2 csch((W/L)) cosh((x/L)))/L)-((p1 csch((W/L)) cosh(((W-x)/L)))/L) /. x-> 0

Therefore, the emitter to base hole diffusion current is:
- q A DBp (((p2 csch((W/L)))/L)-((p1 coth((W/L)))/L)) 
or: 
 (Subscript[I, E;p])=q A (Subscript[D, B;p]) (((p1 coth((W/L)))/L)-((p2 csch((W/L)))/L))

Clear[DBp]

We can substitute DBp τ=(L^2) 
(q/τ) A L  (p1 coth((W/L))-p2 csch((W/L)))

IEp[W_,L_,τ_,p1_,p2_]:= (q/τ)  L (p1 Coth[((W/L))]-p2 Csch[((W/L))]  )

For a full expression:
(Subscript[I, E;p])=(q/(Subscript[τ, B;p]))  (Subscript[L, B;p]) A (Subscript[p, Bo ]) (((e^(q (Subscript[V, EB])/(Subscript[k, B])T))-1)  Coth[((W/(Subscript[L, B;p])))]-((e^(q (Subscript[V, CB])/(Subscript[k, B])T))-1) Csch[((W/(Subscript[L, B;p])))])

2.3.2 Limiting case: very large base: decoupled diode

Let’s check if this gives the known answer if the base length is infinite.

ClearAll[p1,T, L];
Limit[ q A DBp (((p1 coth(W))/L)-((p2 csch(W))/L)) , W-> ∞]

(( A DBp p1 q)/L) /. p1-> (Subscript[p, Bo]) ((E^(q (Subscript[V, EB])/(Subscript[k, B])T))-1)

This is the (ideal) equation of diode: in other words, if the baselength is infinite, the emitter-base current is essentially the ideal diode current. This confirms we have the correct limit.

2.3.3 Current of holes diffusing from base to collector

Now, let’s check the hole diffusion current from base to collector.

The current is: (q is positive for holes)

(∂_x)peBase[x,W,L,p1,p2]  /. x->W

((p2 coth((W/L)))/L)-((p1 csch((W/L)))/L)

Hence: ICp=-q A DBp (((p2 coth((W/L)))/L)-((p1 csch((W/L)))/L))
or, we can substitute DBp τ=(L^2) 
 (q/τ) A L  (p1 csch((W/L))-p2 coth((W/L)))

ICp[W_,L_,τ_,p1_,p2_]:= (q/τ) A L (p1 Csch[((W/L))]-p2 Coth[((W/L))] )

For a full expression:
(Subscript[I, C;p])=(q/(Subscript[τ, B;p]))  (Subscript[L, B;p]) A (Subscript[p, Bo ]) (((e^(q (Subscript[V, EB])/(Subscript[k, B])T))-1)  Csch[((W/(Subscript[L, B;p])))]-((e^(q (Subscript[V, CB])/(Subscript[k, B])T))-1) Coth[((W/(Subscript[L, B;p])))])

2.3.4 Limiting case: very large base - decoupled diode - Base-Collector current

Limit[-q A DBp (((p2 coth(r))/L)-((p1 csch(r))/L)), r->∞]

VCB=  .;
((A DBp p2 q)/L) /. p2 -> ( (E^(q VCB/((Subscript[k, B])  T))) -1)

Again,  if the baselength is infinite, the base-collector current is essentially the diode current also, just as expected.

2.3.5 Holes diffusion current in Base

Let's take a look at emitter-base hole current (blue) and the base-collector current (red) as a function of base length for different emitter-base voltage:

Plot the hole diffusion current in Base

Manipulate[ kB=  8.61739*10^(-5);
p1=((E^( VEBf/(kB T)))-1) ;p2=((E^((VECr+ VEBf)/(kB T)))-1) ;
currentplot= Plot[{  L (p1 Coth[(x/L)]-p2 Csch[(x/L)])
, L (p1 Csch[(x/L)]-p2 Coth[(x/L)])} ,{x,1.,10} , PlotRange->All
,Frame-> True, GridLines-> Automatic
,PlotStyle->{{Thick,Blue},{Thick,Hue[0.5,1,0.6]}}
, Filling->{{1-> {Axis,Hue[0.55,1,1,0.2]}}
,{2-> {Axis,Hue[0.5,1,1,0.4]}}}
,FrameLabel->{"Base Length (μm)","Diffusing current (rel. unit)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]];
Manipulate[
{Show[
Graphics[{Blue,Thickness[0.02],Arrowheads[0.1]
, Arrow[{{0,0},{W/2,0}}],Arrow[{{W,0},{W+(0.5 W)(( (p1 Csch[(W/L)]-p2 Coth[(W/L)]))/((p1 Coth[(W/L)]-p2 Csch[(W/L)]))),0}}]
,Hue[0.55,1,1,0.5],Rectangle[{0,-1},{0.25W,1}]
,Rectangle[{W,-(( (p1 Csch[(W/L)]-p2 Coth[(W/L)]))/((p1 Coth[(W/L)]-p2 Csch[(W/L)])))},{1.25 W,(( (p1 Csch[(W/L)]-p2 Coth[(W/L)]))/((p1 Coth[(W/L)]-p2 Csch[(W/L)])))}]

},AspectRatio->0.67]
,PlotRange-> {{0,1.5W},{-1,1}} ]
,Show[currentplot, Graphics[{Red,PointSize[0.03],Point[{W,  L (p1 Coth[(W/L)]-p2 Csch[(W/L)])}]
,Point[{W,  L (p1 Csch[(W/L)]-p2 Coth[(W/L)])}]} ]]}
,{{W,10,"Base length (μm)"},1,25}
]
,{{L,1,"Diffusion length (μm)"},0.5,100}
,{{T,300,"Temperature (K)"},100,400}
,{{VEBf,0.25,"EB forward voltage (V)"},0.,0.5}
,{{VECr,-1,"EC voltage (V)"},-5,0}]

Exercise discussion: What do those graphs tell us?

As the base is turned on, there are a lot of holes going from emitter to base, but if the base is large, very few of them make their way to the collector. If the base is short, we see more emitter-based current is transfered to base-collector current
We see how important the base width is?

2.4 Overall holes behavior

2.4.1 Hole density as base is turned on (low bias only)

Note that this is on LOG scale, which means that as base is turned on the hole density in the base increases exponentially.

Below is the band diagram as the base is turned on

The above show the band structure with base turned on that correspond to the hole density change.

2.5 Base transport factor

2.5.1 Discussion

From the above results, the base transport factor is: 
 (Subscript[α, T]) =((Collector hole current)/(Emitter hole current))= (((q/τ) A  L (p1 Csch[(W/L)]-p2 Coth[(W/L)]))/((q/τ) A L (p1 Coth[(W/L)]-p2 Csch[(W/L)])))=((p1 Csch((W/L))-p2 Coth((W/L)))/(p1 Coth((W/L))-p2 Csch((W/L))))

If we approximate by dropping (Subscript[p, 2]) since it is much smaller than (Subscript[p, 1]), then:  
  (Subscript[α, T]) ~ ((p1Csch((W/L)))/(p1 Coth((W/L))))=((Csch((W/L)))/( Coth((W/L))))

Or:  (Subscript[α, T]) ~ sech((W/L))=(1/( cosh((W/L)))). 
Clearly, we want (W/L)<<1 or the base to be much shorter than the majority carrier diffusion length.

2.5.2 Illustration

FullSimplify[((p1 csch((W/L))-p2 coth((W/L)))/(p1 coth((W/L))-p2 csch((W/L))))]

αT[W_, L_,p1_, p2_]:=((p2 cosh((W/L))-p1)/(p2-p1 cosh((W/L)))) ;

We can see how the base transport factor depend on the base width:

Base transport factor

Manipulate[ kB=  8.61739*10^(-5);
p1=((E^( VEBf/(kB T)))-1) ;p2=((E^((VECr+ VEBf)/(kB T)))-1) ;
basetransportplot= Plot[((p2 Cosh[((x/L))]-p1)/(p2-p1 Cosh[((x/L))])),{x,0.1,10} , PlotRange->{0,1}
,Frame-> True, GridLines-> Automatic
,PlotStyle->{{Thick,Hue[0.35,1,0.7]},{Thick,Hue[0.5,1,0.6]}}
, Filling->{{1-> {Axis,Hue[0.4,1,1,0.2]}} }
,FrameLabel->{"Base Length (μm)","Base transport factor"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]];
Manipulate[
{Show[
Graphics[{Blue,Thickness[0.02],Arrowheads[0.1]
, Arrow[{{0,0},{W/2,0}}],Arrow[{{W,0},{W+(0.5 W)(( (p1 Csch[(W/L)]-p2 Coth[(W/L)]))/((p1 Coth[(W/L)]-p2 Csch[(W/L)]))),0}}]
,Hue[0.55,1,1,0.5],Rectangle[{0,-1},{0.25W,1}]
,Rectangle[{W,-(( (p1 Csch[(W/L)]-p2 Coth[(W/L)]))/((p1 Coth[(W/L)]-p2 Csch[(W/L)])))},{1.25 W,(( (p1 Csch[(W/L)]-p2 Coth[(W/L)]))/((p1 Coth[(W/L)]-p2 Csch[(W/L)])))}]

},AspectRatio->0.67]
,PlotRange-> {{0,1.5W},{-1,1}} ]
,Show[basetransportplot, Graphics[{Red,PointSize[0.05],Point[{W,  ((p2 Cosh[((W/L))]-p1)/(p2-p1 Cosh[((W/L))]))}]} ]]}
,{{W,2,"Base length (μm)"},1,25}
]
,{{L,3,"Diffusion length (μm)"},0.5,100}
,{{T,300,"Temperature (K)"},100,400}
,{{VEBf,0.25,"EB forward voltage (V)"},0.,0.5}
,{{VECr,-1,"EC voltage (V)"},-5,0}]

It's clear that the shorter the base, the better is the base transport factor

Below, we will see how base transport factor as a function of transitor bias voltage:

VEB=0.025  ;
Plot3D[αT[W, 1,( (E^( VEB/0.025)) -1), ( (E^( (VEB-VEC)/ 0.025)) -1)]
 ,{W,0.1,5}, {VEC,VEB+0.02,0.3}, BoxRatios-> {1,1,1}]

Although this approximation is not very good for small bias voltage, the qualitative behavior is correct in the plot above: There must be some finite bias voltage between emitter-collector (transistor turned on) for the base transport factor to be reach its value. This intuitively makes sense, doesn't it? If you don't turn on the bias, (and hence, there is no current between emitter-collector) who cares what the transport factor is?

3. Electron distribution and diffusion current in emitter

For a transistor to be efficient, it is essential that the minority current, especially the electron current from base to transmitter to be very small compared with the hole current from emitter to base. Here, we'll see that doping and length of the emitter are crucial.

3.1 Discussion

For those electrons from the base going to the emitter, the excess carrier density is (if we use the infinite diode model): 
(Subscript[n, e])(x)=(Subscript[n, Eo]) ((e^( q (Subscript[V, EB]) /(Subscript[k, B]) T))-1) (e^(x/(Subscript[L, En])   ))

And the diffusion current is: (notice that the charge has a minus sign, and double minuses is a plus - it is the opposite if we consider NPN)

(Subscript[k, B]) =.  ;
T=  .  ;
(∂_x)( (Subscript[n, Eo])  ((E^( q (Subscript[V, EB]) /((Subscript[k, B]) T)))-1) (E^(x/(Subscript[L, En]))) )

However, the above formula (Subscript[n, e])(x)=(Subscript[n, Eo]) ((e^( q (Subscript[V, EB]) /(Subscript[k, B]) T))-1) (e^(x/(Subscript[L, En])   ))is good only for the case we have infinitely long emitter. In reality, it is not. Here, we must include the effect of finite length emitter to be realistic.

3.1.1 Mathematical consideration for finite-length emitter

For finite emitter length, we MUST solve the diffusion equation with correct boundary condition:  
(Subscript[n, e])(x)=(Subscript[A, 1]) (e^(x/(Subscript[L, En]))) + (Subscript[A, 2]) (e^(-x/(Subscript[L, En])                         ))

(Subscript[n, e])(x)=(Subscript[A, 1]) (E^(x/(Subscript[L, En]))) + (Subscript[A, 2]) (E^(-x/(Subscript[L, En])))

To determine A1 and A2, we apply the boundary condition: let x=0

(E^(x/(Subscript[L, En]))) (Subscript[A, 1])+(E^(-(x/(Subscript[L, En])))) (Subscript[A, 2])  /. x-> 0

Therefore:

equation1=(Subscript[A, 1])+(Subscript[A, 2]) == (Subscript[n, Eo])  ((E^( q (Subscript[V, EB]) /((Subscript[k, B]) T)))-1)

We apply the boundary condition at x=-(Subscript[W, Em]), where the excess electrons density should be zero for an ohmic contact. (The collection of electrons at the electrical contact is so efficient that there cannot be any excess carriers).

An efficient sink will not have excess water.

(E^(x/(Subscript[L, En]))) (Subscript[A, 1])+(E^(-(x/(Subscript[L, En])))) (Subscript[A, 2])  /. x-> -(Subscript[W, Em])

Therefore we have the equation

(E^(-((Subscript[W, Em])/(Subscript[L, En])))) (Subscript[A, 1])+(E^((Subscript[W, Em])/(Subscript[L, En]))) (Subscript[A, 2]) == 0

Now we can solve for A1 and A2:

Solve[{ (E^(-((Subscript[W, Em])/(Subscript[L, En])))) (Subscript[A, 1])+(E^((Subscript[W, Em])/(Subscript[L, En]))) (Subscript[A, 2]) == 0 , (Subscript[A, 1])+(Subscript[A, 2]) ==  (Subscript[n, Eo])  ((E^( q (Subscript[V, EB]) /((Subscript[k, B]) T)))-1) },{(Subscript[A, 1]) , (Subscript[A, 2])}]

Now we substitute A1 and A2 in the equation:

(Subscript[A, 1]) (E^(x/(Subscript[L, En]))) + (Subscript[A, 2]) (E^(-x/(Subscript[L, En])))   /.   (Subscript[A, 1])->(((E^((2 (Subscript[W, Em]))/(Subscript[L, En]))) (-1+(E^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))) (Subscript[n, Eo]))/(-1+(E^((2 (Subscript[W, Em]))/(Subscript[L, En])))))   /.  (Subscript[A, 2])->-(((-1+(E^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))) (Subscript[n, Eo]))/(-1+(E^((2 (Subscript[W, Em]))/(Subscript[L, En])))))

FullSimplify[%]

Now, we want to find the diffusion current by taking the gradient:

(∂_x)(%)

FullSimplify[% ]

ExpToTrig[%]

FullSimplify[%]

(((-1+(E^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))) cosh(((x+(Subscript[W, Em]))/(Subscript[L, En]))) csch(((Subscript[W, Em])/(Subscript[L, En]))) (Subscript[n, Eo]))/(Subscript[L, En])) /. x -> 0

Finally, we have the solution, the gradient of excess carriers (electrons) in Emitter is:

3.1.2 The minority current from Base to Emitter.

From the gradient obtained above, the electron current in Emitter is: 
(Subscript[I, E;n])=q A ((Subscript[D, E;n])/(Subscript[L, E;n])) (Subscript[n, Eo]) ((e^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, En])))

We define: ((Subscript[D, E;n])/(Subscript[L, E;n]))=(((Subscript[L, E;n])^2)/((Subscript[L, E;n])(Subscript[τ, E;n]))) =((Subscript[L, E;n])/(Subscript[τ, E;n])) =(Subscript[v, T E;n])   which is defined to be the transit velocity. And we can write the electron current in the emitter:
     (Subscript[I, E;n])=(q/(Subscript[τ, E;n])) A (Subscript[L, E;n]) (Subscript[n, Eo]) ((e^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, En])))  
  or:

Let’s check the limiting result for a long emitter; The current is proportional to:

(Subscript[k, B]) =.  ; T=  .;
(((-1+(E^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))) coth(((Subscript[W, Em])/(Subscript[L, En]))) (Subscript[n, Eo]))/(Subscript[L, En])) /.  (Subscript[W, Em])-> ∞ /. (Subscript[L, En]) -> 1

This is exactly the n-to-p electron diffusion current of the ideal diode behavior.
Hence, the electron current from Base to Emitter is the electron forward-bias diode current as expected.

Review p-n junction diode: how can we make this current be “small” compared with the hole forward-bias current from emitter to base? (See Chapter 5- part 1, section 3.2.2)

Link

p-n junction diffusion currents - log scale

Manipulate[
If[start==1,
NDOS0[SemiParm_]:= Module[{ Eg, me, gc, mh,ϵ},
{ Eg, me, gc, mh,ϵ}=SemiParm ;
4.829415887919019`*^15  {gc  (me^(3/2)) , (mh^(3/2))} 
];
FermiLevel[Dopant_,T_,SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, NC0,NV0,type, DopeDensity, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{NC0,NV0}= NDOS0[SemiParm] ;
{type, DopeDensity}=Dopant ;
If[type>0  , 
kB T Log[DopeDensity/(NC0 (T^(3/2)))] 
,-kB T Log[DopeDensity/(NV0 (T^(3/2))) ] ]
] ;
DepletionW[T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
,Dopant1, Dopant2,
ContactV, V0, W,
,aB=5.29177*10^(-9)
,Ryd=13.6057},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{Dopant1, Dopant2}=JuncDopant ;
ContactV=Eg+Sign[Dopant1[[1]] ]*FermiLevel[Dopant1,T,SemiParm]+Sign[Dopant2[[1]] ]*FermiLevel[Dopant2,T,SemiParm] ;
V0=ContactV-Vbias ;
W=Sqrt[(ϵ V0/(aB  Ryd))* (1/Dopant1[[2]] +1/Dopant2[[2]]) ]  ;
10^4* W {1, Dopant2[[2]]/(Dopant1[[2]] +Dopant2[[2]])
,Dopant1[[2]]/(Dopant1[[2]] +Dopant2[[2]])  }] ;
ϕJ[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
]
] ;
BandDiagram[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W,w, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

FermiLine[x_, T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
If[x≥- x1,-Sign[JuncDopant[[1,1]] ]*Vbias,  ]
];
CarrierEqui[x_, T_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ 
,NC0,NV0, F
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{NC0,NV0}= NDOS0[SemiParm] ;
F=BandDiagram[x, T,0.,JuncDopant, SemiParm] ;
If[JuncDopant[[1,1]]>0, 
{NC0 (T^(3/2)) (E^(-F[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[2]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[1]]/(kB T)))} 
, {NC0 (T^(3/2)) (E^(-F[[1]]/(kB T))), NV0 (T^(3/2)) (E^(F[[2]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[1]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[2]]/(kB T)))}
]
];
CarrierJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]≥ 0., NV0 (T^(3/2.)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2.)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]≥ 0., NC0 (T^(3/2.)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2.)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]≥ 0.,
If[x≤ -x1, q1 G  (E^((x+x1)/Lp)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Ln)), ]
]
, If[x≤ -x1, q1 G  (E^((x+x1)/Ln)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Lp)), ]
]
]
]  ;
DiffJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,Lp q1 G  (E^((x+x1)/Lp))/τ,
If [x≥ x2,Ln q2 G  (E^(-(x-x2)/Ln))/τ, ]
]
, If[x≤ -x1,Ln q1 G  (E^((x+x1)/Ln))/τ,
If [x≥ x2,Lp q2 G  (E^(-(x-x2)/Lp))/τ, ]
]
]
]  ;
DiodeC[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
1.602176487`*^-19*If[JuncDopant[[1,1]]>0,
( Lp q1 +Ln q2 ) G  /τ ,( Ln q1 +Lp q2 ) G /τ]
]  ;
DiodeC1[ T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2,ContactV,Ef1,Ef2
,q1,q2,F1,F2,G,r1,r2,H
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
Ef1=  FermiLevel[JuncDopant[[1]],T,SemiParm];
Ef2=  FermiLevel[JuncDopant[[2]],T,SemiParm];
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
r1=  If[JuncDopant[[1,1]]>0,(mh/me)^3/2  *Exp[(F1[[1]]+F1[[2]])/(kB T)] , (me/mh)^3/2  *Exp[-(F1[[1]]+F1[[2]])/(kB T)] ] ;
r2=   If[JuncDopant[[1,1]]>0,(me/mh)^3/2  *Exp[-(F2[[1]]+F2[[2]])/(kB T)] , (mh/me)^3/2  *Exp[(F2[[1]]+F2[[2]])/(kB T)] ] ;
G=Exp[Vbias/(kB T)]-1; H=1-Exp[-2(ContactV-Vbias)/(kB T)] ;
1.602176487`*^-19*If[JuncDopant[[1,1]]>0,
( Lp q1 (1+r1 (G+1)) +Ln q2  (1+ r2 (G+1))) G  /(τ H)
,( Ln q1 (1+r1 (G+1)) +Lp q2 (1+ r2 (G+1)) ) G /(τ H)]
];

 start=0, ];
Manipulate[
If[ONOFF=="ON",
Manipulate[
SemiParm={ Eg, me,gc, mh,ϵ } ;  

Manipulate[
DiffParm ={μn,μp,10^τ,Ln,Lp};
dtype=If[dope=="p-n",-1,1] ;
ContactV=Eg+dtype*FermiLevel[{dtype,10^d1},T,SemiParm]-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm] ; 
VbiasL=Min[Vbias,ContactV] ;
Show[LogPlot[DiffJ[x, T,VbiasL,{ {dtype,10.^d1},{-dtype,10.^d2} }, SemiParm, DiffParm],
{x,xL,0},PlotRange-> {{xL,xR},{(10^(Mf-4)),(10^Mf)}}
,Frame-> True, GridLines-> Automatic
, Filling-> {1-> {Bottom,If[dtype==1,Hue[0.6,1,1,0.4],Hue[0,1,1,0.3] ] }}
,PlotStyle->{Thick,If[dtype==1,Blue, Red] }
,FrameLabel->{"Position (μm)","Diffusion current (a.u.)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"] ]
,LogPlot[DiffJ[x, T,VbiasL,{ {dtype,10.^d1},{-dtype,10.^d2} }, SemiParm, DiffParm],
{x,0,xR},PlotRange-> {{xL,xR},{(10^(Mf-4)),(10^Mf)}}
,Frame-> True, GridLines-> Automatic
, Filling-> {1-> {Bottom,If[dtype==1,Hue[0,1,1,0.3],Hue[0.6,1,1,0.4] ] }}
,PlotStyle->{Thick,If[dtype==1, Red,Blue] }
,FrameLabel->{"Position (μm)","Diffusion current"}
,LabelStyle->Directive[14,FontFamily-> "Arial"] ]
],
{{dope,"p-n"},{"p-n","n-p"}},{{d1,18,"left doping ^10"},18,19},{{d2,16,"right doping ^10"},15,18}
,{{T,300,"Temperature (K)"},100,400}
,{{ Ln,50,"e diff length (μm)"},1.,100.}
,{{ Lp,20.,"h diff length (μm)"},1.,100.}
,{{xR,50," xR range (μm)"},5,50},{{xL,-50," xL range (μm)"},-50,-5}
,{{Mf,16.7,"Max forward"},1,20},{{Vbias,0.25},-1,1}]
,Grid[{{ Control[{{Eg,1.1,"Bandgap (eV)"},0.3,4}]
,Control[{{ϵ,11.8,"Dielectric const."},4,20}]}
,{Control[{{me,0.33,"Elec eff mass me*"},0.02,0.5}]
,Control[{{mh,0.81,"Hole eff mass mh*"},0.02,1}]}
,{Control[{{gc,6,"Cond band degeneracy"},{1,6}}]}
,{Control[{{ μn,800.,"e mobility"},100.,10000.}]
,Control[{{ μp,200.,"h mobility"},10.,1000.}]
,Control[{{ τ,-6,"carrier lifetime (10^)"},-12,-6}]
}
}]
], ]
,{{ONOFF,"ON","Click OFF if not used"},{"ON","OFF"}}
],
{{start,1,"Click to start"},{0,1}} ]

Review Chapter 5- part 1. If we have a symmetrically doped diode, where the electron current from n to p is as large as the hole current from p to n, then there will be very large recombination as the two populations meet each other! In a transistor, it is not desirable to have all the majority carriers from the emitter “eaten up” by the minority current coming from the base. Asymmetric doping is essential.

3.2 Electrons behavior in emitter

3.2.1 Base doping vs. emitter doping

Here, we'll see how important the relative doping between the emitter and the base is on the two types of current. Use the calculation module below, vary the doping concentration.

EB junction diffusion currents - log scale (manipulate doping concentrations)

Manipulate[If[Calc=="ON",
Manipulate[
If[start==1,
NDOS0[SemiParm_]:= Module[{ Eg, me, gc, mh,ϵ},
{ Eg, me, gc, mh,ϵ}=SemiParm ;
4.829415887919019`*^15  {gc  (me^(3/2)) , (mh^(3/2))} 
];
FermiLevel[Dopant_,T_,SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, NC0,NV0,type, DopeDensity, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{NC0,NV0}= NDOS0[SemiParm] ;
{type, DopeDensity}=Dopant ;
If[type>0  , 
kB T Log[DopeDensity/(NC0 (T^(3/2)))] 
,-kB T Log[DopeDensity/(NV0 (T^(3/2))) ] ]
] ;
DepletionW[T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
,Dopant1, Dopant2,
ContactV, V0, W,
,aB=5.29177*10^(-9)
,Ryd=13.6057},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{Dopant1, Dopant2}=JuncDopant ;
ContactV=Eg+Sign[Dopant1[[1]] ]*FermiLevel[Dopant1,T,SemiParm]+Sign[Dopant2[[1]] ]*FermiLevel[Dopant2,T,SemiParm] ;
V0=ContactV-Vbias ;
W=Sqrt[(ϵ V0/(aB  Ryd))* (1/Dopant1[[2]] +1/Dopant2[[2]]) ]  ;
10^4* W {1, Dopant2[[2]]/(Dopant1[[2]] +Dopant2[[2]])
,Dopant1[[2]]/(Dopant1[[2]] +Dopant2[[2]])  }] ;
ϕJ[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
]
] ;
BandDiagram[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W,w, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

BandDiagramBJT[x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2,w },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
If[ JuncDopant[[1,1]] ==-1,
w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{Sign[JuncDopant[[2,1]] ]*Eg,0.}
 ,w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{0.,Sign[JuncDopant[[2,1]] ]*Eg}]
] ;

FermiLine[x_, T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
If[x≥- x1,-Sign[JuncDopant[[1,1]] ]*Vbias,  ]
];
CarrierEqui[x_, T_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ 
,NC0,NV0, F
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{NC0,NV0}= NDOS0[SemiParm] ;
F=BandDiagram[x, T,0.,JuncDopant, SemiParm] ;
If[JuncDopant[[1,1]]>0, 
{NC0 (T^(3/2)) (E^(-F[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[2]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[1]]/(kB T)))} 
, {NC0 (T^(3/2)) (E^(-F[[1]]/(kB T))), NV0 (T^(3/2)) (E^(F[[2]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[1]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[2]]/(kB T)))}
]
];
CarrierJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]≥ 0., NV0 (T^(3/2.)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2.)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]≥ 0., NC0 (T^(3/2.)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2.)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]≥ 0.,
If[x≤ -x1, q1 G  (E^((x+x1)/Lp)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Ln)), ]
]
, If[x≤ -x1, q1 G  (E^((x+x1)/Ln)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Lp)), ]
]
]
]  ;
DiffJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,Lp q1 G  (E^((x+x1)/Lp))/τ,
If [x≥ x2,Ln q2 G  (E^(-(x-x2)/Ln))/τ, ]
]
, If[x≤ -x1,Ln q1 G  (E^((x+x1)/Ln))/τ,
If [x≥ x2,Lp q2 G  (E^(-(x-x2)/Lp))/τ, ]
]
]
]  ;
DiffJEB[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_,BJTDim_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2,Y, y1,y2
,q1,q2,F1,F2,VEB,VCB,GEB,GCB
,WEm,WB,WCol,dbase
, kB=  8.61739*10^(-5)},

(* See lecture note:
  (Subscript[I, E;p])=(q/(Subscript[τ, B;p]))  (Subscript[L, B;p]) A (Subscript[p, Bo ]) (((E^(q (Subscript[V, EB])/(Subscript[k, B])T))-1)  Cosh[((x/(Subscript[L, B;p])))]-((E^(q (Subscript[V, CB])/(Subscript[k, B])T))-1) Csch[((W/(Subscript[L, B;p])))])  ;
  (Subscript[I, E;n])=(q/(Subscript[τ, E;n])) A (Subscript[L, E;n]) (Subscript[n, Eo]) ((E^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, En])))  

*)
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
{VEB,VCB}=Vbias ;
{WEm,dbase,WCol}=BJTDim ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,VEB,Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,VCB,Take[JuncDopant,{2,3}], SemiParm] ;
WB=dbase-x2-y1 ;
F1=BandDiagram[-x1, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
F2=BandDiagram[x2, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
GEB=Exp[VEB/(kB T)]-1;GCB=Exp[VCB/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,(Ln/τ) q2 (GEB  ((Cosh[(x+x1+WEm)/Ln])/(Sinh[WEm/Ln]))),
If [x≥ x2,(Lp/τ) q1 (GEB  ((Cosh[(x-x2)/Lp])/(Sinh[WB/Lp])) -GCB  ((Cosh[(W-x+x2)/Lp])/(Sinh[WB/Lp]))), ]
]
, If[x≤ -x1,(Ln/τ) q1 (GEB  ((Cosh[((x+x1)+WEm)/Ln])/(Sinh[WEm/Ln]))),
If [x≥ x2,(Lp/τ) (q2/(Sinh[WB/Lp])) (GEB  Cosh[(WB-x+x2)/Lp] -GCB  Cosh[(x-x2)/Lp]), ]
]
]
]  ;

 start=0, ];
Manipulate[
SemiParm={ Eg, me,gc, mh,ϵ } ;  
Manipulate[
DiffParm ={μn,μp,10^τ,Ln,Lp};
BJTDim ={WEm,dbase,10.};
dtype=If[dope=="p-n-p",-1,1] ;
ContactVEB=Eg+dtype*FermiLevel[{dtype,10^d1},T,SemiParm]-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm] ;
ContactVBC=Eg-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm]+dtype*FermiLevel[{-dtype,10^d3},T,SemiParm] ; 
JuncDopant={ {dtype,10^d1},{-dtype,10^d2} ,{dtype,10^d3}};
VbiasL=Min[VEBf,ContactVEB] ;
Show[LogPlot[DiffJEB[x, T,{VbiasL,VECr},JuncDopant, SemiParm,DiffParm,BJTDim],
{x,Max[xL,-WEm ],0},PlotRange-> {{Max[xL,-WEm ],Min[xR,dbase]},{(10^(Mf-5)),(10^Mf)}}
,Frame-> True, GridLines-> Automatic
, Filling-> {1-> {Bottom,If[dtype==1,Hue[0.6,1,1,0.4],Hue[0,1,1,0.3] ] }}
,PlotStyle->{Thick,If[dtype==1,Blue, Red] }
,FrameLabel->{"Position (μm)","Diffusion current (a.u.)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"] ]
,LogPlot[DiffJEB[x, T,{VbiasL,VECr},JuncDopant, SemiParm,DiffParm,BJTDim],
{x,0,Min[xR,dbase]},PlotRange-> {{xL,xR},{(10^(Mf-5)),(10^Mf)}}
,Frame-> True, GridLines-> Automatic
, Filling-> {1-> {Bottom,If[dtype==1,Hue[0,1,1,0.3],Hue[0.6,1,1,0.4] ] }}
,PlotStyle->{Thick,If[dtype==1, Red,Blue] }
,FrameLabel->{"Position (μm)","Diffusion current"}
,LabelStyle->Directive[14,FontFamily-> "Arial"] ]
],
{{dope,"p-n-p"},{"p-n-p","n-p-n"}}
,{{d1,18.5,"left doping ^10"},18,19}
,{{d2,16,"right doping ^10"},15,17}
,{{d3,17,"Collector doping ^10"},16,18}
,{{T,300,"Temperature (K)"},100,400}
,{{dbase,5,"Base length (μm)"},4,50}
,{{WEm,5,"Emitter length (μm)"},1,20}
,{{ Ln,50,"e diff length (μm)"},1.,100.}
,{{ Lp,20.,"h diff length (μm)"},1.,100.}
,{{xR,50," xR range (μm)"},5,50},{{xL,-50," xL range (μm)"},-50,-5}
,{{Mf,17.7,"Max forward"},1,20}
,{{VEBf,0.25},0,1},{{VECr,-3},-5,0}]
,Grid[{{ Control[{{Eg,1.1,"Bandgap (eV)"},0.3,4}]
,Control[{{ϵ,11.8,"Dielectric const."},4,20}]}
,{Control[{{me,0.33,"Elec eff mass me*"},0.02,0.5}]
,Control[{{mh,0.81,"Hole eff mass mh*"},0.02,1}]}
,{Control[{{gc,6,"Cond band degeneracy"},{1,6}}]}
,{Control[{{ μn,800.,"e mobility"},100.,10000.}]
,Control[{{ μp,200.,"h mobility"},10.,1000.}]
,Control[{{ τ,-6,"carrier lifetime (10^)"},-12,-6}]
}
}]
],
{{start,1,"Click to start"},{0,1}} ]
, ]
,{{Calc,"OFF","Turn off if not used"},{"ON","OFF"}}
]

Here, we will plot to compare the electron current in the emitter from the base vs the hole current in the base from the emitter. (think about export model) Left side: emitter ; Right side: base
(linear scale)
By manipulate the doping of emitter (a1) and base (d), we see that we can make wrong choice if emitter doping is less than base doping.

Left side: emitter ; Right side: base

Now we find out a reason for the large asymmetry in the emitter and base doping: emitter is usually heavily doped while the base is very lightly doped, that way, we electrons from base to the emitter won't "eat up" holes in the emitter (which is supposed to go to the collector)

3.2.2 Effects of emitter length

We use the same calculation module above, except here, we will manipulate Emitter length.

EB junction diffusion currents - log scale (manipulate Emitter length)

Manipulate[If[Calc=="ON",
Manipulate[
If[start==1,
NDOS0[SemiParm_]:= Module[{ Eg, me, gc, mh,ϵ},
{ Eg, me, gc, mh,ϵ}=SemiParm ;
4.829415887919019`*^15  {gc  (me^(3/2)) , (mh^(3/2))} 
];
FermiLevel[Dopant_,T_,SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, NC0,NV0,type, DopeDensity, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{NC0,NV0}= NDOS0[SemiParm] ;
{type, DopeDensity}=Dopant ;
If[type>0  , 
kB T Log[DopeDensity/(NC0 (T^(3/2)))] 
,-kB T Log[DopeDensity/(NV0 (T^(3/2))) ] ]
] ;
DepletionW[T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
,Dopant1, Dopant2,
ContactV, V0, W,
,aB=5.29177*10^(-9)
,Ryd=13.6057},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{Dopant1, Dopant2}=JuncDopant ;
ContactV=Eg+Sign[Dopant1[[1]] ]*FermiLevel[Dopant1,T,SemiParm]+Sign[Dopant2[[1]] ]*FermiLevel[Dopant2,T,SemiParm] ;
V0=ContactV-Vbias ;
W=Sqrt[(ϵ V0/(aB  Ryd))* (1/Dopant1[[2]] +1/Dopant2[[2]]) ]  ;
10^4* W {1, Dopant2[[2]]/(Dopant1[[2]] +Dopant2[[2]])
,Dopant1[[2]]/(Dopant1[[2]] +Dopant2[[2]])  }] ;
ϕJ[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
]
] ;
BandDiagram[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W,w, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

BandDiagramBJT[x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2,w },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
If[ JuncDopant[[1,1]] ==-1,
w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{Sign[JuncDopant[[2,1]] ]*Eg,0.}
 ,w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{0.,Sign[JuncDopant[[2,1]] ]*Eg}]
] ;

FermiLine[x_, T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
If[x≥- x1,-Sign[JuncDopant[[1,1]] ]*Vbias,  ]
];
CarrierEqui[x_, T_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ 
,NC0,NV0, F
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{NC0,NV0}= NDOS0[SemiParm] ;
F=BandDiagram[x, T,0.,JuncDopant, SemiParm] ;
If[JuncDopant[[1,1]]>0, 
{NC0 (T^(3/2)) (E^(-F[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[2]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[1]]/(kB T)))} 
, {NC0 (T^(3/2)) (E^(-F[[1]]/(kB T))), NV0 (T^(3/2)) (E^(F[[2]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[1]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[2]]/(kB T)))}
]
];
CarrierJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]≥ 0., NV0 (T^(3/2.)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2.)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]≥ 0., NC0 (T^(3/2.)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2.)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]≥ 0.,
If[x≤ -x1, q1 G  (E^((x+x1)/Lp)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Ln)), ]
]
, If[x≤ -x1, q1 G  (E^((x+x1)/Ln)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Lp)), ]
]
]
]  ;
DiffJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,Lp q1 G  (E^((x+x1)/Lp))/τ,
If [x≥ x2,Ln q2 G  (E^(-(x-x2)/Ln))/τ, ]
]
, If[x≤ -x1,Ln q1 G  (E^((x+x1)/Ln))/τ,
If [x≥ x2,Lp q2 G  (E^(-(x-x2)/Lp))/τ, ]
]
]
]  ;
DiffJEB[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_,BJTDim_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2,Y, y1,y2
,q1,q2,F1,F2,VEB,VCB,GEB,GCB
,WEm,WB,WCol,dbase
, kB=  8.61739*10^(-5)},

(* See lecture note:
  (Subscript[I, E;p])=(q/(Subscript[τ, B;p]))  (Subscript[L, B;p]) A (Subscript[p, Bo ]) (((E^(q (Subscript[V, EB])/(Subscript[k, B])T))-1)  Cosh[((x/(Subscript[L, B;p])))]-((E^(q (Subscript[V, CB])/(Subscript[k, B])T))-1) Csch[((W/(Subscript[L, B;p])))])  ;
  (Subscript[I, E;n])=(q/(Subscript[τ, E;n])) A (Subscript[L, E;n]) (Subscript[n, Eo]) ((E^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, En])))  

*)
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
{VEB,VCB}=Vbias ;
{WEm,dbase,WCol}=BJTDim ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,VEB,Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,VCB,Take[JuncDopant,{2,3}], SemiParm] ;
WB=dbase-x2-y1 ;
F1=BandDiagram[-x1, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
F2=BandDiagram[x2, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
GEB=Exp[VEB/(kB T)]-1;GCB=Exp[VCB/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,(Ln/τ) q2 (GEB  ((Cosh[(x+x1+WEm)/Ln])/(Sinh[WEm/Ln]))),
If [x≥ x2,(Lp/τ) q1 (GEB  ((Cosh[(x-x2)/Lp])/(Sinh[WB/Lp])) -GCB  ((Cosh[(W-x+x2)/Lp])/(Sinh[WB/Lp]))), ]
]
, If[x≤ -x1,(Ln/τ) q1 (GEB  ((Cosh[((x+x1)+WEm)/Ln])/(Sinh[WEm/Ln]))),
If [x≥ x2,(Lp/τ) (q2/(Sinh[WB/Lp])) (GEB  Cosh[(WB-x+x2)/Lp] -GCB  Cosh[(x-x2)/Lp]), ]
]
]
]  ;

 start=0, ];
Manipulate[
SemiParm={ Eg, me,gc, mh,ϵ } ;  
Manipulate[
DiffParm ={μn,μp,10^τ,Ln,Lp};
BJTDim ={WEm,dbase,10.};
dtype=If[dope=="p-n-p",-1,1] ;
ContactVEB=Eg+dtype*FermiLevel[{dtype,10^d1},T,SemiParm]-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm] ;
ContactVBC=Eg-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm]+dtype*FermiLevel[{-dtype,10^d3},T,SemiParm] ; 
JuncDopant={ {dtype,10^d1},{-dtype,10^d2} ,{dtype,10^d3}};
VbiasL=Min[VEBf,ContactVEB] ;
Show[LogPlot[DiffJEB[x, T,{VbiasL,VECr},JuncDopant, SemiParm,DiffParm,BJTDim],
{x,Max[xL,-WEm ],0},PlotRange-> {{Max[xL,-WEm ],Min[xR,dbase]},{(10^(Mf-5)),(10^Mf)}}
,Frame-> True, GridLines-> Automatic
, Filling-> {1-> {Bottom,If[dtype==1,Hue[0.6,1,1,0.4],Hue[0,1,1,0.3] ] }}
,PlotStyle->{Thick,If[dtype==1,Blue, Red] }
,FrameLabel->{"Position (μm)","Diffusion current (a.u.)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"] ]
,LogPlot[DiffJEB[x, T,{VbiasL,VECr},JuncDopant, SemiParm,DiffParm,BJTDim],
{x,0,Min[xR,dbase]},PlotRange-> {{xL,xR},{(10^(Mf-5)),(10^Mf)}}
,Frame-> True, GridLines-> Automatic
, Filling-> {1-> {Bottom,If[dtype==1,Hue[0,1,1,0.3],Hue[0.6,1,1,0.4] ] }}
,PlotStyle->{Thick,If[dtype==1, Red,Blue] }
,FrameLabel->{"Position (μm)","Diffusion current"}
,LabelStyle->Directive[14,FontFamily-> "Arial"] ]
],
{{dope,"p-n-p"},{"p-n-p","n-p-n"}}
,{{d1,18.5,"left doping ^10"},18,19}
,{{d2,16,"right doping ^10"},15,17}
,{{d3,17,"Collector doping ^10"},16,18}
,{{T,300,"Temperature (K)"},100,400}
,{{dbase,5,"Base length (μm)"},4,50}
,{{WEm,5,"Emitter length (μm)"},1,20}
,{{ Ln,50,"e diff length (μm)"},1.,100.}
,{{ Lp,20.,"h diff length (μm)"},1.,100.}
,{{xR,50," xR range (μm)"},5,50},{{xL,-50," xL range (μm)"},-50,-5}
,{{Mf,17.7,"Max forward"},1,20}
,{{VEBf,0.25},0,1},{{VECr,-3},-5,0}]
,Grid[{{ Control[{{Eg,1.1,"Bandgap (eV)"},0.3,4}]
,Control[{{ϵ,11.8,"Dielectric const."},4,20}]}
,{Control[{{me,0.33,"Elec eff mass me*"},0.02,0.5}]
,Control[{{mh,0.81,"Hole eff mass mh*"},0.02,1}]}
,{Control[{{gc,6,"Cond band degeneracy"},{1,6}}]}
,{Control[{{ μn,800.,"e mobility"},100.,10000.}]
,Control[{{ μp,200.,"h mobility"},10.,1000.}]
,Control[{{ τ,-6,"carrier lifetime (10^)"},-12,-6}]
}
}]
],
{{start,1,"Click to start"},{0,1}} ]
, ]
,{{Calc,"OFF","Turn off if not used"},{"ON","OFF"}}
]

Manipulate the emitter length WEm. Do we want a high electron current in the emitter?
Now we see an advantage of using long emitter: we have less electron current from base to emitter.

Summarize 2 key factors with respect to E-B design to minimize the base-emitter electrons current for an efficient transistor.

To reduce the electron current from base to emitter:
1- Use heavy emitter doping vs. very light base doping
2- Use long emitter length relative to electron diffusion length

3.3 Emitter efficiency summary

3.3.1 Summary of discussion

It is desirable to have high emitter efficiency γ, which is defined as:
   γ=((Subscript[I, E;p])/((Subscript[I, E;p])+(Subscript[I, E;n]))) 
 From the above results:
  γ=(( ((Subscript[D, B;p])/(Subscript[L, B;p])) ((Subscript[p, 1]) coth(((Subscript[W, B])/(Subscript[L, B;p])))-(Subscript[p, 2]) csch(((Subscript[W, B])/(Subscript[L, B;p])))))/( ((Subscript[D, B;p])/(Subscript[L, B;p])) ((Subscript[p, 1]) coth(((Subscript[W, B])/(Subscript[L, B;p])))-(Subscript[p, 2]) csch(((Subscript[W, B])/(Subscript[L, B;p]))))+ ((Subscript[D, E;n])/(Subscript[L, E;n]))  (Subscript[n, E;o]) ((e^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, E;n]))))) 
  We can approximate by dropping (Subscript[p, 2]):
  γ~(((Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))])  (Subscript[p, 1]) coth(((Subscript[W, B])/(Subscript[L, B;p]))))/((Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))]) (Subscript[p, 1]) coth(((Subscript[W, B])/(Subscript[L, B;p])))+ (Sqrt[((Subscript[D, E;n])/(Subscript[τ, E;n]))])  (Subscript[n, E;o]) ((e^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, E;n])))))  
  γ~(( (Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))]) (Subscript[p, B o]) ((e^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, B])/(Subscript[L, B;p]))))/( (Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))]) (Subscript[p, B o]) ((e^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, B])/(Subscript[L, B;p])))+ (Sqrt[((Subscript[D, E;n])/(Subscript[τ, E;n]))])  (Subscript[n, E;o]) ((e^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, E;n])))))  
 γ~(( (Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))]) (Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p]))))/((Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))]) (Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p])))+ (Sqrt[((Subscript[D, E;n])/(Subscript[τ, E;n]))])  (Subscript[n, E;o])  coth(((Subscript[W, Em])/(Subscript[L, E;n])))))   
  γ~(( (Sqrt[(((Subscript[L, B;p])^2)/((Subscript[τ, B;p])^2))]) (Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p]))))/( (Sqrt[(((Subscript[L, B;p])^2)/((Subscript[τ, B;p])^2))])(Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p])))+ (Sqrt[(((Subscript[L, E;n])^2)/((Subscript[τ, E;n])^2))])  (Subscript[n, E;o])  coth(((Subscript[W, Em])/(Subscript[L, E;n])))))=((((Subscript[L, B;p])/(Subscript[τ, B;p]))  (Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p]))))/( ((Subscript[L, B;p])/(Subscript[τ, B;p]))(Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p])))+ ((Subscript[L, E;n])/(Subscript[τ, E;n]))  (Subscript[n, E;o])  coth(((Subscript[W, Em])/(Subscript[L, E;n])))))

Hence the approximated emitter efficiency is:
     γ=(1/(1+(( ((Subscript[L, E;n])/(Subscript[τ, E;n]))  (Subscript[n, E;o])  coth(((Subscript[W, Em])/(Subscript[L, E;n]))))/( ((Subscript[L, B;p])/(Subscript[τ, B;p]))(Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p])))))))

To have high emitter efficiency, we want (Subscript[I, E;p])>>(Subscript[I, E;n]). Or:
 (Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))]) (Subscript[p, B o])  coth(((Subscript[W, B])/(Subscript[L, B;p]))) >>(Sqrt[((Subscript[D, E;n])/(Subscript[τ, E;n]))])  (Subscript[n, E;o])  coth(((Subscript[W, Em])/(Subscript[L, E;n])))  
 There are three parameters to be considered:
 1- Transit velocity: (Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))]) and (Sqrt[((Subscript[D, E;n])/(Subscript[τ, E;n]))]): we can't do much with these, as they are determined mostly by the intrinsic material properties.   (Sqrt[((Subscript[D, B;p])/(Subscript[τ, B;p]))])=(Sqrt[(((Subscript[μ, B;p])  (Subscript[k, B])T)/(Subscript[τ, B;p]))]) and (Sqrt[((Subscript[D, E;n])/(Subscript[τ, E;n]))])=(Sqrt[(((Subscript[μ, E;n])  (Subscript[k, B])T)/(Subscript[τ, E;n]))]). For the base, we can engineer the doping and material quality for large hole mobility. But we also want long lifetime for large diffusion length for high base transport factor. For emitter, we want low mobility for short diffusion length, but we DON'T want too poor conductivity (and high resistivity) in the emitter either. Thus,  there is not much room to engineer these parameters.  
 2- We can have (Subscript[p, B o]) >>(Subscript[n, E;o])  : As already discussed above, this is achieved by having the emitter doped heavily compared with the base. In fact, this is the basic design parameter of a BJT. 
 3- We want coth(((Subscript[W, B])/(Subscript[L, B;p])))>>coth(((Subscript[W, Em])/(Subscript[L, E;n]))) : as discussed above: we want long emitter: ((Subscript[W, Em])/(Subscript[L, E;n]))>>1  and short base: ((Subscript[W, B])/(Subscript[L, B;p]))<<1

3.3.2 Illustration

γ[WB_,WEm_,NB_, NE_,Parm_List]:=Module[{LBp,LEn, DBp,τBp,DEn,τEn,Ni  },
{DBp,τBp,DEn,τEn,Ni}=Parm ;
pB0= Ni^2/NB  ;
nE0= Ni^2/NE  ;
LBp=Sqrt[DBp*τBp]*10^4  ;
LEn=Sqrt[DEn*τEn]*10^4  ; 
(( (Sqrt[(DBp/(τBp))]) pB0  coth((WB/LBp)))/((Sqrt[(DBp/(τBp))]) pB0  coth((WB/LBp))+ (Sqrt[(DEn/(τEn))])  nE0  coth((WEm/LEn))))]

SiParm={ DBp=5. 
,τBp=5*10.^(-7)  
,DEn=13. 
,τEn=10.^(-7)
, Ni=1.5*10^10} ;

We will see how the base and emitter length affect the emitter efficiency in the following plot:

NE=10^18 ;
NB=2*10^16 ;
Plot3D[γ[WB,WEm,NB,NE,SiParm],{WB,1,20},
{WEm,0.2,3}, BoxRatios-> {1.,1,1.5}]

Notice that the best emitter efficiency is at the far corner: where base length is shortest and emitter length is longest. The nearest corner is the opposite: worst efficiency for short emitter and long base.

In the following plot, we will see how the base and emitter doping affect the emitter efficiency:

WB=1. ;
WEm=3. ;
Plot3D[γ[WB,WEm,NB,NE,SiParm],{NB,10^16,5*10^17},
{NE,10^17,5*10^18}, BoxRatios-> {1.,1,1.5}, PlotRange->All]

Notice the similarity with the case above. The best emitter efficiency is at the far corner, where base doping is lowest and emitter doping is highest. The nearest corner is the opposite: worst efficiency for low emitter doping and high base doping.

4. I-V curve

4.1 Introduction

BJT is a device where a small current (base) controls a large current (emitter to collector).
To understand the I-V behavior, we need to calculate the base current (electron), (which has a specific VEB) and then the corresponding collector current.

4.2 Base-emitter current

In practice, we control the base-emitter current with a current source. However, here, we plot the electron base-emitter current as a function of bias voltage VEB:

nE0=1. ; kB=8.61739*10^(-5) ;dtp==-1 ;
LogPlot[ (((-1+(E^(VEB/(T kB))))  Cosh[(WEm/LEn)]  Csch[(WEm/LEn)]  nE0)/LEn)   /. LEn-> 7 /. WEm-> 50.  /. T-> 300   , {VEB,0.,0.7} ,
  PlotStyle->{RGBColor[0,0,1], Thickness[ 0.01] } ,
	PlotRange->{0,12.5}
,Frame-> True, GridLines-> Automatic
, Filling-> {1-> {Bottom,Hue[0.35,1,1,0.4] }}
,PlotStyle->{Thick,If[dtp== 1,Blue, Red] }
,FrameLabel->{"VEB voltage (V)","Base-Emitter current (a.u.)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]]

With current source control, we define an inverse function that gives the VEB voltage as a function of the input base-emitter current:

VEBfi[IBE_, LEn_,WEm_,T_]:= Module[{kB=8.61739*10^(-5) },x/.  FindRoot[ IBE ==  (((-1+(E^(x/(T kB)))) Cosh[(WEm/LEn)]  Csch[(WEm/LEn)])/LEn)    ,{x,0.05,0.6}, AccuracyGoal-> 8]
]  ;

Plot[ VEBfi[IBE,7., 50.,300.],{IBE, 10^7,10^10}, PlotRange->{0.,0.7}]

Notice that how the VEB "flats" out with increasing IEB current: because of the exponential behavior: it doesn't take much VEB increase to have a large IEB current

4.3 Diffusion collector current vs. base-to-emitter current

Here, we will see how varying the base current will affect the collector current:
(the code below may take sometimes to execute, hence please be patient).

p-n-p transistor IV-curves

Manipulate[
If[start==1,
NDOS0[SemiParm_]:= Module[{ Eg, me, gc, mh,ϵ},
{ Eg, me, gc, mh,ϵ}=SemiParm ;
4.829415887919019`*^15  {gc  (me^(3/2)) , (mh^(3/2))} 
];
FermiLevel[Dopant_,T_,SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, NC0,NV0,type, DopeDensity, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{NC0,NV0}= NDOS0[SemiParm] ;
{type, DopeDensity}=Dopant ;
If[type>0  , 
kB T Log[DopeDensity/(NC0 (T^(3/2)))] 
,-kB T Log[DopeDensity/(NV0 (T^(3/2))) ] ]
] ;
DepletionW[T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
,Dopant1, Dopant2,
ContactV, V0, W,
,aB=5.29177*10^(-9)
,Ryd=13.6057},
{ Eg, me, gc, mh,ϵ}=SemiParm  ;
{Dopant1, Dopant2}=JuncDopant ;
ContactV=Eg+Sign[Dopant1[[1]] ]*FermiLevel[Dopant1,T,SemiParm]+Sign[Dopant2[[1]] ]*FermiLevel[Dopant2,T,SemiParm] ;
V0=ContactV-Vbias ;
W=Sqrt[(ϵ V0/(aB  Ryd))* (1/Dopant1[[2]] +1/Dopant2[[2]]) ]  ;
10^4* W {1, Dopant2[[2]]/(Dopant1[[2]] +Dopant2[[2]])
,Dopant1[[2]]/(Dopant1[[2]] +Dopant2[[2]])  }] ;
ϕJ[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
]
] ;
BandDiagram[x_, T_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W,w, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V0  (x+x1)^2 /(x1*W),
If[x≤ x2, V0*(1-(x-x2)^2/(x2*W)) ,V0]
]
] ;
w-FermiLevel[JuncDopant[[1]],T,SemiParm]
+{Sign[JuncDopant[[2,1]] ]*Eg,0.} 
] ;

BandDiagramBJT[x_, T_,dbase_,Vbias_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ
, ContactV1, ContactV2, V01,V02, W, x1,x2, Y, y1,y2,w },
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias[[1]],Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,Vbias[[2]],Take[JuncDopant,{2,3}], SemiParm] ;
ContactV1=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
ContactV2=Eg+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]],T,SemiParm]+Sign[JuncDopant[[3,1]] ]*FermiLevel[JuncDopant[[3]] ,T,SemiParm] ;
V01=ContactV1-Vbias [[1]];
V02=ContactV2-Vbias [[2]];
w=Sign[JuncDopant[[1,1]] ]*If[x≤-x1,0.,If[x≤ 0., V01  (x+x1)^2 /(x1*W),
If[x≤ x2, V01*(1-(x-x2)^2/(x2*W)) ,
If[x≤ dbase-y1,V01, 
If[x≤ dbase, V01-V02*(x-dbase+y1)^2/(y1*Y),
If[x≤ dbase+y2,V01- V02*(1-(x-dbase-y2)^2/(y2*Y)), V01- V02]
]
]
]
]
] ;
If[ JuncDopant[[1,1]] ==-1,
w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{Sign[JuncDopant[[2,1]] ]*Eg,0.}
 ,w-FermiLevel[JuncDopant[[1]],T,SemiParm]+{0.,Sign[JuncDopant[[2,1]] ]*Eg}]
] ;

FermiLine[x_, T_,Vbias_,JuncDopant_, SemiParm_]:=Module[{Eg, me, gc, mh,ϵ
, ContactV, V0, W, x1,x2},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
ContactV=Eg+Sign[JuncDopant[[1,1]] ]*FermiLevel[JuncDopant[[1]],T,SemiParm]+Sign[JuncDopant[[2,1]] ]*FermiLevel[JuncDopant[[2]] ,T,SemiParm] ;
V0=ContactV-Vbias ;
If[x≥- x1,-Sign[JuncDopant[[1,1]] ]*Vbias,  ]
];
CarrierEqui[x_, T_,JuncDopant_, SemiParm_]:= Module[{Eg, me, gc, mh,ϵ 
,NC0,NV0, F
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{NC0,NV0}= NDOS0[SemiParm] ;
F=BandDiagram[x, T,0.,JuncDopant, SemiParm] ;
If[JuncDopant[[1,1]]>0, 
{NC0 (T^(3/2)) (E^(-F[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[2]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[1]]/(kB T)))} 
, {NC0 (T^(3/2)) (E^(-F[[1]]/(kB T))), NV0 (T^(3/2)) (E^(F[[2]]/(kB T))), NC0 (T^(3/2)) (E^(-F[[1]]/(kB T)))  +  NV0 (T^(3/2)) (E^(F[[2]]/(kB T)))}
]
];
CarrierJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]≥ 0., NV0 (T^(3/2.)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2.)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]≥ 0., NC0 (T^(3/2.)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2.)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]≥ 0.,
If[x≤ -x1, q1 G  (E^((x+x1)/Lp)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Ln)), ]
]
, If[x≤ -x1, q1 G  (E^((x+x1)/Ln)),
If [x≥ x2, q2 G  (E^(-(x-x2)/Lp)), ]
]
]
]  ;
DiffJ[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2
,q1,q2,F1,F2,G
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,Vbias,JuncDopant, SemiParm] ;
F1=BandDiagram[-x1, T,0.,JuncDopant, SemiParm] ;
F2=BandDiagram[x2, T,0.,JuncDopant, SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
G=Exp[Vbias/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,Lp q1 G  (E^((x+x1)/Lp))/τ,
If [x≥ x2,Ln q2 G  (E^(-(x-x2)/Ln))/τ, ]
]
, If[x≤ -x1,Ln q1 G  (E^((x+x1)/Ln))/τ,
If [x≥ x2,Lp q2 G  (E^(-(x-x2)/Lp))/τ, ]
]
]
]  ;
DiffJEB[x_, T_,Vbias_,JuncDopant_, SemiParm_,DiffParm_,BJTDim_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2,Y, y1,y2
,q1,q2,F1,F2,VEB,VCB,GEB,GCB
,WEm,WB,WCol,dbase
, kB=  8.61739*10^(-5)},

(* See lecture note:
  (Subscript[I, E;p])=(q/(Subscript[τ, B;p]))  (Subscript[L, B;p]) A (Subscript[p, Bo ]) (((E^(q (Subscript[V, EB])/(Subscript[k, B])T))-1)  Cosh[((x/(Subscript[L, B;p])))]-((E^(q (Subscript[V, CB])/(Subscript[k, B])T))-1) Csch[((W/(Subscript[L, B;p])))])  ;
  (Subscript[I, E;n])=(q/(Subscript[τ, E;n])) A (Subscript[L, E;n]) (Subscript[n, Eo]) ((E^((q (Subscript[V, EB]))/(T (Subscript[k, B]))))-1) coth(((Subscript[W, Em])/(Subscript[L, En])))  

*)
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
{VEB,VCB}=Vbias ;
{WEm,dbase,WCol}=BJTDim ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
{NC0,NV0}= NDOS0[SemiParm] ;
{W, x1,x2} =DepletionW[T,VEB,Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,VCB,Take[JuncDopant,{2,3}], SemiParm] ;
WB=dbase-x2-y1 ;
F1=BandDiagram[-x1, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
F2=BandDiagram[x2, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
GEB=Exp[VEB/(kB T)]-1;GCB=Exp[VCB/(kB T)]-1;
If[JuncDopant[[1,1]]>0,
If[x≤ -x1,(Ln/τ) q2 (GEB  ((Cosh[(x+x1+WEm)/Ln])/(Sinh[WEm/Ln]))),
If [x≥ x2,(Lp/τ) q1 (GEB  ((Cosh[(x-x2)/Lp])/(Sinh[WB/Lp])) -GCB  ((Cosh[(W-x+x2)/Lp])/(Sinh[WB/Lp]))), ]
]
, If[x≤ -x1,(Ln/τ) q1 (GEB  ((Cosh[((x+x1)+WEm)/Ln])/(Sinh[WEm/Ln]))),
If [x≥ x2,(Lp/τ) (q2/(Sinh[WB/Lp])) (GEB  Cosh[(WB-x+x2)/Lp] -GCB  Cosh[(x-x2)/Lp]), ]
]
]
]  ;
VEBfi[IBE_, LEn_,WEm_,T_]:= Module[{kB=8.61739*10^(-5),veb },veb/.  Quiet[FindRoot[ IBE == (10^(-10)) (((-1+(E^(veb/(T kB)))) Cosh[(WEm/LEn)]  Csch[(WEm/LEn)])/LEn)    ,{veb,0.01,0.6}, AccuracyGoal-> 8] ]
]  ;

JCol[{VEB_,VCE_},T_,JuncDopant_, SemiParm_,DiffParm_,BJTDim_]:= Module[{Eg, me, gc, mh,ϵ
, μn,μp,τ,Ln, Lp 
,NC0,NV0
, W, x1,x2,Y, y1,y2
,q1,q2,F1,F2,VBC,GEB,GCB
,WEm,WB,WCol,dbase
, kB=  8.61739*10^(-5)},
{ Eg, me, gc, mh,ϵ}=SemiParm  ; 
{ μn,μp,τ,Ln,Lp}=DiffParm  ;
VBC= -VCE+VEB;
{WEm,dbase,WCol}=BJTDim ;
If[Ln==0. || TrueQ[Ln== Null], Ln=10^4*Sqrt[μn kB T τ], ];
If[Lp==0. || TrueQ[Lp ==  Null],Lp=10^4*Sqrt[μp kB T τ], ];
(* {NC0,NV0}= NDOS0[SemiParm] ; *)
{W, x1,x2} =DepletionW[T,VEB,Take[JuncDopant,{1,2}], SemiParm] ;
{Y, y1,y2} =DepletionW[T,VBC,Take[JuncDopant,{2,3}], SemiParm] ;
WB=dbase-x2-y1 ;
(* F1=BandDiagram[-x1, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
F2=BandDiagram[x2, T,0.,Take[JuncDopant,{1,2}], SemiParm] ;
q1=If[JuncDopant[[1,1]]>0, NV0 (T^(3/2)) (E^(F1[[1]]/(kB T))), NC0 (T^(3/2)) (E^(-F1[[1]]/(kB T)))] ;
(* q1 is excess current factor for Emitter  *)
q2=If[JuncDopant[[1,1]]>0, NC0 (T^(3/2)) (E^(-F2[[2]]/(kB T))), NV0 (T^(3/2)) (E^(F2[[2]]/(kB T)))] ;
(* q2 is excess current factor for Base  *)
*)
GEB=Exp[VEB/(kB T)]-1;GCB=Exp[VBC/(kB T)]-1;
(*  (Subscript[I, C;p])=(q/(Subscript[τ, B;p]))  (Subscript[L, B;p]) A (Subscript[p, Bo ]) (((E^(q (Subscript[V, EB])/(Subscript[k, B])T))-1)  Csch[((W/(Subscript[L, B;p])))]-((E^(q (Subscript[V, CB])/(Subscript[k, B])T))-1) Coth[((W/(Subscript[L, B;p])))])  *)
Lp*(10^(-10))  (GEB  (1/(Sinh[WB/Lp])) -GCB  ((Cosh[WB/Lp])/(Sinh[WB/Lp])))  (*   (q2/τ)  *)

]  ;

 start=0, ];
Manipulate[
If[ONOFF=="ON",
Manipulate[
SemiParm={ Eg, me,gc, mh,ϵ } ;  

Manipulate[
DiffParm ={μn,μp,10^τ,Ln,Lp};
BJTDim ={WEm,dbase,10.};
dtype=If[dope=="p-n-p",-1,1] ;
ContactVEB=Eg+dtype*FermiLevel[{dtype,10^d1},T,SemiParm]-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm] ;
ContactVBC=Eg-dtype*FermiLevel[{-dtype,10^d2},T,SemiParm]+dtype*FermiLevel[{-dtype,10^d3},T,SemiParm] ; 
JuncDopant={ {dtype,10^d1},{-dtype,10^d2} ,{dtype,10^d3}};
IVgraph=  Plot[  Table[JCol[{ VEBfi[jBE*0.1+0.005, Ln,WEm,T] ,xVCE},T,JuncDopant, SemiParm,DiffParm,BJTDim],{jBE,0,5}]
 ,  {xVCE,0.01,0.8}
, PlotStyle->{Hue[0.6,1.,0.75], Thickness[0.01] }  
,PlotRange->{0,10.}
, Frame-> True, GridLines-> Automatic
,FrameLabel->{"VCE voltage (rel. unit.)","Collector current (a. u.)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]];
Manipulate[
VEBf = VEBfi[IBE, Ln,WEm,T] ;
Show[IVgraph, Plot[  JCol[{VEBf ,yVCE},T,JuncDopant, SemiParm,DiffParm,BJTDim] ,  {yVCE,0.01,0.8}
,PlotRange->{0,10.}
, PlotStyle->{Hue[0.35,1.,0.75],Thickness[0.01]}
(* , Frame-> True, GridLines-> Automatic
,FrameLabel->{"VCE voltage (rel. unit.)","Collector current (a. u.)"}
,LabelStyle->Directive[14,FontFamily-> "Arial"]  *)]  
,Graphics[{Red,PointSize[0.03],Point[{VECr,JCol[{VEBf ,VECr},T,JuncDopant, SemiParm,DiffParm,BJTDim] }]}] ]
,{{IBE,0.25,"Base current (a. u.)"},0.01,0.5},{{VECr,0.4,"E-C bias (a. u."},0.005,0.8}]
,
{{dope,"p-n-p"},{"p-n-p"}}
,{{d1,18.5,"Emitter doping ^10"},18,19}
,{{d2,16,"Base doping ^10"},15,17}
,{{d3,17,"Collector doping ^10"},16,18}
,{{T,300,"Temperature (K)"},100,380}
,{{dbase,20,"Base length (μm)"},10,50}
,{{WEm,1,"Emitter length (μm)"},1,5}
,{{ Ln,50,"e diff length (μm)"},1.,100.}
,{{ Lp,20.,"h diff length (μm)"},1.,20.}
]
,Grid[{{ Control[{{Eg,1.1,"Bandgap (eV)"},0.3,4}]
,Control[{{ϵ,11.8,"Dielectric const."},4,20}]}
,{Control[{{me,0.33,"Elec eff mass me*"},0.02,0.5}]
,Control[{{mh,0.81,"Hole eff mass mh*"},0.02,1}]}
,{Control[{{gc,6,"Cond band degeneracy"},{1,6}}]}
,{Control[{{ μn,800.,"e mobility"},100.,10000.}]
,Control[{{ μp,200.,"h mobility"},10.,1000.}]
,Control[{{ τ,-6,"carrier lifetime (10^)"},-12,-6}]
}
}]
], ]
,{{ONOFF,"ON","Click OFF if not used"},{"ON","OFF"}}
],
{{start,1,"Click to start"},{0,1}} ]

Here, we plot the IV family of curve of collector hole current as a function of the emitter-collector bias for increasing base-emitter electron current: this is the transistor action: it is “current switching current”: a little base-emitter electron current can control a large collector hole current: it’s like a lever, or better description: current amplification. This was done with a simplifed approximation that allows faster execution to give the results below.

4.4 Summary on base current

4.4.1 Discussion

There are 2 main components of base current
1- electron diffusion current from base to emitter (forward diode)
2- electron remobination with the hole current from emitter to collector that passes through the base.
We can ignore the electron current from collector to base (reverse diode)
Both of this have been discussed above. Here we put them together:
Component 1:

Component 2
             (Subscript[I, Ep]) - (Subscript[I, Cp ])=  - q A DBp ( (((p2 csch((WB/LBp)))/LBp)-((p1 coth((WB/LBp)))/LBp)) - (((p2 coth((WB/LBp)))/LBp)-((p1 csch((WB/LBp)))/LBp)))

ClearAll[p1,p2, WB, LBp]  ;
FullSimplify[ (((p2 csch((WB/LBp)))/LBp)-((p1 coth((WB/LBp)))/LBp)) - (((p2 coth((WB/LBp)))/LBp)-((p1 csch((WB/LBp)))/LBp))]

remember that p2 is <<< p1, so the electron recombination current is ~  q A DBp   ((p1 tanh((WB/(2 LBp))))/LBp) ~  q A (DBp/LBp)  pBo  ((e^(q VEB/((Subscript[k, B]) T)   ))-1)  tanh((WB/(2 LBp)))
There are two components of electron currents: how to reduce each and under what conditions can they be made small?
nEo  vs.  pBo tanh((WB/(2 LBp))): very short base to reduce electron recombination current.

4.4.2 Summary

To lower the base current, we need:
1- highly asymmetric doping between emitter (heavy) and base (light) (relative only)
2- long emitter
3- short base