Rank: Advanced Member Groups: Registered
Joined: 03/06/2023(UTC) Posts: 41 Was thanked: 1 time(s) in 1 post(s)
|
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 Curry Loveland, CO
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: JReg Thank you for any help you can give. You can make it piece wise ... first. Cheers ... Jean. System of Equations (1).sm (33kb) downloaded 3 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: JReg SMath isn't very fast. Sometimes works putting some eval() function or choosing Optimization / Numeric, but not always. Originally Posted by: JReg The difference is that in the first length(t) = 160 and 15 in the second. Originally Posted by: JReg if you start the loop from j = 1, then S[j-1] is S[0], and SMath have only ORIGIN = 1. Best regards. Alvaro Edited by user 03 June 2023 20:04:09(UTC)
| Reason: Not specified
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 03/06/2023(UTC) Posts: 41 Was thanked: 1 time(s) in 1 post(s)
|
Thanks Origin = 1 was the problem. It’s hard not to let MATHCAD affect my syntax. |
Reg Curry Loveland, CO
|
|
|
|
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.