Effacer les filtres
Effacer les filtres

3D numerical integration error

2 vues (au cours des 30 derniers jours)
dont panic
dont panic le 24 Sep 2013
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 commentaire
Mike Hosea
Mike Hosea le 24 Sep 2013
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by