3D numerical integration error

1 次查看(过去 30 天)
dont panic
dont panic 2013-9-24
Hello,
i have writen a short code for the integration of a 2D integration field with 3 independent integration parameters and at a few points i get the following error message:
"Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 2.7e+00. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy."
The integral code is as follows:
for k=1 : numel(mp)
k
f= @(r,phi,z)((Z(k)-z).*r)./(R(k)^2-2.*r*R(k).*cos(phis-phi)+r.^2+(Z(k)-z).^2).^(3/2);
mp(k)=integral3(f,R1,R2,phi1,phi2,Z1,Z2,'AbsTol',1e-1,'RelTol',1e-1,'Method','iterated');
end
i haven't copied the whole script as it is not very well structured but the rest works and i have of course defines the integration boundaries (R1,R2...) before.
Thank you in advance
  1 个评论
Mike Hosea
Mike Hosea 2013-9-24
Well, you didn't supply any data for the parameters, so I made some up and had no trouble. Perhaps for some particular values of R(k), phis, Z(k), R1, R2, phi1, phi2, Z1, and Z2, that you have a singularity that is too strong for the code to integrate. If you supply the values for all the parameters in just one problem integration, perhaps someone can identify the problem.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by