Semiconductors

Some costants

kb=8.617332479*^-05; (* eV/K *)

bands (k in random units)

bv[k_,eg_,mc_]:=-eg/2-k^2/(2mc)
bc[k_,eg_,mv_]:=eg/2+k^2/(2mv)

density of states and fermi function.

gg=1.*^12 (*makes DoS close to one in typical cases *)
gc[e_,eg_,mc_]:=gg*Piecewise[{{0,e<eg/2},{mc Sqrt[2 mc (e-eg/2)], e>=eg/2}}]
gv[e_,eg_,mv_]:=gg*Piecewise[{{0,e>-eg/2},{mv Sqrt[2 mv (-eg/2-e)], e<=-eg/2}}]
fd[e_,mu_,beta_]:=1/(1+Exp[(e-mu)*beta])

total charge imbalance. gives difference between number of electrons and number of holes

ni[mu_?NumericQ,beta_,eg_,mc_,mv_]:=NIntegrate[fd[e,mu,beta]gc[e,eg,mc],{e,eg/2,eg/2+10/beta}]-NIntegrate[(1-fd[e,mu,beta])gv[e,eg,mv],{e,-eg/2-10/beta,-eg/2}]

finds the chemical potential that balances the charge density given an extrinsic doping (n-p) dn

findmu[dn_,beta_,eg_,mc_,mv_]:=(
fr=FindRoot[ni[mu,beta,eg,mc,mv]-dn,{{mu,0.,1/beta}}];
 mu/.fr)

analyze a semiconductor with given parameters and at a given temperature

Module[{mu,ne,nh},
analyze[nn_,np_,beta_,eg_,mc_,mv_]:=(
mu=findmu[nn-np,beta,eg,mc,mv];
ne=NIntegrate[fd[e,mu,beta]gc[e,eg,mc],{e,eg/2,eg/2+10/beta}];
nh=NIntegrate[(1-fd[e,mu,beta])gv[e,eg,mv],{e,-eg/2-10/beta,-eg/2}];
{mu,ne,nh}
)]

{dummy, ni0si, dummy} =analyze[0.0,0.0,1/(kb*300),1.125,1,1]

n0si=1.5*^10  (* typical carrier density in Si, in cm^-3. we can use this to determine the scaling factor for all of the n's to get the scaling factor to all of the above *)
nscale = n0si/ni0si

analyze[0.0,0.0,1/(kb*300),1.125,1.0,1.0]

Intrinsic&Extrinsic SemiConductor

Module[{mymu,myne,mynh},
manip=Manipulate[(
{mymu,myne,mynh}={1,nscale,nscale}*Quiet[analyze[nn/nscale,pp/nscale,1/(kb*tt),egap,fmecond,fmeval]];
Column[{
Row[{
"(Subscript[N, (SuperMinus[e])]) =  ",ScientificForm[myne,3] ," (cm^(-3))","   ",
"(Subscript[N, (SuperPlus[h])]) =  ",ScientificForm[mynh,3]," (cm^(-3))","   ",
"μ =  ",NumberForm[mymu,{3,2}]," eV"
}],
Row[{Show[Plot[{bc[x,egap,fmecond],bv[x,egap,fmeval]}, {x,-1, 1} ,PlotRange->{-1.25, 1.25},PlotStyle->{Red,Blue}],
AspectRatio->GoldenRatio/2.1,LabelStyle->{14},ImageSize->Medium, Frame->True,FrameLabel->{"k","ϵ[eV]","",""}
],Show[ParametricPlot[{nscale gc[x,egap,fmecond]/1*^20,x}, {x,egap/2, 2} ,PlotRange->{{-1,100},{-1.25, 1.25}},PlotStyle->Red],ParametricPlot[{nscale gv[x,egap,fmeval]/1*^20,x}, {x,-2,-egap/2} ,PlotRange->{{-1,100},{-1.25, 1.25}},PlotStyle->Blue],
Graphics[{EdgeForm[Red],FaceForm[White],Rectangle[{0,0.95},{nn/1*^19,1.05}],
EdgeForm[Blue],Rectangle[{0,-0.95},{pp/1*^19,-1.05}],
}],
ParametricPlot[{100fd[x,mymu,1/(kb*tt)],x}, {x,-2,2} ,PlotRange->{{-1,100},{-1.25, 1.25}},PlotStyle->Black],
AspectRatio->GoldenRatio/2.1,LabelStyle->{14},ImageSize->Medium, Frame->True,FrameLabel->{"g(ϵ)/(10^20)[(cm^(-3))/eV]","ϵ[eV]","f(ϵ)*100",""}
]}]

}]
),
{{egap,1.12,"(Subscript[E, g]) [eV] ="},0.1, 2, 0.05,Appearance->"Labeled"}, {{tt,300,"T [K] ="},30, 4000, 10,Appearance->"Labeled"}, {{fmecond,1,"(Subscript[m, c]^( * )) [(Subscript[m, e])] ="},0.1,10,Row[{Slider[Dynamic[Log10[#],(fmecond=10^#)&],Log10[#2]]," ",InputField[#,Appearance->"Frameless",BaseStyle->"Label"]}]&}, {{fmeval,1,"(Subscript[m, v]^( * )) [(Subscript[m, e])] ="},0.1,10,Row[{Slider[Dynamic[Log10[#],(fmeval=10^#)&],Log10[#2]]," ",InputField[#,Appearance->"Frameless",BaseStyle->"Label"]}]&}, Delimiter,{{nn,1*^5,"[n] [(cm^(-3))] ="},1.*^5,1.*^23,Row[{Slider[Dynamic[Log10[#],(nn=10^#)&],Log10[#2]]," ",InputField[#,Appearance->"Frameless",BaseStyle->"Label"]}]&}, {{pp,1*^5,"[p] [(cm^(-3))] ="},1.*^5,1.*^23,Row[{Slider[Dynamic[Log10[#],(pp=10^#)&],Log10[#2]]," ",InputField[#,Appearance->"Frameless",BaseStyle->"Label"]}]&} , SaveDefinitions->True, Paneled->False]
]

CDFDeploy[NotebookDirectory[]<>"semiconductors-new.cdf",manip]