Very Slow Numerical Approximation

Very Slow Numerical Approximation - Newton-Raphson Method - Сообщения

#1 Опубликовано: 22.02.2023 15:02:25
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

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

Any input would be much appreciated.
Thanks,
Newton-Raphson Approximation.sm (10 КиБ) скачан 34 раз(а).
#2 Опубликовано: 22.02.2023 16:31:04
Arie

Arie

93 сообщений из 285 понравились пользователям.

Группа: User

I changed optimization of for loop to Numeric. It runs in less than a second on my machine.

Newton-Raphson Approximation.sm (11 КиБ) скачан 41 раз(а).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 пользователям понравился этот пост
Wesly Centerwall 22.02.2023 16:44:00
#3 Опубликовано: 22.02.2023 16:44:57
Wesly Centerwall

Wesly Centerwall

26 сообщений из 156 понравились пользователям.

Группа: User

I knew it was going to be something simple like this. Thanks!
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений