Post Reply 
WP34s 3924 Calculation Error
09-02-2024, 06:44 PM
Post: #2
RE: WP34s 3924 Calculation Error
The different results given by v3844 and v3924 are due to the change in the integration algorithm used, which happened in v3893. Before that the Romberg method was used; the current code uses the Double Exponential method. (If you wish you can read about this here.)

For many integrals the new method is quicker and more accurate. It is particularly good when there is an integrable singularity at either end of the interval of integration. However it is less good when integrating functions that vary periodically many times over the interval, which is the case for your integral.

Of course, since your integrand is periodic it’s easy to evaluate it by integrating over one cycle, multiplying by the number of complete cycles, and then adding the result of integrating over the final partial cycle. In general this won’t be possible and you will have to be content with spotting the sorts of integrand that are likely to give problems.

I don’t know an integration method which is superior to all other methods for all types of integrand. The double exponential method is good but - as your example shows - not perfect. It would be possible to re-include the Romberg code in addition to the new code - what do you think? How much code space would it be worth sacrificing for this?

Nigel (UK)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
WP34s 3924 Calculation Error - ppphzj - 08-27-2024, 12:43 PM
RE: WP34s 3924 Calculation Error - Nigel (UK) - 09-02-2024 06:44 PM
RE: WP34s 3924 Calculation Error - ppphzj - 09-03-2024, 10:45 AM



User(s) browsing this thread: 1 Guest(s)