Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
Offline Jopi  
#1 Posted : 10 January 2022 13:27:12(UTC)
Jopi


Rank: Member

Groups: Registered
Joined: 12/03/2019(UTC)
Posts: 19
Germany

Was thanked: 1 time(s) in 1 post(s)
Hi all,
I have two files here, one in smath, one in mathcad.
The mathcad file is calculated about 1000 times faster, does anyone have a tip how to speed up the .sm file?

ts.sm (20kb) downloaded 41 time(s). ts.xmcd (61kb) downloaded 11 time(s).
Offline PompelmoTell  
#2 Posted : 10 January 2022 15:24:28(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 309
Man
Italy
Location: italy

Was thanked: 106 time(s) in 90 post(s)
By setting the formulas with the numeric optimization option switches from 29s to 19s. Still away from your expectations
sergio
Offline Jopi  
#3 Posted : 10 January 2022 15:42:53(UTC)
Jopi


Rank: Member

Groups: Registered
Joined: 12/03/2019(UTC)
Posts: 19
Germany

Was thanked: 1 time(s) in 1 post(s)
16 more equally good improvements and it is solved...
Thank you Sergio
Offline Jean Giraud  
#4 Posted : 10 January 2022 17:37:19(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,406
Canada

Was thanked: 928 time(s) in 756 post(s)
OFF topic of the speed, I don't understand your histogram.
Histogram take raw data from collection, ultimately to get a PDF.
Cheers ... Jean.

Stat Histogram DEMO.sm (24kb) downloaded 14 time(s).
Stat Histogram QUICK.sm (58kb) downloaded 12 time(s).
Offline Jopi  
#5 Posted : 14 January 2022 19:28:39(UTC)
Jopi


Rank: Member

Groups: Registered
Joined: 12/03/2019(UTC)
Posts: 19
Germany

Was thanked: 1 time(s) in 1 post(s)
Hi Jean,
Sorry for the delay, unfortunately I found no time...

I have attached my histogram again, revised it a bit and commented it.
Actually I think it does exactly what it should, but I have to admit
that I don't know the exact definition of a histogram 8)

Histogram_JP.sm (19kb) downloaded 25 time(s).

And again about the speed: I played a little with my definition of "rnorm"
and come to the strange result that my vector is calculated fastest when
I calculate it in pieces of 20 elements.
I would be happy if a more experienced user could explain this to me.

speed.sm (18kb) downloaded 22 time(s).

Have a nice weekend!
Johannes
Offline alyles  
#6 Posted : 14 January 2022 21:10:20(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 257
United States

Was thanked: 86 time(s) in 54 post(s)
This is the function I use for sampling from normal distribution.

speed-lyles.sm (18kb) downloaded 20 time(s).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline evsp  
#7 Posted : 28 January 2023 14:51:14(UTC)
evsp

Rank: Newbie

Groups: Registered
Joined: 28/01/2023(UTC)
Posts: 3
Hungary

Hi All,

I am new here, and facing similar problems. I intend to replace MathCad to an alternative solution due to PTC's pricing and support policy. I was very happy to find SMATH, and I started to test it. For short calculations it's a good alternative, but it seems very-very slow when long iterations are needed. I made a short loop both in Mcad and Smath containing just a few multiplications, and calculating it 1000000 times took ~0.2s for Mcad14, ~1s for Mcad8, and 32s for SMATH. So now I am a bit upset...
Offline alyles  
#8 Posted : 28 January 2023 16:11:27(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 257
United States

Was thanked: 86 time(s) in 54 post(s)
Care to share your .sm file?

Sometimes the are improvements to be made in how algorithms are structured.
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline Jean Giraud  
#9 Posted : 28 January 2023 16:46:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,406
Canada

Was thanked: 928 time(s) in 756 post(s)
Originally Posted by: evsp Go to Quoted Post
For short calculations it's a good alternative, but it seems very-very slow when long iterations are needed.

In some instances, Smath is slightly faster than Mathcad 11.
However, almost not observable.
In other instances, Smath is horribly slow.
1 min Julia in Mathcad takes over 2 hrs in Smath
Same observation Fourier CoC ... and more.
Please, attach your document for Smath Community to doctor.
Jean
Offline Jean Giraud  
#10 Posted : 28 January 2023 17:09:26(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,406
Canada

Was thanked: 928 time(s) in 756 post(s)
Originally Posted by: Jopi Go to Quoted Post
I have attached my histogram again, revised it a bit and commented it.
Actually I think it does exactly what it should, but I have to admit
that I don't know the exact definition of a histogram 8)

Your document does not open 'incorrect format'
Visit Wikipedia for Histogram.
Jean
Offline overlord  
#11 Posted : 28 January 2023 17:50:23(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 960
Turkey

Was thanked: 395 time(s) in 262 post(s)
SMath may not be fastest among them.
But some tricks can be applied.
It may improve calc speed slightly.

Regards

eval.png
Offline evsp  
#12 Posted : 28 January 2023 20:28:57(UTC)
evsp

Rank: Newbie

Groups: Registered
Joined: 28/01/2023(UTC)
Posts: 3
Hungary

speedtest.sm (5kb) downloaded 13 time(s).

This is the file I made exclusively for speed check. There is no need to improve this calc by modifying it's structure, it is just for test purposes not a real task.

I started to use Mathcad in the last century (V6.0). Good I made several calculations for example to simulate transient temperature rise of electrical rotating machines. I know there are better tools but I am familiar with MathCad that's why I am looking for a similar sw.
Offline Jean Giraud  
#13 Posted : 28 January 2023 22:06:16(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,406
Canada

Was thanked: 928 time(s) in 756 post(s)
Originally Posted by: evsp Go to Quoted Post
it is just for test purposes not a real task.


AlgoDemands.PNG

Offline Jean Giraud  
#14 Posted : 28 January 2023 22:44:01(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,406
Canada

Was thanked: 928 time(s) in 756 post(s)
Originally Posted by: evsp Go to Quoted Post
I made several calculations for example to simulate transient temperature rise of electrical rotating machines.

Attach your experimental data set.
Jean
Offline overlord  
#15 Posted : 29 January 2023 02:03:55(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 960
Turkey

Was thanked: 395 time(s) in 262 post(s)
Originally Posted by: evsp Go to Quoted Post
it is just for test purposes not a real task.

And speed of your test code fails under SMath drastically.
But we all know these issues. For huge iterations SMath is not useful.
Anyone who plans to use this software should know this, SMath is a one-man show.
There are no paid programmers who can give all their time to SMath.
Only a handful of developers are included in writing and enhancing the code.
And they are doing this in their spare time, without any charge.

Maybe Andrey improve iteration speeds in future, who knows.
We can request something, it is up to Andrey include or improve that.
It is what it is, a free software which gives us mathcad interface.

Reagrds
Offline evsp  
#16 Posted : 29 January 2023 14:28:17(UTC)
evsp

Rank: Newbie

Groups: Registered
Joined: 28/01/2023(UTC)
Posts: 3
Hungary

"Anyone who plans to use this software should know this"

Yes, sure. I installed SMath 3 days ago, and now I am checking it's usability for my tasks.

And many respect to Andrey! In the last few days I also found many points where SMath is superior to MathCad.

Offline alyles  
#17 Posted : 29 January 2023 15:52:11(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 257
United States

Was thanked: 86 time(s) in 54 post(s)
Originally Posted by: evsp Go to Quoted Post
speedtest.sm (5kb) downloaded 13 time(s).

This is the file I made exclusively for speed check. There is no need to improve this calc by modifying it's structure, it is just for test purposes not a real task.

I started to use Mathcad in the last century (V6.0). Good I made several calculations for example to simulate transient temperature rise of electrical rotating machines. I know there are better tools but I am familiar with MathCad that's why I am looking for a similar sw.


Just for demonstration purposes, I've been able to increase the speed of this calc ~25% on my machine just by using vectorization rather than the for loop. It's still not near the performance you'd like, but just goes to show there are often things to be done to improve calculation speed. Vectorization isn't always possible in some algorithms, but when it is, it's generally faster.

speedtest.pdf (36kb) downloaded 10 time(s).
speedtest.sm (9kb) downloaded 9 time(s).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline Jean Giraud  
#18 Posted : 29 January 2023 16:41:06(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,406
Canada

Was thanked: 928 time(s) in 756 post(s)
Maths algo DEMANDS.sm (6kb) downloaded 12 time(s).
Offline Jean Giraud  
#19 Posted : 29 January 2023 21:24:04(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,406
Canada

Was thanked: 928 time(s) in 756 post(s)
Originally Posted by: evsp Go to Quoted Post
And many respect to Andrey! In the last few days I also found many points where SMath is superior to MathCad.

In few days, imprudent to glorify the unknown yet.

OverGlorified.PNG

Offline overlord  
#20 Posted : 30 January 2023 00:36:37(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 960
Turkey

Was thanked: 395 time(s) in 262 post(s)
Originally Posted by: evsp Go to Quoted Post
In the last few days I also found many points where SMath is superior to MathCad.

You can't be more correct.
SMath may be behind than MathCad speed-wise.
But in terms of usability, features, visual aspects SMath is way better.
Just plugin support is a huge plus single alone.
Users browsing this topic
2 Pages12>
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.