% ele533 problem 2.12  and 2.13

Na = [1e15 1e17 1e19 1e21 1e19];
Nd = [1e15 1e17 1e19 1e21 1e16];
VT = 0.0259;
ni = 1.5e10;
nis = ni^2;

Vbi = VT*log(Na.*Nd/nis)
e = 1e-12;
q = 1.6e-19;
xd=sqrt(e*Vbi./(q*Nd));
xd(5) = sqrt(2)*xd(5);
xd

%   Result

%   Vbi = 0.5754    0.8139    1.0525    1.2910    0.8736


%   xd =1.0e-004 * 0.5997    0.0713    0.0081    0.0009    0.3304

%   If  a 10 volt reverse bias is applied

xd=sqrt(e*(Vbi+10)./(q*Nd));
xd(5) = sqrt(2)*xd(5);
Emax = (q/e)*Nd.*xd
Emax - 3e5          % 3e5 is the critical field for breakdown

% xd = 1.0e-004 * 0.5997    0.0713    0.0081    0.0009    0.3304

% Emax = 1.0e+007 * 0.0041    0.0416    0.4205    4.2504    0.0187

% Emax - 3e5 =  1.0e+007 * -0.0259    0.0116    0.3905    4.2204   -0.0113

% Emax is less than Ec=3e5, the breakdown field, only for cases 1 and 5
