Post Reply 
Interpolation Equation
07-08-2024, 06:12 PM (This post was last modified: 07-08-2024 06:24 PM by Gil.)
Post: #7
RE: Interpolation Equation
You could use this program INTERP, 
that works for n (n not too big) points :
it finds the exact Polynom that goes through the n points.

Code:

\<< "1) Create once Mat XY
 w/ the n given points
 [[x1 y1]
  [x2 y2]
  [   ]
  [xn yn]] in Stack 2
 2)Arg:value xo INTERP
 3)Repeat step 2)
   for other values xo
" DROP XY \-> xo XY
  \<< XY SIZE OBJ\-> 1 ==
    IF
    THEN DROP XY OBJ\-> 1 SWAP + \->ARRY 'XY' STO
    ELSE DROP2
    END XY SIZE 1 GET 1 ==
    IF
    THEN XY DUP 2 * 2 ROW+ 'XY' STO
    END XY 1 COL- DUP SIZE OBJ\-> DROP 1 - \-> x size
    \<< 1 size 1 +
      FOR i 0 size
        FOR j x i GET j ^
        NEXT
      NEXT size 1 + DUP 2 \->LIST \->ARRY / "a0\183x^0"
      IF size 1 >
      THEN "+" +
      END "+a" + size \->STR DUP SIZE 1 - 1 SWAP SUB + "\183x^" + size \->STR DUP SIZE 1 - 1 SWAP SUB + \->TAG DUP TRN 0 size
      FOR i xo i ^
      NEXT size 1 + 1 2 \->LIST \->ARRY * OBJ\-> DROP "y(" xo + ")" + \->TAG
    \>>
  \>>
\>>


Attached File(s)
.hp  INTERP.hp (Size: 722 bytes / Downloads: 2)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Interpolation Equation - MNH - 07-08-2024, 01:23 AM
RE: Interpolation Equation - Namir - 07-08-2024, 01:29 AM
RE: Interpolation Equation - SlideRule - 07-08-2024, 01:33 AM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024, 02:09 PM
RE: Interpolation Equation - Namir - 07-08-2024, 03:00 PM
RE: Interpolation Equation - KeithB - 07-08-2024, 02:43 PM
RE: Interpolation Equation - Gil - 07-08-2024 06:12 PM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024, 07:32 PM
RE: Interpolation Equation - Gil - 07-08-2024, 07:46 PM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024, 08:13 PM
RE: Interpolation Equation - Thomas Klemm - 07-08-2024, 08:19 PM
RE: Interpolation Equation - PedroLeiva - 07-09-2024, 10:37 AM
RE: Interpolation Equation - Albert Chan - 07-09-2024, 11:09 AM
RE: Interpolation Equation - Thomas Klemm - 07-09-2024, 12:13 PM
RE: Interpolation Equation - PedroLeiva - 07-09-2024, 12:22 PM
RE: Interpolation Equation - Thomas Klemm - 07-09-2024, 12:51 PM
RE: Interpolation Equation - PedroLeiva - 07-09-2024, 01:00 PM
RE: Interpolation Equation - Johnh - 07-09-2024, 11:27 PM



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