Interpolation linear f(x0,x¹x²), quadratic f(x0, x¹x²x³), cubic f(x0,x¹x²x³x⁴), etc.
|
06-06-2020, 08:44 PM
(This post was last modified: 01-13-2023 12:31 PM by Gil.)
Post: #1
|
|||
|
|||
Interpolation linear f(x0,x¹x²), quadratic f(x0, x¹x²x³), cubic f(x0,x¹x²x³x⁴), etc.
For HP49-HP50
Small interpolation program. Valid for 2 points (linear solution) and for 3 points (quadratic function). Valid also for 4 points (cubic function). Valid also for 5 points, 6, 7, 8,...,68, 69, 70, 71... points. It is not a linear regression program : the function calculated here goes really exactly through all the given points. Once you have introduced the points in the calculator (stared / stored in matrix XY), you get the requested result in one single step (numbers 3 and4 below). Observation 1 The program works in RPN mode. Suppose you have the two points A(1;10), B(2;20). Find a function that goes exactly through them. Find f(x=1.7) = 17 Solution 1) Write Matrix XY: [[1 10] [2 20]] ENTER[/b] 2) Save/store it in XY: 'XY' STO 3)Press 1.7 INTERPOL 4) New values of xo, for example f(1.9) : skip steps 1 and 2 Press 1.9 INTERPOL Suppose now that you have the 3 points A(1;10), B(2;20), C(3;35). Find a function that goes exactly through them. Find f(x=1.7) = 16.475 Solution 1) Write Matrix XY: [[1 10] [2 20] [3 35]] ENTER 2) Save/store it again in XY: 'XY' STO 3)Press 1.7 INTERPOL 4) New values of xo, for example f(1.9) : skip steps 1 and 2 Press 1.7 INTERPOL Suppose now that you have n points A(1;10), B(2;20), C(3;35)... ZZn(n; f(n)). Find a function that goes exactly through them. Find f(x=1.7) Solution 1) Write Matrix XY: [[1 10] [2 20] [3 30] [... ....] [n f(n)]] ENTER 2) Save/store it again in XY: 'XY' STO 3)Press 1.7 INTERPOL 4) New values of xo, for example f(1.9) : skip steps 1 and 2 Press 1.7 INTERPOL Observation 2 You can have already the first coordinate xi of all the points saved in matrix X. All the second coordinates yi of all the points already in matrix Y. To build the requested matrix XY: 1) X ENTER 2) Y ENTER 3) 2 COL+ 4) 'XY' STO Then 1.7 INTERPOL Hope that it is useful. Regards, Gil |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Interpolation linear f(x0,x¹x²), quadratic f(x0, x¹x²x³), cubic f(x0,x¹x²x³x⁴), etc. - Gil - 06-06-2020 08:44 PM
RE: HP 49G/ HP50G : Interpolation linear, quadratic, cubic, etc. - Gil - 07-11-2020, 01:20 AM
RE: HP 49G/ HP50G : Interpolation linear, quadratic, cubic, etc. - Gil - 01-12-2023, 02:14 PM
|
User(s) browsing this thread: 1 Guest(s)