Wrong start of the curve in double integral

조회 수: 1 (최근 30일)
Hexe
Hexe 2023년 1월 29일
댓글: Hexe 2023년 1월 29일
Hi! I solve the double integral and it shows a right behavior of the curve, but it starts from different points at different parameters. But it should always start from the point (0,1). What is wrong?
n = 0.1 ;
t = 1;
r = 1;
s = 0:0.01:1;
b=sqrt(2*t)/r;
fun = @(x,z,k) exp(-2.*n.*t.*x.^2).*exp(-z.^2).*(erf(((z+x.*k./r)./(2.*b)))+erf(((z-x.*k./r)./(2.*b)))-z./(sqrt(pi).*b).*(exp(-((z+x.*k./r)./(2.*b)).^2)+exp(-((z-x.*k./r)./(2.*b)).^2)));
f3 = arrayfun(@(k)integral2(@(x,z)fun(x,z,k),0,Inf,0,1),s);
Cor = ((sqrt(2*n*t))/(erf(sqrt(2*n*t))*(atan(1/(2*b))-(b/(2*(b^2+0.25))))))*f3;
plot(s,Cor,'b-')

채택된 답변

C B
C B 2023년 1월 29일
n = 0.1 ;
t = 1;
r = 1;
s = 0:0.01:1;
b=sqrt(2*t)/r;
fun = @(x,z,k) exp(-2.*n.*t.*x.^2).*exp(-z.^2).*(erf(((z+x.*k./r)./(2.*b)))+erf(((z-x.*k./r)./(2.*b)))-z./(sqrt(pi).*b).*(exp(-((z+x.*k./r)./(2.*b)).^2)+exp(-((z-x.*k./r)./(2.*b)).^2)));
f3 = arrayfun(@(k)integral2(@(x,z)fun(x,z,k),0,Inf,0,1),s);
Cor = ((sqrt(2*n*t))/(erf(sqrt(2*n*t))*(atan(1/(2*b))-(b/(2*(b^2+0.25))))))*f3;
plot(s,Cor,'b-')
n = 0.1 ;
t = 1;
r = 1;
s = 0:0.01:1;
b=sqrt(2*t)/r;
fun = @(x,z,k) exp(-2.*n.*t.*x.^2).*exp(-z.^2).*(erf(((z+x.*k./r)./(2.*b)))+erf(((z-x.*k./r)./(2.*b)))-z./(sqrt(pi).*b).*(exp(-((z+x.*k./r)./(2.*b)).^2)+exp(-((z-x.*k./r)./(2.*b)).^2)));
f3 = arrayfun(@(k)integral2(@(x,z)fun(x,z,k),0,1,0,1),s);
Cor = ((sqrt(2*n*t))/(erf(sqrt(2*n*t))*(atan(1/(2*b))-(b/(2*(b^2+0.25))))))*f3;
Cor = Cor + (1 - Cor(1));
plot(s,Cor,'b-')
  댓글 수: 1
Hexe
Hexe 2023년 1월 29일
Dear Chetan Bhavsar!
Thank you very much. Now it works as it should.
Sincerely
Olha.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by