Small Solver Program
02-18-2019, 05:20 AM
Post: #16
 Thomas Klemm Senior Member Posts: 1,885 Joined: Dec 2013
RE: Small Solver Program
If you compare your algorithm with Newton's method:

$$x_{n+1}=x_{n}-\frac {f(x_{n})}{f'(x_{n})}$$

you may notice that the number in register 0 should in fact be $$f'(x_{n})$$ or at least a good approximation thereof.

And with this in mind indeed the solution can now be found:

$$f'(x) = \frac{d}{dx}4 x (x + 1) = 8 x + 4$$

$$f'(-1) = -4$$

$$f'(0) = 4$$

Examples:

-1.5
ENTER
-4
A

-1.00000

0.5
ENTER
4
A

0.00000

Thus your 2nd parameter is an estimate of the slope at the root.

And then you don't really have to call the function twice with the same value:
Code:
LBL A STO 0 Rv STO 1 28 STO I  // Store Loop Count Limit LBL 0 GSB B RCL 0 รท STO - 1 X=0  // End if Root is found GTO 1 DSE  // Loop Limit Counter GTO 0 CLx FIX 9  // 0.000000000 indicate that Maximum Loops is use up. PSE PSE FIX 4 LBL 1 RCL 1  // Answer  RTN LBL B .  // f(x) equation start here . .  // X = Register 1 [R1] . . RTN

So the question remains how to approximate the derivation at the roots.
If you keep record of the previous function evaluation you can get an estimate of the slope using the secant method.

Cheers
Thomas
 « Next Oldest | Next Newest »

 Messages In This Thread Small Solver Program - Gamo - 02-14-2019, 05:25 AM RE: Small Solver Program - Thomas Klemm - 02-14-2019, 07:06 AM RE: Small Solver Program - Albert Chan - 02-15-2019, 12:07 AM RE: Small Solver Program - Thomas Klemm - 02-15-2019, 06:26 PM RE: Small Solver Program - Albert Chan - 02-15-2019, 09:16 PM Addendum: Small Solver Program - Thomas Klemm - 02-14-2019, 07:15 AM RE: Small Solver Program - Thomas Klemm - 02-16-2019, 03:58 AM RE: Small Solver Program - Albert Chan - 11-03-2019, 03:14 PM RE: Small Solver Program - Albert Chan - 11-10-2019, 07:02 PM RE: Small Solver Program - Albert Chan - 12-01-2019, 12:13 AM RE: Small Solver Program - Csaba Tizedes - 02-16-2019, 12:24 PM RE: Small Solver Program - Thomas Klemm - 02-16-2019, 01:42 PM RE: Small Solver Program - Csaba Tizedes - 02-16-2019, 03:24 PM RE: Small Solver Program - Gamo - 02-17-2019, 02:57 AM RE: Small Solver Program - Thomas Klemm - 02-17-2019, 09:06 AM RE: Small Solver Program - Gamo - 02-17-2019, 02:33 PM RE: Small Solver Program - Thomas Klemm - 02-17-2019, 04:57 PM RE: Small Solver Program - Gamo - 02-18-2019, 03:49 AM RE: Small Solver Program - Thomas Klemm - 02-18-2019 05:20 AM RE: Small Solver Program - Dieter - 02-18-2019, 07:46 PM RE: Small Solver Program - Thomas Klemm - 02-18-2019, 10:22 PM RE: Small Solver Program - Albert Chan - 02-19-2019, 01:10 AM RE: Small Solver Program - Csaba Tizedes - 02-19-2019, 08:39 AM RE: Small Solver Program - Thomas Klemm - 02-20-2019, 05:31 AM RE: Small Solver Program - Csaba Tizedes - 02-25-2019, 08:39 PM RE: Small Solver Program - Thomas Klemm - 02-20-2019, 07:22 AM RE: Small Solver Program - Thomas Klemm - 02-24-2019, 09:21 AM RE: Small Solver Program - Thomas Klemm - 02-25-2019, 11:00 PM RE: Small Solver Program - Albert Chan - 01-04-2020, 07:49 PM

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