3D numerical integration error

조회 수: 3 (최근 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에서 Programming에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by