How can I use not a for but a while cycle?

How can I use not a for but a while cycle? - 消息

#1 已发布: 2024/2/9 21:27:16
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

See please the attached file.Newton.sm (23.6 KiB)已下载 1656 次。
#2 已发布: 2024/2/9 23:38:00
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

85个赞,共181个帖子。

组: User

Greetings,

Instead of using for(3); you can use for(4):

for ▮, ▮, ▮
   ▮


The four parameter 「for(4)」 gives you the ability to loop while checking a condition. Below is the description of for( {0}, {1}, {2}, {3} )
"For loop. The function of controlled iterations. The cycle repeats {3}, while {0} satisfies the condition {1} and after each passage necessarily satisfied {2}. Repeating expressions can be set to any number of expressions."



example:
for i:=1, i<10, i:=i+2
   k:=2*i

Where 'i' starts at 1 and until i is no longer less than 10, perform operation of k:=2*i. Apply operation i:=i+2 and check if less then 10...; LOOP!


May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
1位用户喜欢此帖子
Valery Ochkov 2024/2/10 14:37:00
#3 已发布: 2024/2/10 14:38:31
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

Thanks
But see "???" in the attach
Newton-for-1-2-3-4.sm (26.47 KiB)已下载 1583 次。

#4 已发布: 2024/2/10 18:38:42
StvMath

StvMath

44个赞和1个踩,共76个帖子。

组: User

Here's a "while" version

while.png
Newton-for-1-2-3-4_b.sm (18.98 KiB)已下载 1632 次。
1位用户喜欢此帖子
Valery Ochkov 2024/2/10 19:44:00
#5 已发布: 2024/2/11 01:58:11
Jean Giraud

Jean Giraud

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

组: User

As well, while associates with Bolean Critical region

Solve [Dichotomy_Newton_Secant] Copy.sm (52.75 KiB)已下载 1508 次。
1位用户喜欢此帖子
Valery Ochkov 2024/2/11 02:13:00
#6 已发布: 2024/2/11 02:53:28
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

Roots vs Newton
2-17.png
#7 已发布: 2024/2/11 07:55:50
Jean Giraud

Jean Giraud

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

组: User

Wrote

oots vs Newton


No interest vs the codes

#8 已发布: 2024/2/11 13:41:06
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

Wrote

Wrote

Roots vs Newton


No interest vs the codes



https://www.mdpi.com/2227-7390/10/19/3413
#9 已发布: 2024/2/11 21:59:12
Jean Giraud

Jean Giraud

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

组: User

roots solves Matrix.

Worksheet33.sm (6.96 KiB)已下载 1602 次。
#10 已发布: 2024/2/13 06:19:59
Martin Kraska

Martin Kraska

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

组: Moderator

mNewton() from the Maxima plugin is another option. It also may fail for particular initial guess values.

mNewton.sm (16.22 KiB)已下载 1670 次。
mNewton.png
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
Alvaro 2024/2/29 12:13:00
  • 有新帖
  • 无新帖