Interpolation Equation
|
07-08-2024, 01:23 AM
Post: #1
|
|||
|
|||
Interpolation Equation
The following is from my online Hydraulics and Hydrology class.
The required elevation for a volume of 0.46 acre-ft. is somewhere between 74 ft. and 75 ft. The accumulated volumes are therefore between 0.39 acre-ft. and 0.65 acre-ft. Use the interpolation equation to figure it out. I never heard of the term interpolation equation. Is it the same as linear regression? I found y - y1 = [(y2 - y1) / (x2 - x1)] (x - x1) on Wikipedia. I could easily write something for my HP 48G to crunch these numbers, but I figure there's already something on the HP 48G to do the same thing. There always seems to be a semantics issue involved when trying to figure out how to do something like this. My class learning module gives an example of calculating this using Microsoft Excel, but since I can't read the blurry text in the formula bar, I'm resorting to doing the math on my calculator. |
|||
07-08-2024, 01:29 AM
Post: #2
|
|||
|
|||
RE: Interpolation Equation
You already have the formula, and should be easy to write in in RPL. you need to input x1,y1,x2,y2,and x from the stack and sore them in named variables. The you write an rPL code for the equation using your named variables.
Simple! Namir |
|||
07-08-2024, 01:33 AM
Post: #3
|
|||
|
|||
RE: Interpolation Equation | |||
07-08-2024, 02:09 PM
Post: #4
|
|||
|
|||
RE: Interpolation Equation
You could use linear regression:
[[.39 74] [.65 75]] STOΣ .46 PREDY 74.2692307692 |
|||
07-08-2024, 02:43 PM
Post: #5
|
|||
|
|||
RE: Interpolation Equation
There are a number of interpolation formulas depending on the number of points you use to interpolate with:
Check out section 25.2 of Handbook of Mathematical functions by Abramowitz and Stegun. https://personal.math.ubc.ca/~cbm/aands/...stegun.pdf |
|||
07-08-2024, 03:00 PM
Post: #6
|
|||
|
|||
RE: 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:
|
|||
07-08-2024, 07:32 PM
(This post was last modified: 07-08-2024 07:37 PM by Thomas Klemm.)
Post: #8
|
|||
|
|||
RE: Interpolation Equation | |||
07-08-2024, 07:46 PM
Post: #9
|
|||
|
|||
RE: Interpolation Equation
It works for any variable :
[LeftShift] XXxxxx→ 'XXxxxx' STO [RightShift] XXxxxx → 'XXxxxx' RCL |
|||
07-08-2024, 08:13 PM
Post: #10
|
|||
|
|||
RE: Interpolation Equation | |||
07-08-2024, 08:19 PM
Post: #11
|
|||
|
|||
RE: Interpolation Equation
(07-08-2024 01:23 AM)MNH Wrote: Is it the same as linear regression? (02-10-2024 06:26 PM)Thomas Klemm Wrote: For just two points \(P_1 = (x_1, y_1)\) and \(P_2 = (x_2, y_2)\) we want to solve the following linear system of equations: |
|||
07-09-2024, 10:37 AM
Post: #12
|
|||
|
|||
RE: Interpolation Equation
I would like to check my comprehension and test the formulas, could you please give me an example? Thank you in advance. Pedro
|
|||
07-09-2024, 11:09 AM
Post: #13
|
|||
|
|||
RE: Interpolation Equation
Linear regression line minimize Mean Squared Error (MSE)
For 2 points, it is the same as the secant line. (MSE = 0) Proof: from secant line, we can get regression line formula. a * x1 + b = y1 ... (1) a * x2 + b = y2 ... (2) (1) * x1 + (2) * x2: a * (x1²+x2²) + b * (x1+x2) = (y1*x1 + y2*x2) ... (3) (1) + (2): a * (x1+x2) + 2 * b = (y1+y2) ... (4) (3) and (4) are exactly n=2 linear regression formula. |
|||
07-09-2024, 12:13 PM
Post: #14
|
|||
|
|||
RE: Interpolation Equation | |||
07-09-2024, 12:22 PM
Post: #15
|
|||
|
|||
RE: Interpolation Equation
Thanks to both, Albert and Thomas. I have just found the formula and example in "HP25 Application Programs". If X1= 7.3, Y1= 1.9879; x2= 7.4, Y2= 2.0015; for Xn= 7.37, then Yn= 1.9974. The program only takes 16 steps (pages 85-86)
|
|||
07-09-2024, 12:51 PM
Post: #16
|
|||
|
|||
RE: Interpolation Equation
(07-09-2024 12:22 PM)PedroLeiva Wrote: I have just found the formula and example in "HP25 Application Programs". We've been there: Lagrangian Interpolation Post: #20 |
|||
07-09-2024, 01:00 PM
Post: #17
|
|||
|
|||
RE: Interpolation Equation
Yes, you are right. It was in March 2019, I was forgotten, sorry
|
|||
07-09-2024, 11:27 PM
(This post was last modified: 07-09-2024 11:28 PM by Johnh.)
Post: #18
|
|||
|
|||
RE: Interpolation Equation
That simple use of linear regression with two points is really useful! Actually it may be more useful in day-to-day engineering than the more common use of LR with multiple points. Thanks! And it's so simple that there's no point in making a dedicated program.
Today's example for me in structural design: Design standards give us wind pressure coefficients at various building heights. To get the values at intermediate heights, we interpolate from the nearest values above and below. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)