Acron RPN announces v3.0 BETA
06-15-2018, 06:26 PM (This post was last modified: 06-16-2018 01:07 PM by Dieter.)
Post: #38
 Dieter Senior Member Posts: 2,401 Joined: Dec 2013
RE: Acron RPN announces v3.0 BETA
(01-15-2018 01:40 AM)sa-penguin 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.2E-9
Simpson rule was next, and 32 steps had the error down to 24.7E-9.

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 · S32 – S16)/15. Et voilà: the result has an error of merely 9,2 E–12 (!).

I have implemented this method in a small HP-41 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:

(01-15-2018 01:40 AM)sa-penguin 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 »

 Messages In This Thread Acron RPN announces v3.0 BETA - vanLudwig - 08-27-2017, 05:49 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 08-27-2017, 09:20 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 08-30-2017, 12:16 AM RE: Acron RPN announces v3.0 BETA - Nigel (UK) - 08-30-2017, 11:20 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 08-31-2017, 01:09 PM RE: Acron RPN announces v3.0 BETA - Nigel (UK) - 08-31-2017, 08:02 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 08-31-2017, 11:46 PM RE: Acron RPN announces v3.0 BETA - inaqui76 - 09-01-2017, 02:36 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-01-2017, 02:51 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-01-2017, 09:38 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-04-2017, 06:29 PM RE: Acron RPN announces v3.0 BETA - Nigel (UK) - 09-05-2017, 08:03 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-05-2017, 11:18 PM RE: Acron RPN announces v3.0 BETA - Nigel (UK) - 09-06-2017, 09:41 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-06-2017, 09:45 PM RE: Acron RPN announces v3.0 BETA - Dieter - 09-07-2017, 06:51 AM RE: Acron RPN announces v3.0 BETA - Dieter - 09-07-2017, 07:59 PM RE: Acron RPN announces v3.0 BETA - Nigel (UK) - 09-07-2017, 08:55 PM RE: Acron RPN announces v3.0 BETA - Paul Dale - 09-07-2017, 10:34 AM RE: Acron RPN announces v3.0 BETA - Dieter - 09-07-2017, 06:29 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-07-2017, 11:08 PM RE: Acron RPN announces v3.0 BETA - Paul Dale - 09-08-2017, 11:09 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-11-2017, 12:17 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 09-24-2017, 05:43 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 10-04-2017, 01:41 PM RE: Acron RPN announces v3.0 BETA - rprosperi - 10-05-2017, 12:37 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 10-05-2017, 02:44 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 10-05-2017, 12:54 PM RE: Acron RPN announces v3.0 BETA - rprosperi - 10-05-2017, 01:07 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 10-08-2017, 11:57 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 10-31-2017, 08:23 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 12-08-2017, 10:43 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 01-08-2018, 12:48 AM RE: Acron RPN announces v3.0 BETA - sa-penguin - 01-15-2018, 01:40 AM RE: Acron RPN announces v3.0 BETA - Dieter - 06-15-2018 06:26 PM RE: Acron RPN announces v3.0 BETA - The Shadow - 06-17-2018, 04:12 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 01-30-2018, 03:16 AM RE: Acron RPN announces v3.1.0 BETA - vanLudwig - 06-09-2018, 07:55 PM RE: Acron RPN announces v3.0 BETA - vanLudwig - 06-14-2018, 12:11 AM RE: Acron RPN announces v3.0 BETA - vanLudwig - 06-17-2018, 03:12 AM RE: Acron RPN announces v3.1.0 BETA - vanLudwig - 06-17-2018, 08:27 PM RE: Acron RPN announces v3.1.0 BETA - vanLudwig - 06-22-2018, 02:01 AM

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