06-06-2020, 08:44 PM
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
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