1 Pages (3 items)
Very Slow Numerical Approximation - Newton-Raphson Method - Messages
#1 Posted: 2/22/2023 3:02:25 PM
I tried to make a simple sheet that would show the path the Newton-Raphson approximation takes to get to a solution based on an initial guess.
The problem I'm having is that it's very slow with anything more than 2/3 iterations.
I'm not sure why it is slow. I can simulate the loop in steps and none of the calcs are slow outside of the loop.
Any ideas as to why this is so slow for i>2. i=3 is still okay, but is gets eternal after that.
In this particular case, the solution converges at the 7th iteration for two decimal places of accuracy.
This is a snip of 4 iterations, which takes well over 2 minutes...
![2023-02-22 12_54_44-SMath Solver 1.0.8348 - [Newton-Raphson Approximation.sm].png](/en-US/file/DFVs64/2023-02-22-12_54_44-SMath-Solver-1_0_8348---_Newton-Raphson-Approximation_sm__png)
Any input would be much appreciated.
Thanks,
Newton-Raphson Approximation.sm (10 KiB) downloaded 51 time(s).
The problem I'm having is that it's very slow with anything more than 2/3 iterations.
I'm not sure why it is slow. I can simulate the loop in steps and none of the calcs are slow outside of the loop.
Any ideas as to why this is so slow for i>2. i=3 is still okay, but is gets eternal after that.
In this particular case, the solution converges at the 7th iteration for two decimal places of accuracy.
This is a snip of 4 iterations, which takes well over 2 minutes...
Any input would be much appreciated.
Thanks,
Newton-Raphson Approximation.sm (10 KiB) downloaded 51 time(s).
#2 Posted: 2/22/2023 4:31:04 PM
I changed optimization of for loop to Numeric. It runs in less than a second on my machine.
Newton-Raphson Approximation.sm (11 KiB) downloaded 56 time(s).
Newton-Raphson Approximation.sm (11 KiB) downloaded 56 time(s).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 users liked this post
Wesly Centerwall 2/22/2023 4:44:00 PM
#3 Posted: 2/22/2023 4:44:57 PM
I knew it was going to be something simple like this. Thanks!
1 Pages (3 items)
-
New Posts
-
No New Posts