% --------------------------------------------------------------------------------
% MATLAB code used to generate the figures in the book:
%
% "Quantum Transport: Atom to Transistor," by Supriyo Datta
% published by Cambridge University Press, May 2005
% (ISBN-10: 0521631459 | ISBN-13: 9780521631457)
% http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521631459
%
% THIS FILE FOR: Chapter 1, Figure 1.4.6
%
% --------------------------------------------------------------------------------
% Copyright (c) 2005 Supriyo Datta
% --------------------------------------------------------------------------------
clear all
%Constants (all MKS, except energy which is in eV)
hbar=1.055e-34;q=1.602e-19;I0=q*q/hbar;
%Parameters
U0=0.025;kT=0.025;mu=0;ep=0.2;
g1=0.005;g2=0.005;g=g1+g2;
alphag=0;alphad=0.5;
%Energy grid
NE=501;E=linspace(-1,1,NE);dE=E(2)-E(1);
D=(g/(2*pi))./((E.^2)+((g/2)^2));% Lorentzian Density of states per eV
D=D./(dE*sum(D));%Normalizing to one
%Reference number of electrons
f0=1./(1+exp((E+ep-mu)./kT));N0=2*dE*sum(D.*f0);%/cm^2
%Bias
IV=101;VV=linspace(0,1,IV);
for iV=1:IV
Vg=0;Vd=VV(iV);
%Vd=0;Vg=VV(iV);
mu1=mu;mu2=mu1-Vd;UL=-(alphag*Vg)-(alphad*Vd);
U=0;%Self-consistent field
dU=1;
while dU>1e-6
f1=1./(1+exp((E+ep+UL+U-mu1)./kT));
f2=1./(1+exp((E+ep+UL+U-mu2)./kT));
N(iV)=dE*sum(D.*((f1.*g1/g)+(f2.*g2/g)));
Unew=U0*(N(iV)-N0);dU=abs(U-Unew);
U=U+0.1*(Unew-U);
end
I(iV)=dE*I0*(sum(D.*(f1-f2)))*(g1*g2/g);
end
hold on
%h=plot(VV,N,'b');
h=plot(VV,I,'b');
set(h,'linewidth',[2.0])
set(gca,'Fontsize',[25])
xlabel(' Voltage ( V ) --->')
ylabel(' Current ( A ) ---> ')
%ylabel(' Number of electrons ---> ')
grid on