Need help on difficulty 3D Plot. - Problem resolved

 Risposta accettata

Here's some code to get you started
% Data
T=300;
k=1.38064852e-23;
Ea=7.2*10^(-21);
Ed=7.2*10^(-21);
Nv=2.5*10^(25)*((0.59*T/300)^(3/2))*10^(-6);
Nc=2.5*10^(25)*((1.08*T/300)^(3/2))*10^(-6);
Ec=0.5*(1.166-0.000473*T*T/(636+T))*1.6*10^(-19);
Ev=0;
% Collect data to be passed to function
data = [T, k , Ea, Ed, Nv, Nc, Ec, Ev];
% Dopant concentrations
Nd = 10^17;
Na = 10^5;
Ef0 = 10^-21; % Initial guess at fermi energy
% Use fzero to find fermi energy, i.e. the value of Ef that makes
% function Efn return zero
Ef = fzero(@Efn, Ef0,[],data,Nd,Na);
disp(Ef)
function F = Efn(Ef,data, Nd, Na)
T = data(1);
k = data(2);
Ea = data(3);
Ed = data(4);
Nv = data(5);
Nc = data(6);
Ec = data(7);
Ev = data(8);
kT = k*T;
F = Nc*exp(-(Ec-Ef)/kT) + Na/(1+4*exp(-(Ef-Ea)/kT)) - Nv*exp(-(Ef-Ev)/kT) - Nd/(1+2*exp(-(Ed-Ef)/kT));
end
The above will calculate the Fermi level for one pair of dopant concentrations. See if you can take it from here.

3 Commenti

Thanks for the detalis explanation.
I have tried below function, but it's not work for me. Could you share more advise.
for j=1:length(Na)
for i=1:length(Nd)
F = Nc.*exp(-(Ec-Ef)./kT) + Na./(1+4.*exp(-(Ef-Ea)./kT)) - Nv.*exp(-(Ef-Ev)./kT) - Nd./(1+2.*exp(-(Ed-Ef)./kT));
end
end
The following shows how to structure the calculation for several pairs of Nd and Na. In doing this I noticed that the results were sensitive to the initial guess. This was a numerical problem related to the size of the energy levels, so in the listing below the energies are scaled (divided by kT) before being called by fzero. The resulting fermi levels are then rescaled at the end.
% Data
T=300;
k=1.38064852e-23;
Ea=7.2*10^(-21);
Ed=7.2*10^(-21);
Nv=2.5*10^(25)*((0.59*T/300)^(3/2))*10^(-6);
Nc=2.5*10^(25)*((1.08*T/300)^(3/2))*10^(-6);
Ec=0.5*(1.166-0.000473*T*T/(636+T))*1.6*10^(-19);
Ev=0;
% Scale energy levels
kT = k*T;
Ea = Ea/kT; Ed = Ed/kT; Ec = Ec/kT; Ev = Ev/kT;
% Collect data to be passed to function
data = [Ea, Ed, Nv, Nc, Ec, Ev];
% Dopant concentrations
Nd = [10^17, 10^15, 10^15, 10^3, 10^5, 10^5];
Na = [10^5, 10^3, 10^15, 10^15, 10^17, 10^5];
Ef = zeros(numel(Nd),1);
Ef0 = 10^-21/kT; % Initial guess at scaled fermi energy
% Use fzero to find fermi energy, i.e. the value of Ef that makes
% function Efn return zero
for i = 1:numel(Nd)
Ef(i) = fzero(@Efn, Ef0,[],data,Nd(i),Na(i));
end
Ef = Ef*kT; % Rescale
fprintf('%g\n',Ef)
function F = Efn(Ef,data, Nd, Na)
Ea = data(1);
Ed = data(2);
Nv = data(3);
Nc = data(4);
Ec = data(5);
Ev = data(6);
F = Nc*exp(-(Ec-Ef)) + Na*exp(-(Ef-Ea)) - Nv*exp(-(Ef-Ev)) - Nd./(1+2*exp(-(Ed-Ef)));
end
Thank you very much!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Prodotti

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by