Basic single variable Secant (Newton-Raphson) Solver that just works

Basic single variable Secant (Newton-Raphson) Solver that just works - Messages

#1 Posted: 11/23/2016 4:08:55 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

I figured I am not the only one who can benefit from a simple numeric solver that "just works".

It will likely become obsolete once Davide updates the Nonlinear Solvers plugin.

Enjoy.

SolveNewtonRaphson.sm (12 KiB) downloaded 52 time(s).
SolveNewtonRaphson.png
#2 Posted: 11/24/2016 1:39:11 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Interesting, but good thing Smath 5346 does it as well
w/o all that complexity. Shouldn't it be constructed
around "While" loop ? Remember that any invented iterative
solver for Smath can't exceed better accuracy than around
12 decimals because of the granularty of Smath.

The native Smath 'solve' has a universal structure wrt:
1. is implicit
2. the bracketing [x1,x2]
3. very easy to handle.

Jean

Solve Unknown.gif
#3 Posted: 11/24/2016 11:22:17 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Alex,

The Newton-Raphson code in your first post would
surely work here in two cumbersome presentations.
For this example, 'roots' is a better candidate.

Solve Roots.gif
#4 Posted: 11/24/2016 1:19:46 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

If only either of the two could handle the units I would not need to go through all the trouble. They do not, hence I had to get inventive.
  • New Posts New Posts
  • No New Posts No New Posts