In [2]:

```
hw=1.7
Eg = 1.43
alpha= 4.21*10**4*((hw-Eg)/(hw))
print"The absorption coefficient(alpha) for GaAs is ,alpha=","{:.1e}".format(alpha),"cm**-1"
```

In [3]:

```
hw=1.43
alpha = 2.5*10**4
amt = 0.9
L= -(1/alpha)*log(1-amt)
print"The length of the material is ,L=","{:.2e}".format(L),"cm"
```

In [4]:

```
Pop = 10.0
hw=1.65
alpha = 7*10**3
T = 10**-9
GL = (alpha*Pop)/(hw*1.6*10**-19)
print"The rate of e-h pair production is ,GL =","{:.2e}".format(GL),"cm**-3s**-1"
dn = (GL*T)
print"The excess carrier density is ,dn =","{:.2e}".format(dn),"cm**-3"
```

In [2]:

```
A= 10**4*10**-8
Na=2*10**16
Nd=10**16
Dn = 20
Dp = 12
Tn = 10**-8
Tp = 10**-8
GL = 10**22
kbT = 0.026
Es = 11.9*8.85*10**-14
e = 1.6*10**-19
VR = 2.0
ni = 1.5*10**10
Ln = sqrt(Dn*Tn)
print"The electron diffusion length is ,Ln =","{:.1e}".format(Ln),"cm"
Lp = sqrt(Dp*Tp)
print"The hole diffusion length is ,Lp =","{:.2e}".format(Lp),"cm"
Vbi = kbT*log((Na*Nd)/(ni)**2)
print"The built in voltage is ,Vbi =","{:.2e}".format(Vbi),"V"
W = sqrt((2*Es*(Na+Nd)*(Vbi+VR))/(e*Na*Nd))
print"The depletion width is ,W =","{:.2e}".format(W),"cm"
IL= (e*A*GL*(W+Ln+Lp))
print"The photocurrent is ,IL=","{:.2e}".format(IL),"A"
```

In [4]:

```
A= 1.0
Na=5*10**17
Nd=10**16
Dn = 20.0
Dp = 10.0
Tn = 3*10**-7
Tp = 10**-7
kbT = 0.026
IL = 25*10**-3
e = 1.6*10**-19
ni = 1.5*10**10
Ln = sqrt(Dn*Tn)
print"The electron diffusion length is ,Ln =","{:.2e}".format(Ln),"cm"
Lp = sqrt(Dp*Tp)
print"The hole diffusion length is ,Lp =","{:.2e}".format(Lp),"cm"
Io = A*e*(ni)**2*((Dn/(Ln*Na))+(Dp/(Lp*Nd)))
print"The saturation current is ,Io =","{:.2e}".format(Io),"A"
Voc= (kbT)*log(1+(IL/Io))
print"The open circuit voltage is ,Voc=","{:.1e}".format(Voc),"V"
```

In [6]:

```
A= 1.0
Na=5*10**17
Nd=10**16
Dn = 20.0
Dp = 10.0
Tn = 3*10**-7
Tp = 10**-7
kbT = 0.026
IL = 25*10**-3
e = 1.6*10**-19
ni = 1.5*10**10
Io = 3.66*10**-11
Voc= (kbT)*log(1+(IL/Io))
print"The open circuit voltage is ,Voc=","{:.2e}".format(Voc),"V"
P = 0.8*IL*Voc
print"The power per solar cell is ,P=","{:.2e}".format(P),"W"
# Note: Answer given in the book is incorrect it is 10.6 mW not 1.06 mW
N_series = 10/(0.9*Voc)
print"The number of solar cell needed to produce output power 10V is ,N_series =",round(N_series,2)
N_parallel = 10/(0.9*IL*10)
print"The number of solar cell needed to produce output power 10W is ,N_parallel =",round(N_parallel,2)
# Note : due to different precisions taken by me and the author ... my answer differ
```

In [9]:

```
Pop = 1.0
hw=1.43
a = 700.0
W = 10**-3
e = 1.6*10**-19
Phi_o =(Pop)/(hw*1.6*10**-19)
print"The photon flux incident on the detector Phi_o =","{:.2e}".format(Phi_o),"cm**-2s**-1"
JL=e*Phi_o*(1-exp(-(a*W)))
print"The photocurrent density is ,JL=","{:.2e}".format(JL),"A/cm**2"
```

In [18]:

```
import math
h=1.05*10**-34
mo = 9.1*10**-31
me = 0.067*9.1*10**-31
kbT = 0.026
mh = 0.45*9.1*10**-31
To = 0.6*10**-9
p = 1.0*10**21
T = (p/(2.0*To))*((2.0*(math.pi)*h**2)/(kbT*1.6*10**-19*(me+mh)))**(3.0/2.0)
print"T =","{:.2e}".format(T),"s**-1"
Tr = 1.0/T
print"The e-h recombination time is Tr =""{:.2e}".format(Tr),"s"
```

In [19]:

```
h=1.05*10**-34
mo = 9.1*10**-31
me = 0.067*9.1*10**-31
kbT = 0.026
mh = 0.45*9.1*10**-31
To = .6*10**-9
tnr = 10**-7
p = 10**21
mr = 1.0/((1.0/me)+(1.0/mh))
print"The reduced mass for the e-h system is mr* =","{:.2e}".format(mr),"kg"
print" For low p-doping such as 10**16, the recombination time is given as below"
T1 = (p/(2.0*To))*((2.0*(math.pi)*h**2)/(kbT*1.6*10**-19*(me+mh)))**(3.0/2.0)
print"T =","{:.2e}".format(T),"s**-1"
Tr1 = 1.0/T1
print"The e-h recombination time is Tr1 =","{:.2e}".format(Tr1),"s"
nQr1 = 1.0/(1+(Tr1/tnr))
print"The internal quantum efficiency is nQr1 =""{:.2e}".format(nQr1)
print" For high p-doping such as 5*10**17, the recombination time is given as below"
T2 = (1.0/To)*((mr/mh)**(3.0/2.0))
print"T2 =","{:.2e}".format(T2),"s**-1"
Tr2 = 1.0/T2
print"The e-h recombination time is Tr2 =","{:.2e}".format(Tr2),"s"
nQr2 = 1.0/(1+(Tr2/tnr))
print"The internal quantum efficiency is nQr2 =""{:.2e}".format(nQr2)
# Note : due to different precisions taken by me and the author ... my answer differ
```

In [23]:

```
Na=5*10**16
Nd=5*10**17
Dn = 30.0
Dp = 15.0
Tn = 10**-8
Tp = 10**-7
e = 1.6*10**-19
ni = 1.84*10**6
kbT = 0.026
V = 1.0
nQr=0.5
np = ni**2/Na
pn = ni**2/Nd
Ln = sqrt(Dn*Tn)
print"The electron diffusion length is ,Ln =","{:.3e}".format(Ln),"cm"
Lp = sqrt(Dp*Tp)
print"The hole diffusion length is ,Lp =","{:.2e}".format(Lp),"cm"
Yinj = ((e*Dn*np)/Ln)/(((e*Dn*np)/Ln)+((e*Dp*pn)/Lp))
print"The injection efficiency is ,Yinj =""{:.1e}".format(Yinj)
```

In [24]:

```
A= 10**-2
Na=5*10**16
Nd=5*10**17
Dn = 30.0
Dp = 15.0
Tn = 10**-8
Tp = 10**-7
e = 1.6*10**-19
ni = 1.84*10**6
kbT = 0.026
V = 1.0
nQr=0.5
Eph = 1.41
np = ni**2/Na
pn = ni**2/Nd
Ln = sqrt(Dn*Tn)
print"The electron diffusion length is ,Ln =","{:.2e}".format(Ln),"cm"
Lp = sqrt(Dp*Tp)
print"The hole diffusion length is ,Lp =","{:.2e}".format(Lp),"cm"
In = ((A*e*Dn*np)/Ln)*(exp(V/kbT)-1)
print"The injected current is ,In =","{:.2e}".format(In),"A"
Iph = (In*nQr)/e
print"The photon generated per second is ,Iph =","{:.2e}".format(Iph),"s**-1"
P = Iph*e*Eph
print"The optical power is ,P =","{:.2e}".format(P),"W"
```

In [26]:

```
R =.33
alpha_R = 20
L= (-1.0/alpha_R)*log(R)
print"The length of the cavity is ,L=","{:.2e}".format(L),"cm"
```

In [27]:

```
n = 1.1*10**18
nth=1.32*10**18
e = 1.6*10**-19
d = 2*10**-4
Tr = 2.4*10**-9
Jth = (e*nth*d)/Tr
print"The current density is Jth =","{:.2e}".format(Jth),"A/cm**2"
```