Non-integrable multiple integrals for Mathematica

  • Mathematica
  • Thread starter Anna Kaladze
  • Start date
  • #26


It looks pretty good. Here are a couple of small suggestions.

Because you are repeating that inner-most integral so many times it is actually quite a bit more efficient to evaluate it once, construct an interpolating function and then just evaluate that interpolating function in the other integrals. It calculates about 26 times faster with little loss in accuracy.
Hi DaleSpam,
Thanks a lot for your reply and suggestions.
Can I ask for some clarifications?
When you say the innermost integral, do you refer to the one where the limits are d and b?
And then you suggest evaluating it once and then interpolating. Can you please explain how would I evaluate it? Because the limits of integrations, d, m and t are all variable, and I am not sure how to do it. If I know, I can as you suggest construct an interpolating function, but I am not sure. Can you please help?
Thanks a lot.
Anna.
 
  • #27


Hi DaleSpam,
I might have figured out what you have suggested. Can you please have a look at the attached nb file and let me know if I understood you correctly. Or if there is even more efficient way to run this procedure for my problem? I wonder if what I wrote makes things faster actually...
Thanks.
Anna.
 

Attachments

  • #28
30,386
6,880


For function interpolation you will be better off using the example I showed in post 25 than the one you used in post 27. The built-in function will look at the function it is interpolating and make sure to adapt the sampling density if the function is changing rapidly.
 
  • #29


For function interpolation you will be better off using the example I showed in post 25 than the one you used in post 27. The built-in function will look at the function it is interpolating and make sure to adapt the sampling density if the function is changing rapidly.
Thanks a lot for your help, I have not noticed your file in post 25.

I have used now this approach, and indeed it is better.

For a different function and a slightly modified ranges of the integration limits, I after I interpolatefunction, the following message:

FunctionInterpolation::ncvb: FunctionInterpolation failed to meet the prescribed accuracy and precision goals after 6 recursive bisections near j={0.}. Continuing to refine elsewhere.

I wonder if I should be ignoring this message or if it can cause any harm.

Thanks a lot.

Anna.
 
  • #30
1,069
29


I tend to be cautious and I think it would be very nice if someone would contribute the perhaps small changes needed to get rid of all the error and warning messages. Sometimes those are there for good reasons and I often learn something when I find out why.
 
  • #31
30,386
6,880


You probably have a division by 0 somewhere. Look at your variable j and see what happens near 0. Possible solutions are to interpolate the inverse of the original equation, or to simply avoid 0.
 

Related Threads on Non-integrable multiple integrals for Mathematica

Replies
9
Views
2K
Replies
3
Views
3K
Replies
3
Views
3K
Replies
1
Views
2K
Replies
1
Views
1K
Replies
7
Views
3K
Replies
2
Views
1K
Replies
8
Views
2K
Top