Lagrangian Interpolation - 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: Lagrangian Interpolation (/thread-19992.html) |
Lagrangian Interpolation - Eddie W. Shore - 05-22-2023 01:35 PM The program LARG estimates a point (x, y) using the Lagrangian interpolating polynomial below: y = y0 * (x - x1) * (x - x2) ÷ ((x0 - x1) * (x0 - x2)) + y1 * (x - x0) * (x - x2) ÷ ((x1 - x0) * (x1 - x2)) + y2 * (x - x0) * (x - x1) ÷ ((x2 - x0) * (x2 - x1)) The polynomial has three set points that defined points (x0, y0), (x1, y1), and (x2, y2). This program is based off the Interpolations program for the HP 67 and HP 97 calculators. Source HP 67/97 Math Pac I. Hewlett Packard. Corvallis, OR. 1976 Code: 01 LBL ᵀ LARG Memory Registers Used: R01 = y0 R02 = y1 R03 = y2 R04 = x0 R05 = x1 R06 = x2 R07, R08, R09 Instructions The program LARG is set up to use the USER keyboard as follows: Key A ([Σ+]): Enter the point (x0, y0). Type x0, press [ENTER], type y0, press [Σ+]. Key B ([1/x]): Enter the point (x1, y1). Type x1, press [ENTER], type y1, press [1/x]. Key C ([√]): Enter the point (x2, y2). Type x2, press [ENTER], type y2, press [√]. Key D ([LOG]): Calculate y. Key E ([LN]): Exits the program and turns off the user keyboard. Example An estimated polynomial runs through the points (1, 7), (3, 9), and (5, 4). Estimate the point at x = 2 and x = 6. XEQ LARG 1 ENTER 7 [Σ+] (A) 3 ENTER 9 [1/x] (B) 5 ENTER 4 [√] (C) 2 [LOG] (D) returns about 8.8750 6 [LOG] (D) returns about -1.1250 When done, press [LN] (E) to exit or turn off the user keyboard. RE: Lagrangian Interpolation - Thomas Klemm - 05-22-2023 02:02 PM Somewhat related: |