Manipulating list in order to interpolate

06192016, 02:21 AM
Post: #1




Manipulating list in order to interpolate
So I'm trying to create a program able to interpolate from a list of values (more like a matrix) where the left column correspond to the value A and the right column to the value F(A) and so on, then if I'm interest on the value F(B) knowing B the program should do a linear interpolation between F(A) and F(C), I'm not familiar with programming on RPL I'm used to visual so I hope you guys can give me some hints so I'll do it myself.
Additional info: I've a HP50g I'm writing my codes on HPuseredit 6 

06192016, 07:29 AM
(This post was last modified: 06192016 07:31 AM by RPL Calcs.)
Post: #2




RE: Manipulating list in order to interpolate
@ Paste in the HPUserEdit and send to emulator
@ "sigma" is the greek letter sigma (somatory); caracter number 133. [@ A F(A) B F(B) [ 1 03.3 10 05.1 ] [ 3 09.2 20 10.2 ] [ 5 15.1 30 15.3 ] [ 7 21.2 40 20.1 ] ] 'sigmaDAT' STO @ sigmaDAT is the variable that contains the current statistical matrix. { 3. @ column number specifying the independentvariable: "B" 4. @ column number specifying the dependentvariable: "F(B)" 0. @ intercept 0. @ slope LINFIT @ regression model } 'sigmaPAR' STO @ sigmaPAR is the variable that contains the current statistical parameter list. LR @ Linear Regression command @ You'll get in the stack: @ Level 2: Intercept: .15 @ Level 1: Slope: .501 @ 'F(B)=0.15+0.501*B' @ NOTE: @ use real numbers in sigmaPAR, not integers. That is: @ use { 3. 4. 0. 0. LINFIT } and not { 3 4 0 0 LINFIT }. 

06192016, 08:32 AM
(This post was last modified: 06192016 08:35 AM by RPL Calcs.)
Post: #3




RE: Manipulating list in order to interpolate
Perhaps the best option to estimate values is the Fit Data Input Form:
[RightShift] [STAT] (3.Fit data..) [PRED] or, to access it from a program, use: # 3A002h FLASHEVAL and then press [PRED] !!!WARNING!!! !!!WARNING!!! !!!WARNING!!! # 3A002h FLASHEVAL only 49 series (49G, 48GII, 49G+ e 50G). To the 48G/GX/G+ use # B417Fh LIBEVAL and then [PRED] SYSEVAL, LIBEVAL and FLASHEVAL can cause calculator memory crash. Look entries in: http://www.area48.com/48entries.html http://www.hpcalc.org/details.php?id=3248 

06212016, 02:31 PM
Post: #4




RE: Manipulating list in order to interpolate
INTRP
Performs single or double interpolation among multiple table entries. http://www.hpcalc.org/details.php?id=3144 

« Next Oldest  Next Newest »

User(s) browsing this thread: