Numerical integral over the whole spherical volume of a crystallite

2 次查看(过去 30 天)
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

采纳的回答

Torsten
Torsten 2019-6-5
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 个评论
Anil Kumar
Anil Kumar 2019-6-7
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,:))

请先登录,再进行评论。

更多回答(1 个)

darova
darova 2019-6-4
Suggestion:
Use integral or trapz

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by