The following warnings occurred:
Warning [2] Undefined array key 59242 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 59242 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Quadratic fit without linear algebra (32SII) - NOT only for statistics lovers - LONG



#2

Hello,

I want to fit quadratic equation curves to pumps' characteristics, but I dont want to use linear equation solver, and I want to use only my 32SII. And I dont want to store the points' coordinates.

############################################
# #
# What do you think about this method??? #
# #
############################################

Let y=A*x^2+B*x+C, the derivative is:
y'=2*A*x+B == m*x+b, so A=m/2, and B=b.

And if we minimize the sum of calculated and given y's
differece's square, we give C=AVER(y)-A*AVER(x^2)-B*AVER(x).
AVER() is average function.

Here is the 32SII version:

LBL S #First start
CLSum
INPUT X
STO I
STO U
x^2
STO K
INPUT Y
STO J
STO V
LBL I #Input more points
INPUT X
ENTER
STO+I
x^2
STO+K
Roll Down
RCL-U
INPUT Y
STO+J
RCL-V
/
1/x #End of numerical differentiation
RCL X
RCL+U
2
/
Sum+
RCL X
STO U
RCL Y
STO V
n
1
+
STO N
VIEW N
GTO I

LBL C #Calculating A, B and C
m
2
/
STO A
VIEW A
b
STO B
VIEW B
RCL J
RCL A
RCL*K
-
RCL B
RCL*I
-
RCL/N
STO C
VIEW C
RTN

LBL S: CK=BE1E 15.0
LBL I: CK=D9ED 42.0
LBL C: CK=C868 30.0

Variables:

A, B, C: Coefficients
X, Y: New point coordinates
U, V: Old point coordinates
I: SumX
J: SumY
K: SumX^2
N: Number of datapoints
And statistic registers

Usage:

1., Sort the datapoints in increasing order of X
2., Start program with XEQ S
3., Enter the datapoints (No correction available!)
4., If you entered the last data, and you see N=... screen
start the coefficient-calculator routine: XEQ C

=====================================================
An example:

-----------------------------------------------------
MEASURED CALCULATED
Q H H_Excel H_HP32SII Delta%_HP32SII
(flow) (head)
[m3/h] [m] [m] [m] [%]
-----------------------------------------------------
0 90.0 90.0 90.0 0
30 90.2 90.2 90.2 -0.02
60 86.4 86.5 86.5 +0.13
90 79.0 79.0 79.0 -0.01
120 67.7 67.6 67.6 -0.12
150 52.4 52.4 52.4 0
-----------------------------------------------------

And the coefficients:

Excel HP32SII
A -2.133E-3 -2.139E-3
B +6.956E-2 +7.017E-2
C +9.000E+1 +9.000E+1

Enjoy! :D

Csaba


Edited: 28 June 2004, 3:26 a.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP prime: linear solver app Alberto Candel 1 1,408 11-21-2013, 01:57 AM
Last Post: Michael Carey
  HP Prime: Linear Solver app bug BruceH 0 1,122 11-15-2013, 06:36 PM
Last Post: BruceH
  HP Prime: Long integers (continued) Helge Gabert 2 1,476 11-07-2013, 11:24 AM
Last Post: Helge Gabert
  HP Prime: Pass "Long" Integers to a Program Helge Gabert 6 2,379 11-03-2013, 01:12 PM
Last Post: Helge Gabert
  Best statistical fit Richard Berler 8 2,460 10-30-2013, 11:25 PM
Last Post: Walter B
  HP Prime polynomial long division bluesun08 13 3,553 10-30-2013, 03:29 AM
Last Post: parisse
  Quadratic & Cubic Regression RPN progs Matt Agajanian 9 2,871 09-17-2013, 11:37 AM
Last Post: Jeff O.
  New article on a new type of neo linear equations Namir 0 1,252 08-11-2013, 10:27 AM
Last Post: Namir
  Linear Optimization/Programming fhub 14 3,990 08-04-2013, 06:27 AM
Last Post: fhub
  weird statistics bug in wp34s Andrew Nikitin 5 2,072 06-20-2013, 01:54 PM
Last Post: Namir

Forum Jump: