Lagrangian Interpolation - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP-65/67/97 Software Library (/forum-12.html) +--- Thread: Lagrangian Interpolation (/thread-151.html) Pages: 1 2 |
RE: Lagrangian Interpolation - PedroLeiva - 07-09-2024 12:58 PM Yes, you are right. It was in March 2019, I had forgotten, Sorry RE: Lagrangian Interpolation - Albert Chan - 07-09-2024 08:43 PM (03-14-2019 07:22 PM)PedroLeiva Wrote: For 2nd order polynomials we can use your program, just loading three points; Yes, you can! It does not matter how many points. Example, for 5 points: Code: x1 y1 (x1,y1),(x2,y2),(x3,y3) --> (x3,y3') (x1,y1),(x2,y2),(x4,y4) --> (x4,y4') (x1,y1),(x2,y2),(x5,y5) --> (x5,y5') (x3,y3'),(x4,y4'),(x5,y5') --> (x5,y5'') This work with simple secant line too. (03-07-2015 11:49 PM)bshoring Wrote: A program for the HP-25 gave this example: Code: X Y Interpolate @ X=2.5 (2,4), (3,9) --> (2.5, 6.5) (2,4), (-11,121) --> (2.5, -0.5) (3,6.5), (-11,-0.5) --> (2.5, 6.25) RE: Lagrangian Interpolation - Thomas Klemm - 07-10-2024 05:09 AM (07-09-2024 08:43 PM)Albert Chan Wrote: Yes, you can! That's nice. But because of the memory limitation of the HP-25 to only 8 registers, the HP memory extension™ must be used. (See picture) In addition, the method is a bit tedious if the function is to be interpolated at several points. RE: Lagrangian Interpolation - Albert Chan - 07-10-2024 11:23 AM (07-10-2024 05:09 AM)Thomas Klemm Wrote: But because of the memory limitation of the HP-25 to only 8 registers, Can scrap paper work too? Quote:In addition, the method is a bit tedious if the function is to be interpolated at several points. We can use Acton Forman's method for polynomial coefficients too. Instead of interpolating for a value, do divided difference (i.e. slope) Code: X Y D D^2 f(x) = 4 + (x-2)*(5 + (x-3)*1) = 4 + (x-2)*(x+2) = x^2 RE: Lagrangian Interpolation - rprosperi - 07-10-2024 11:34 AM (07-10-2024 11:23 AM)Albert Chan Wrote:(07-10-2024 05:09 AM)Thomas Klemm Wrote: But because of the memory limitation of the HP-25 to only 8 registers, It can. but it's not anywhere near as collectible... RE: Lagrangian Interpolation - Thomas Klemm - 07-11-2024 04:19 AM (07-10-2024 11:23 AM)Albert Chan Wrote: I assume that -9 should rather be -8: \( \frac{121 - 9}{-11 - 3} = \frac{112}{-14} = -8 \) And then: \( \frac{-8 - 5}{-11 - 2} = \frac{-13}{-13} = 1 \) RE: Lagrangian Interpolation - Albert Chan - 07-11-2024 10:05 AM Hi, Thomas Klemm Your way works too, but I prefer Acton's Forman style. I like to do row-by-row, and this lined up numbers to use. Acton Forman style Code: f D D^2 D^3 Conventional Divided Difference, we need to trace the diagonal for x's to use. Code: f D D^2 D^3 Both ways get the same [1,7,8,1] digaonal f = 1 + (x-1)*(7 + (x-2)*(8 + (x-5)*1)) = x^3 RE: Lagrangian Interpolation - Thomas Klemm - 07-12-2024 08:28 AM (03-14-2019 07:58 PM)Thomas Klemm Wrote: Given the restrictions of the HP-25 I'm afraid we can't go further than 3 points. (07-09-2024 08:43 PM)Albert Chan Wrote: Yes, you can! Here we go: Code: 01: 24 00 : RCL 0 Example Interpolation of the \(sin\) function using well known values: \( \begin{align} (30&, 0.5) \\ (45&, \sqrt{0.5}) \\ (60&, \sqrt{0.75}) \\ (90&, 1) \\ \end{align} \) Enter the data 30 STO 0 .5 STO 1 45 STO 2 .5 \(\sqrt{x}\) STO 3 60 STO 4 .75 \(\sqrt{x}\) STO 5 90 STO 5 1 STO 6 Calculation of coefficients GTO 21 R/S Interpolation of values 37 R/S 0.6020 37 sin 0.6018 49 R/S 0.7546 49 sin 0.7547 73 R/S 0.9572 73 sin 0.9563 |