The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
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


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


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



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