Electron concentration as a function of quasi fermi level

Hi I want to plot electron and hole concentration as a function of quasi fermi level.
Electron (n) and hole (p) concentration are
and I want to plot them as function of
n as function of Efn and p as function of Efp and resulting graph should look like
How can i make this plot in matlab. I will require some detail answer as i am newbie to matlab. Thanks

Answers (3)

It is possible you could have trouble numerically evaluating those integrals as x (and y) approach infinity. The integrand, x^(1/2)/(1+exp(x-x0)), will approach infinity-divided-by-infinity and could produce a NaN in matlab. If so, you might find it useful to make a change of variable. Let z = x^(3/2) so that x^(1/2)*dx = 2/3*dz which will eliminate the infinity in the numerator. Of course, make the corresponding change in 1+exp(x-x0) to 1+exp(z^(2/3)-x0).
By the way, what are you varying to make Efn and n change? Is it x0?
yes its x0. I want to solve integral to find value of x0 and y0 as rest of all in equations are known and i could not understand fully your previous comment. Can you kindly provide more detail. Thanks
I am getting index must be positive integer or logical. Kindly check whats the error in code.
T=300;
me=0.067*9.31e-31;
mh=0.055*9.31e-31;
K=8.617e-5;
h=6.64e-34;
n=[];
x0=[];
Efn=[];
for ii= -20:0.01:20
if ii<=-1
n(ii)= 4*3.14*(((2*me*K*T)^1.5)/h^3)*(sqrt(pi)/2)*exp(ii)
x0(ii)= (sqrt(pi)/2)*exp(ii)
end
if ii>=1
n(ii)= 4*3.14*(((2*me*K*T)^1.5)/h^3)*(2/3)*ii.^1.5
x0(ii)= (2/3)*ii.^1.5
end
Efn=2.84-(K*T.*x0)
end
plot(Efn,n)

2 Comments

I made that suggestion assuming you would use one of matlab's numerical quadrature functions to evaluate the integral you have given here. However, I see no resemblance to a valid evaluation of this integral in your code as you produce 'n'. For example, note that for negative values of ii, the quantity ii.^1.5 becomes complex-valued.
Your error message is due to using fractional values for ii as indices into n and x0. That is not the way to store values in an array. You should read up on indexing in arrays.
However, far more fundamental is getting those two integrals correctly evaluated for each different value of x0 that you are interested in.
actually i tried some approximations in the code but they are not working and it seems i will have to solve the integral. Can you help on that?

Sign in to comment.

Categories

Find more on Particle & Nuclear Physics in Help Center and File Exchange

Asked:

on 5 Mar 2014

Commented:

on 6 Mar 2014

Community Treasure Hunt

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

Start Hunting!