#Calculate the conductivity of the diode
e=1.6*(10**-19) #charge of electron in C
nl=(10**10)*(10**6) #electron density at lower valley in /m**3
nu=(10**8)*(10**6) #electron density at upper valley in /m**3
ul=8000*(10**-4) #electron mobility at lower valley in m2/V-sec
uu=180*(10**-4) #electron mobility at upper valley in m2/V-sec
o=e*((nl*ul)+(nu*uu))
o=o*1000 #in milli mhos
print"The conductivity of the diode(in mmhos)is=",round(o,2),"mmhos"
#(a)Calculate the electron drift velocity
q=1.6*(10**-19) #charge of electron in C
f=10*(10**9) #operating frequency in Hertz
L=10*(10**-6) #Device Length in meter
vd=f*L
print"The electron drift velocity is =","{:.0e}".format(vd),"m/s","{:.0e}".format(vd*100),"cm/s"
#(b)Calculate the current density
n=2*(10**14)*(10**6)
J=q*n*vd
print"The current density is =","{:.1e}".format(J),"A/m2 =",int(round(J/(10**4))),"A/cm2"
#(c)CAPTION: Calculate the negative electron mobility
E=3200 #applied field
vd=vd*(100) #in cm/sec
un=-1*vd/E
print"Negative electron mobility(in cm**2/V*sec) is =",int(round(un)),"cm2/V.s" #answer is wrong in book
#Determine the criteria for classifying the modes of operation
er=13.1 #relative dielectric constant
vd=2.5*(10**5) #electron drift velocity in m/sec
e=1.6*(10**-19) #charge of electron in C
E=8.854*(10**-12)*er #permittivity of GaAs in F/m
un=-0.015 #negative electron mobility in m**2/v.s
un=-1*un
a=(E*vd)/(e*un)
print"The criteria is=","{:.3e}".format(a),"/m2 =","{:.3e}".format(a/10000),"/cm2" #calculation mistake in book
print"This means that the product of doping concentration and the device length must be"
print"noL >","{:.3e}".format(a/10000),"/cm2"
#Calculate the output power
n=0.06 #conversion efficiency
M=3.5 #Multiplication factor
Eth=320*(10**3) #threshold field in V/m
L=12*(10**-6) #Device Length in m
n0=10**21 #Donor concentration in m**3
e=1.6*(10**-19) #charge of electron in C
v0=1.5*(10**5) #Average carrier velocity in m/sec
A=3*(10**-8) #Area m**2
p=n*(M*Eth*L)*(n0*e*v0*A)
p=p*1000 # in mW
print"The output power(in mW)is=",int(round(p)),"mW"