Acron RPN announces v3.0 BETA

06152018, 06:26 PM
(This post was last modified: 06162018 01:07 PM by Dieter.)
Post: #38




RE: Acron RPN announces v3.0 BETA
(01152018 01:40 AM)sapenguin Wrote: Thank you all, for inspiring my continued education. Today's subject: integral I set up a quick Excel spreadsheet, solving \(\int_{1}^{2}e^x dx\) 4096 steps, and I still had a error of 23.2E9 That's the plain vanilla implementation of Simpson's rule. Here 32 intervals indeed give a result with an error of 2,47 E–8. But if you got 32 intervals you can also use the data to calculate a Simpson approximation for 16 intervals. This has an error of 3,96 E–7. And now for the interesting part: use both (!) Simpson approximations, i.e. both the value for 32 as well as the one for 16 intervals, and calculate (16 · S_{32} – S_{16})/15. Et voilà: the result has an error of merely 9,2 E–12 (!). I have implemented this method in a small HP41 program that can be found on this site. This method also has another advantage: you can start with n=4 and 2 intervals. Calculate the combined approximation as shown above. Then continue with n=8 and 4 (where only the new f(x) have to be evaluated), and get a new, better approximation. Repeat until the desired accuracy is reached. So you can estimate the error and continue adding more nodes until the result is sufficiently accurate. Take a look at the sequence of Simpson approximations in the linked thread. Edit: (01152018 01:40 AM)sapenguin Wrote: Now, if I can just wrap my head around Romberg's Method [as explained on Wikipedia] without my brain melting... The combined Simpson approximations as described above are equivalent to the results in the third column of the Romberg matrix. ;) Dieter 

« Next Oldest  Next Newest »

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