Newton method

Newton method - 消息

#1 已发布: 2023/4/8 16:07:23
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

I cannot use the roots function and must use one old good simple method by Newton.
What can you say about it?

Newton-Eng.docx (1.07 MiB)已下载 1010 次。
1位用户喜欢此帖子
Martin Kraska 2023/4/9 08:50:00
#2 已发布: 2023/4/9 08:56:19
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

Very nice.

I had problems when reproducing your 2D version. Depending on initial guess I got errors "requested matrix element does not exist". The situation seemed to improve a little by pre-allocating the vectors X and Y yet it didn't become really robust.

So instead of assigning to j+1 elements I used augment() to add new points to the iteration history.

This is the original version:

Newton2D.png
Newton2D.sm (21.4 KiB)已下载 1581 次。

And this is the modified version.

Newton2Da.png
Newton2Da.sm (19.03 KiB)已下载 1703 次。
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#3 已发布: 2023/4/9 14:27:18
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

... can't find 2nd root


2nd root confirmed exact.

Solve(f,q,x0,x1,TOL) Copy.sm (162.62 KiB)已下载 1697 次。
#4 已发布: 2023/4/9 14:33:35
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Tried to solve your functions with al_nleqsolve().

Regards

Newton.sm (13.85 KiB)已下载 1618 次。

2023-04-09_20-14.png
#5 已发布: 2023/4/9 18:19:38
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Another way, keeping the mathematical formulation and the iteration algorithm separate. As here.

Newton2Da.sm (13.34 KiB)已下载 1757 次。

Clipboard01.png

Best regards.
Alvaro.
#6 已发布: 2023/4/10 12:25:58
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Thanks Alvaro, added to my next Samples visit.
Take care ... Jean
#7 已发布: 2023/4/10 16:21:38
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

I cannot use the roots function


Actually, you can.

Regards

2023-04-10_22-20.png
#8 已发布: 2023/4/10 20:29:31
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

I cannot use the roots function and must use one old good simple method by Newton.
What can you say about it?


An old vintage in Smath ... two examples.
Take care Valery ... Jean.

Solve_roost f1(x,y). f2(x,y).sm (27.42 KiB)已下载 1690 次。



#9 已发布: 2023/4/11 14:21:16
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Two variations added.

Newton2Da. v2.sm (38.35 KiB)已下载 1695 次。

Newton2Da. v2.pdf (152.11 KiB)已下载 1165 次。

Best regards.
Alvaro.



1位用户喜欢此帖子
sergio 2023/5/3 14:29:00
#10 已发布: 2023/5/3 00:37:31
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

Wrote

Two variations added.

Newton2Da. v2.sm (38.35 KiB)已下载 1695 次。

Newton2Da. v2.pdf (152.11 KiB)已下载 1165 次。

Best regards.
Alvaro.




From my future article
Если уравнений не два, а три, то матрица Якоби будет состоять из трёх строк и трёх столбцов. При этом графически отображать решение придётся не двумя кривыми, а тремя поверхностями на 3D-графике, причём их взаимное пересечение и будет отмечать решение (задание читателю).
Слабо!
1位用户喜欢此帖子
Alvaro 2023/5/3 03:21:00
#11 已发布: 2023/5/3 12:02:25
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

You may find this Treasury useful/productive.


Solve(f,q,x0,x1,TOL) Copy.sm (300.16 KiB)已下载 1718 次。
  • 有新帖
  • 无新帖