The following warnings occurred:
Warning [2] Undefined array key 244920 - 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 array key 244952 - 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 array key 244953 - 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 244953 - 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 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/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





WP34s program submission: Quadratic fit



#2

This is an implementation of quadratic fit for WP-34s. If only 3 points are entered, this may be used for quadratic interpolation.
Similar function was implemented in HP30b, if you missed it, here it is.

// (C) 2013 Andrew Nikitin
// Fit quadratic polynomial to empirical data

// program operates in stack size 4
// uses regJ and regK to accumulate [SIGMA]x^3 and [SIGMA]x^4
// uses stat registers to accumulate other sums
// stores coefficients of quadrature fit in regA, regB, regC

// Initialize:
// XEQ'QF'
// Clears sums, but not coefficients

// Enter point:
// y ENTER x R/S (or [A])
// Result:
// number of points entered so far

// Calculate coefficients (needs at least 3 points):
// [B]
// Result:
// a=regA=regZ
// b=regB=regY
// c=regC=regX
// (order compatible with SLVQ)

// Evaluate Ax[^2]+Bx+C polynomial:
// x [C]
// Result:
// Ax[^2]+Bx+C

LBL'QF'
SSIZE4
CL[SIGMA]
CLx
STO J
STO K
XEQ 00
STOP
XEQ A
BACK 002
// Accumulate sums, including [SIGMA]x^3 and [SIGMA]x^4
LBL A
[SIGMA]+
RCL L
ENTER
x^3
STO+ J
*
STO+ K
LBL 00
CLx
n[SIGMA]
RTN

// delete point
LBL 65 // XEQ -
[SIGMA]-
RCL L
ENTER
x^3
STO- J
*
STO- K
GTO 00

// Fit quadratic
LBL B
LocR 016
RCL K
STO .03
RCL J
STO .02
STO .06
# 002
n[SIGMA]
x<=? Y
ERR 15
STO .07
[SIGMA]x
STO .04
STO .08
[SIGMA]x[^2]
STO .01
STO .05
STO .09
[SIGMA]y
STO .12
[SIGMA]xy
STO .11
[SIGMA]x[^2]y
STO .10
1
1
3
.
0
3
0
3
ENTER
1
2
2
.
0
3
0
1
# 125
LINEQS
RCL .15
STO A
RCL .14
STO B
RCL .13
STO C
RTN

// Evaluate Ax^2+Bx+C polynomial at regX
LBL C
ENTER
RCL* A
RCL+ B
*
RCL+ C
RTN

END


#3

Hi Andrew,

nice submission. :-)

It will find its way into the library if Pauli or I find the time to integrate it.


#4

It is in the library now :)

I've not included it in the standard library in flash.


- Pauli


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,610 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  Best statistical fit Richard Berler 8 2,456 10-30-2013, 11:25 PM
Last Post: Walter B
  Quadratic & Cubic Regression RPN progs Matt Agajanian 9 2,831 09-17-2013, 11:37 AM
Last Post: Jeff O.
  program print in wp34s Andrew Nikitin 13 3,154 07-22-2013, 10:11 PM
Last Post: Andrew Nikitin
  New empirical fit for ln(x) Namir 0 792 12-11-2012, 12:49 PM
Last Post: Namir
  [WP34S] WP34S firmware on the AT91SAM7L-STK dev kit? jerome ibanes 1 1,173 10-04-2012, 04:59 PM
Last Post: Paul Dale
  New Quadratic Lagrangian Interpolation Method Namir 2 1,314 07-20-2012, 04:32 PM
Last Post: Namir
  Fast Quadratic Formula for the HP-41C Gerson W. Barbosa 21 5,975 07-18-2012, 08:53 AM
Last Post: Gerson W. Barbosa
  Quadratic formula program help Chris C 18 4,694 06-16-2012, 12:14 AM
Last Post: Matt Agajanian
  WP34S program question Mike Maiorana 12 3,062 04-05-2012, 03:09 AM
Last Post: Steve Simpkin

Forum Jump: