New Quadratic Integration
|
05-30-2018, 09:24 PM
Post: #4
|
|||
|
|||
RE: New Quadratic Integration
(05-30-2018 08:17 PM)Namir Wrote: My own (very limited) testing shows that the new algorithm generally yields more accurate results than Simpson's Rule. I have only tested two functions (1/x and sin(x)), and here the results with your method are actually more accurate than those with a standard Simpson method. In my test cases the latter required about 40% (1/x) or 15% (sin(x)) more intervals to achieve the same accuracy level. On the other hand your method requires four function calls per loop where the classic method needs only one. But the Simpson method can be improved. Some time ago I proposed a variation that calculates the Simpson estimates for n and n/2 intervals, which are then combined into a final result that is more precise than the better of the two. Example: the integral of 1/x from 1 to 2. Your method with n=40: error ~–3,1 E–9 Simpson method with n=40: error ~ 1,2 E–8 Simpson method with n=56: error ~ 3,2 E–9 Simpson with n=40: error ~ 1,2 E–8 Simpson with n=20: error ~ 1,9 E–7 Combined result: error ~ 6 E–11 So you can see that your method performs better with the same number of intervals. What it does with n=40 requires n=56 with the standard Simpson method. However, your method needs ~160 function calls as opposed to 56 with the standard method. Finally, with merely 40 loops (and function calls) the combined method achieves an accuracy level that requires more than 100 loops (and 400 function calls) with the new method. But that's what you already noted: (05-30-2018 08:17 PM)Namir Wrote: Of course this advantage comes at a computational price (I used old compact Simpson code that we had discussed a few years back on this forum). So increased accuracy comes at the cost of more CPU work. Fare enough! Dieter |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
New Quadratic Integration - Namir - 05-30-2018, 01:39 PM
RE: New Quadratic Integration - Dieter - 05-30-2018, 05:53 PM
RE: New Quadratic Integration - Namir - 05-30-2018, 08:17 PM
RE: New Quadratic Integration - Dieter - 05-30-2018 09:24 PM
RE: New Quadratic Integration - ttw - 05-31-2018, 02:27 AM
RE: New Quadratic Integration - Namir - 05-31-2018, 03:46 AM
RE: New Quadratic Integration - Namir - 05-31-2018, 03:51 AM
RE: New Quadratic Integration - ttw - 05-31-2018, 03:56 AM
|
User(s) browsing this thread: 1 Guest(s)