Lagrangian Interpolation
|
12-18-2013, 09:10 PM
(This post was last modified: 01-14-2014 01:30 PM by Namir.)
Post: #1
|
|||
|
|||
Lagrangian Interpolation
This article presents an HP-41C program for Langrangian Interpolation of N points, where N > 1
Program XLGINT Usage XEQ XLGINT (same as pressing A) A Program prompts you to enter N, N points, and the interpolated value of x B Program prompts you to enter the interpolated value of x Program calculates and displays the value of the interpolated Y. Example Consider the data in the following table: Code: X Y Using the above data, calculate Y for X = 4. The Steps involved are: Code: Step Task Command/Input Output Algorithm Code: INPUT N, array X(1..N), Y(1..N), and Xint Memory Map R00 = N R01 = Xint R02 = Yint R03 = Product R05 = J for X(J) R06 = I for X(I) R07 = I for Y(I) R10 = X(1) R11 = X(2) ... R10+N-1 = X(N) R10+N = Y(1) R11+N = Y(2) ... R10+2N-1 = Y(N) Source Code The source code for the HP-41C program appears below. Please note the following: 1) Text appearing in a pair of double quotes represents characters in the Alpha register. 2_ The |- characters represent the single append character for the Alpha register. 3) The blank lines are intentionally inserted to separate logical blocks of commands: Code: LBL XLGINT |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Lagrangian Interpolation - Namir - 12-18-2013 09:10 PM
|
User(s) browsing this thread: 1 Guest(s)