Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 429 Was thanked: 42 time(s) in 39 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,036 Was thanked: 1168 time(s) in 747 post(s)
|
Hi, first of all you have to keep hands off i if you handle complex numbers. Don't use it as iterator variable. Second, I am not sure what for(4) actually does. Unfortunately I can't break down it to a minimum working example. The disabled region should work as the for(3) loop with exit condition but it doesn't (somehow gets stuck). Tests with trace showed that inside the for(4) loop the arithmetics seem to be rotten. For comparison I added a loop-free implementation of the algorithm by just repeating the commands in the sheet. Once one accepts the complex numbers, the algorithm converges to a reasonable solution. Yet, the radius turns out negative for the given initial guess. This can happen because only the square of the radius occures in the model. Triangle-Circle-Newton_kr.sm (195kb) downloaded 7 time(s). |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
|
1 user thanked Jean Giraud for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 26/07/2022(UTC) Posts: 48 Location: UK Was thanked: 31 time(s) in 27 post(s)
|
I don't think you've actually adopted the KISS principle here Valery! The attached seems much simpler. Triangle-Circle-Newton_stvmath.sm (117kb) downloaded 19 time(s).
|
1 user thanked StvMath for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.