How to numerically evaluate this singular integral in integral2?

1 次查看(过去 30 天)
Hello,
I am trying to numerically evaluate a 2D integral with an integrand singular along an elliptical curve, please see the simple code below
a = 1;
b = 2;
c = 3;
k = @(x,y) 1./(sqrt(x.^2/a^2+y.^2/b^2)-c);
h = integral2(@(x,y) k(x,y) ,0,10,-10,10);
This yields warnings that "the result fails the global error test" which is evidently because the integrand is singular when
I am curious as to how this integral can be restated to make a numerical integration tractable?
Thanks!
  5 个评论
Matt J
Matt J 2024-9-5
编辑:Matt J 2024-9-5
Let us make the change of variables, .
Then the integral becomes,
Now, converting to polar coordinates,
which is obviously a non-convergent integral if and only if for any . Since the region of integration is a rectangle of width 10/b and height 10/a, that will happen if c<norm([10/a,10/b]), which it is in this case.
Ryan
Ryan 2024-9-6
Thank you Walter and Matt, I was hoping there was a way to render it numerically integratable but as demonstrated it appears that it isn't convergent to begin with.

请先登录,再进行评论。

回答(1 个)

Matt J
Matt J 2024-9-4
编辑:Matt J 2024-9-5
As demonstrated in the comment above, the integral is theoretically non-convergent unless c>=norm([10/a,10/b]). Here is a further, numerical test:
a = 1;
b = 2;
c0 = norm([10/a,10/b]); %critical threshold
c=c0*1.0001; %slightly greater than threshold
k = @(x,y) 1./(sqrt(x.^2/a^2+y.^2/b^2)-c);
h = integral2(@(x,y) k(x,y) ,0,10,-10,10)
h = -60.2647
c=c0*0.9999;%slightly less than threshold
k = @(x,y) 1./(sqrt(x.^2/a^2+y.^2/b^2)-c);
h = integral2(@(x,y) k(x,y) ,0,10,-10,10)
Warning: Reached the maximum number of function evaluations (10000). The result fails the global error test.
h = -60.4654

类别

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

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by