Info

This question is closed. Reopen it to edit or answer.

Error occurs while 3d integration

6 views (last 30 days)
dont panic
dont panic on 26 Sep 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello everybody,
I'm trying to run a 3d integration programm while keeping field parameters and at a few field points i get the following error message:
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on
error is 1.1e-04. The integral may not exist, or it may be difficult to approximate
numerically to the requested accuracy.
The function with the integral looks like this :
mp=zeros(size(R));
for k=1 : numel(mp)
k
f= @(r,phi,z)(M/(4*pi))*((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,'Method','iterated');
end
I have just copied the integral function as the rest of the code works and is not well structured. The problem is that the field points in which this errors occur are left blank in the surf plot and therefore the result is pretty useless.
Thank you for your help in advance
  1 Comment
Walter Roberson
Walter Roberson on 26 Sep 2013
What can we assume about the values? Are R1, R2, phi1, phi2, Z1, Z2 all real-valued, with R1 <= R2, phi1 <= phi2, Z1 <= Z2? And are M, Z(k), R(k), phis all real-valued? Are all the Z(k) < Z1, or are they all > Z2, or are there some from [Z1, Z2] ?
When cos(phis-phi) is +/- 1, then there are additional solutions not otherwise available.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!