Numerical integral over the whole spherical volume of a crystallite

20 views (last 30 days)
I am new to matlab. I want to solve the above equation to get the total carrier concentration in the spherical grain volume;
below are the values of the parameters:
Total Volume of the sphere= 4/3*pi*r^3
r= 40*10^-9 %meters
Ld= 18*10^-9 %meters
phi= 20
Nd= 1e23

Accepted Answer

Torsten
Torsten on 5 Jun 2019
Nd = 1e23;
phi = 20;
Ld = 18e-9;
R = 40e-9;
fun = @(r) 4*pi*r.^2.*(1-exp(phi + 1/6*(r/Ld).^2));
value_integral = Nd*integral(fun,0,R)
  10 Comments
Anil Kumar
Anil Kumar on 7 Jun 2019
Thanks Sir! I learnt a lot through these queries! Thanks for everything!
Anil Kumar
Anil Kumar on 7 Jun 2019
I have another issue. I want to integrate "funneff" and want to plot neff against Nt! Problem is that I am not able to integrate the function "funneff". Also how to plot neff v/s Nt ? below is my code. Thanks in advance!
Nd = 1e24;
N = 100;
e = 12*1e-12;
% R = [10e-9,20e-9,30e-9,40e-9];
R = [1e-9,2e-9,3e-9,4e-9,5e-9,6e-9,7e-9,8e-9];
Et_Ef = -1.21*1.6*1e-19;
K = 1.3807e-23;
T = 600;
Nt = linspace(1e13,1e16,N);
q = 1.6e-19;
Ld = sqrt(e*K*T/(q^2*Nd));
for j = 1:numel(R)
for i= 1:N
funct = @(R,phi0) (4*pi*(Nd-Nd*exp(-phi0))*R.^2);
equation = @(phi0)integral(@(R)funct(R,phi0),0,R(j))-(4*pi*R(j)^2*Nt(i)/(1+2*exp((Et_Ef + K*T *(phi0 + (1/6)*(R(j)/Ld)^2))/(K*T))));
%equation = @(phi0)integral(@(r)funct(r,phi0),0,R)-(4*pi*R^2*Nt(i)/(1+2*exp((Et_Ef + K*T *(phi0 + (1/6)*(R/Ld)^2))/(K*T))));
phi0val(j,i) = fzero(equation,40);
%phi0val(i) = fzero(equation,40)
end
end
% plot(Nt,phi0val(1,:))
% hold on
% plot(Nt,phi0val(2,:))
% hold on
% plot(Nt,phi0val(3,:))
% hold on
% plot(Nt,phi0val(4,:))
% hold on
% plot(Nt,phi0val(5,:))
% hold on
% plot(Nt,phi0val(6,:))
% hold on
% plot(Nt,phi0val(7,:))
% hold on
% plot(Nt,phi0val(8,:))
for j = 1:numel(R)
for i=1:N
funneff= @(R)1./(4/3.*pi.*R(j).^3).*(Nd.*exp(-phi0val(j,i))).*R(j).^2
neff(j,i)= integral(funneff,0,R(j),'Arrayvalued',true)
end
end
plot(neff(1,:),phi0val(1,:))
hold on
plot(neff(2,:),phi0val(2,:))
hold on
plot(neff(3,:),phi0val(3,:))
hold on
plot(neff(4,:),phi0val(4,:))
hold on
plot(neff(5,:),phi0val(5,:))
hold on
plot(neff(6,:),phi0val(6,:))
hold on
plot(neff(7,:),phi0val(7,:))
hold on
plot(neff(8,:),phi0val(8,:))

Sign in to comment.

More Answers (1)

darova
darova on 4 Jun 2019
Suggestion:
Use integral or trapz

Categories

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

Community Treasure Hunt

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

Start Hunting!