HELP WITH PROGRAM RUNTIME

HELP WITH PROGRAM RUNTIME - NEW TO SMATH PROGRAMMING - 消息

#1 已发布: 2023/6/3 06:52:38
RegRetired

RegRetired

8个赞,共144个帖子。

组: User

I am new to SMATH as a previous post indicated. I really need help with programming.

Here is a program I wrote several years ago. It takes almost 20 seconds to run. Scroll down to the section with the nested for-loops in the program. It is a program for coupled finite difference equations.
未找到文件。

When I was working on this, someone on the forum modified the code as follows so that it runs instantly. I cannot find the difference because I pasted in from this program its nested for-loops to the above one and got no improvement in runtime. What is the difference?
未找到文件。

I am trying to get this much simpler program to run. It seems to be in an endless loop. At least it hasn't finished after several minutes. In Mathcad 15 it runs instantly. I tried to copy the syntax from the above program. Where am I going wrong?
未找到文件。

Thank you for any help you can give.
Reg Curry
Reg CurryLoveland, CO
#2 已发布: 2023/6/3 13:20:45
Jean Giraud

Jean Giraud

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

组: User

Wrote

Thank you for any help you can give.


You can make it piece wise ... first.
Cheers ... Jean.

System of Equations (1).sm (32.85 KiB)已下载 1462 次。
#3 已发布: 2023/6/3 13:26:40
Alvaro

Alvaro

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

组: User

Wrote

未找到文件。


SMath isn't very fast. Sometimes works putting some eval() function or choosing Optimization / Numeric, but not always.

Wrote

未找到文件。


The difference is that in the first length(t) = 160 and 15 in the second.

Wrote

未找到文件。


if you start the loop from j = 1, then S[j-1] is S[0], and SMath have only ORIGIN = 1.

Best regards.
Alvaro
#4 已发布: 2023/6/3 15:51:35
Jean Giraud

Jean Giraud

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

组: User

... Project REG Unk.sm (12.24 KiB)已下载 1513 次。
#5 已发布: 2023/6/3 16:33:19
RegRetired

RegRetired

8个赞,共144个帖子。

组: User

Thanks

Origin = 1 was the problem. It’s hard not to let MATHCAD affect my syntax.
Reg CurryLoveland, CO
  • 有新帖
  • 无新帖