The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(12C) Numeric Solver
04-13-2017, 01:50 AM
Post: #1
(12C) Numeric Solver
This solver uses Newton's method to solve f(x)=0. It is an adaptation of the HP-25 solver (HP-25 Application Programs, Chapter 5). The program uses registers 0, 1, 2, 3 and 4.

Enter the program as listed- it will occupy lines 1 through 38. The formula to be solved will start on line 39 and must end with the command GTO 17.

EXAMPLE-

Solve ln x + 3x -10.8074 = 0

Starting with line 38 displayed, enter the formula:

LN
LST X
3
*
+
1
0
.
8
0
7
4
-
GTO 17

Store an initial guess in register 1:

1
STO 1

Store the desired tolerance in register 2:

EEX
5
CHS
STO 2

Press R/S to solve. Result: 3.21336

PHP Code:
CLX    
STO 0    
RCL 1    
GTO 39    
//xeq formula
ROLL DN    
STO 4    
1    
STO 0    
RCL 1    
RCL 1    
EEX    
5    
/    
STO 3    
+    
GTO 39    //xeq formula
X=0    
GTO 37    
RCL 0    
X
=0    
GTO 05    
ROLL DN    
RCL 4    
/    
1    
-    
1/X    
RCL 3    
x     
STO – 1    
2    
Y
^X    
SQRT    
RCL 2    
X
<=Y       //x is less than or equal to y    
GTO 01    
RCL 1    
//answer
R/S    
            
//formula...
GT0 17 
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Numeric Solver - Dwight Sturrock - 04-13-2017 01:50 AM
RE: (12C) Numeric Solver - Dieter - 04-14-2017, 04:33 PM
RE: (12C) Numeric Solver - Dwight Sturrock - 04-14-2017, 10:15 PM



User(s) browsing this thread: 1 Guest(s)