Numerical Integration using chained Gauss-Legendre - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP-41C Software Library (/forum-11.html) +--- Thread: Numerical Integration using chained Gauss-Legendre (/thread-5910.html) |
Numerical Integration using chained Gauss-Legendre - Namir - 03-21-2016 05:51 PM Back last year, a member of this website pointed to the simplicity of using the Gauss-Legendre quadrature (with a 3rd order Legendre polynomial) with vintage and new HP calculators. This prospect made me think of using a "chained" version of that type of quadrature to yield relatively good results. Here are my preliminary results usin Excel VBA. The following Excel VB Code compares the chained Simpson's rule with a "chained" Gauss-Legendre quadrature using a 3rd order Legendre polynomial. The following is the configuration contents of the Excel sheet: Code: Cell Contents Here is the VBA code: Code: Function Fx(ByVal sFx As String, ByVal X As Double) As Double As you experiment with different functions and integration ranges, you should see that the chained Gauss-Legendre quadrature is significantly more accurate than Simpson's rule. Both methods use three points per divided interval. Enjoy! Namir RE: Numerical Integration usined chained Gauss-Legendre - Tugdual - 03-22-2016 06:40 AM Is this related to hp 41? RE: Numerical Integration usined chained Gauss-Legendre - lcwright1964 - 03-29-2016 10:13 PM (03-22-2016 06:40 AM)Tugdual Wrote: Is this related to hp 41? I think that Namir introduced his VBA code with a comment that this approach to quadrature might be well suited to keystroke programming. I discerned at least an implied challenge that someone adapt this to HP41/42 code--unless Namir is working on that himself already. I have to admit I am more of a Romberg man myself... Les |