Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


3 Pages<123>
Options
Go to last post Go to first unread
Offline Razonar  
#21 Posted : 16 February 2018 15:01:36(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: MBernacca Go to Quoted Post
Just an exercise on Smath to test functionalities and capabilities.
Try the attached file and play with it.

Thanks
Marco
InterX.sm (86kb) downloaded 123 time(s).


Hi Marco. Here some comments about your great file. As you suggest, I play with it.
Best regards.
Alvaro.

InterX.r1.sm (78kb) downloaded 44 time(s).

thanks 1 user thanked Razonar for this useful post.
on 16/02/2018(UTC)
Offline Jean Giraud  
#22 Posted : 16 February 2018 17:55:14(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Razonar Go to Quoted Post
Try the attached file and play with it.


1. Marco => still computing after 15 min ? !
2. Alvaro => red from top to bottom
Offline Jean Giraud  
#23 Posted : 16 February 2018 18:24:05(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Razonar Go to Quoted Post
Try the attached file and play with it.

Attached is about timing in work sheet.
Observe the sequential timing [black].
t0:=time(1) is in collapsed area.

Contour_8 Hypersurface.sm (1,207kb) downloaded 15 time(s).

Offline Andrey Ivashov  
#24 Posted : 16 February 2018 18:31:14(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi Marco. Here some comments about your great file. As you suggest, I play with it.
Best regards.
Alvaro.

1 min 53 sec on my windows tablet pc.

Edited by user 16 February 2018 18:38:26(UTC)  | Reason: Not specified

Offline Ber7  
#25 Posted : 16 February 2018 19:09:46(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 437
Man
Israel
Location: Beer-Sheva

Was thanked: 520 time(s) in 288 post(s)
Originally Posted by: Andrey Ivashov Go to Quoted Post


1 min 53 sec on my windows tablet pc.

SMath Studio 0.99.6611 time(0)-to =83.735 s on my windows10


Offline ndtma  
#26 Posted : 16 February 2018 19:31:34(UTC)
ndtma


Rank: Advanced Member

Groups: Registered
Joined: 05/06/2014(UTC)
Posts: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 125 time(s) in 82 post(s)
Originally Posted by: Ber7 Go to Quoted Post
Originally Posted by: Andrey Ivashov [url=/forum/yaf_postsm47126_Line-intersections.aspx#post47126][/url]

1 min 53 sec on my windows tablet pc.
SMath Studio 0.99.6611time(0)-to =83.735 son my windows10


Time taken in my win 10 laptop with SS 0.99.6619 shown.

InterXr1.JPG
Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline Davide Carpi  
#27 Posted : 16 February 2018 19:54:42(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
5 min 25 s (win 10 x64, intel i5 quad core 2.40GHz)
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Davide Carpi  
#28 Posted : 16 February 2018 21:07:54(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: Davide Carpi Go to Quoted Post
5 min 25 s (win 10 x64, intel i5 quad core 2.40GHz)


reduced to 30-35 seconds using ranged indices to replace stack/augment/submatrix (most heavy operations were in stack/augment under loops)

InterX.r1 - ranged indices.sm (88kb) downloaded 32 time(s).

Edited by user 16 February 2018 21:09:42(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 16/02/2018(UTC)
Offline Andrey Ivashov  
#29 Posted : 16 February 2018 21:11:46(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
18 seconds on my env.

Great! Thank you Davide!
Offline Andrey Ivashov  
#30 Posted : 16 February 2018 21:49:26(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
BTW, I would suggest to use another version of plotG which is much faster then previous one (and simplier):
plotG.PNG

Code:
plotG(x,y,char,size,color):line(k:range(1,rows(x)),augment(x,y,el(r3,k):char,el(r4,k):size,el(r5,k):color),2,1)

Code:
plotG(xy,char,size,color):line(k:range(1,rows(xy)),augment(xy,el(r3,k):char,el(r4,k):size,el(r5,k):color),2,1)


Best regards.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 17/02/2018(UTC)
Offline Razonar  
#31 Posted : 16 February 2018 22:18:55(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. Just one more thing, I guess: the only one remaining matlab function, mwfind replaced. (Orignal work have many) If I'm not wrong, it is now 100% SMath native. But double the amazing time obtained by Davide. But it's just a "scalar" implementation, sure there are better ones.

Best regards.

Alvaro.

PD: I don't replace plotG because don't understand very well that syntax.

InterX.r1 - ranged indices.sm (91kb) downloaded 19 time(s).
Offline Andrey Ivashov  
#32 Posted : 16 February 2018 22:45:48(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Originally Posted by: Razonar Go to Quoted Post
I don't replace plotG because don't understand very well that syntax.

It is simple - ranged indexes used.

Just take a look at the speed:
plotG_2.PNG

Best regards.
Offline Razonar  
#33 Posted : 16 February 2018 22:59:17(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Andrey Ivashov Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
I don't replace plotG because don't understand very well that syntax.

It is simple - ranged indexes used.


Thanks for the explanation, now I see the speed increment, and I don't think that it could be that big difference before you show it.

But actually the plotG(4) routine was which confuse me. I prefer

Code:
plotG(xy,char,size,color):if(cols(xy)>1,plotG(col(xy,1),col(xy,2),char,size,color),plotG(Re(xy),Im(xy),char,size,color))


because I think that any good plot implementation must to use complexes but not couple of reals. So, if xy argument have only one column, one can assume that data are as Z = X + iY.

Best regards.

Alvaro.

Edited by user 16 February 2018 23:02:18(UTC)  | Reason: Not specified

Offline Davide Carpi  
#34 Posted : 16 February 2018 23:08:15(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Quote:
because I think that any good plot implementation must to use complexes but not couple of reals. So, if xy argument have only one column, one can assume that data are as Z = X + iY.


Andrey misses this detail of your function about the complex values, but you can still do it; keep the if statement and replace the loops (the case with more than a column as shown by Andrey doesn't require the col() functions, this is redundant and time consuming... If you think that more than 2 columns might be provided, add the case and a single sumbatrix instead Good )

Edited by user 17 February 2018 13:22:35(UTC)  | Reason: typo

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 16/02/2018(UTC)
Offline alyles  
#35 Posted : 17 February 2018 00:24:21(UTC)
alyles


Rank: Advanced Member

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

Was thanked: 91 time(s) in 57 post(s)
Originally Posted by: Razonar Go to Quoted Post
But double the amazing time obtained by Davide. But it's just a "scalar" implementation, sure there are better ones.


Here's my pure SMATH find function. with similar time to MWFIND.

InterX.r1 - ranged indices_alyles.sm (95kb) downloaded 33 time(s).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
thanks 4 users thanked alyles for this useful post.
on 17/02/2018(UTC),  on 17/02/2018(UTC),  on 17/02/2018(UTC),  on 17/02/2018(UTC)
Offline mkraska  
#36 Posted : 17 February 2018 15:35:24(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Andrey Ivashov Go to Quoted Post
BTW, I would suggest to use another version of plotG which is much faster then previous one (and simplier):
plotG.PNG

Code:
plotG(x,y,char,size,color):line(k:range(1,rows(x)),augment(x,y,el(r3,k):char,el(r4,k):size,el(r5,k):color),2,1)

Code:
plotG(xy,char,size,color):line(k:range(1,rows(xy)),augment(xy,el(r3,k):char,el(r4,k):size,el(r5,k):color),2,1)


Best regards.


For such uses it would be good if the augment and stack functions could expand scalar arguments (or more generally any arguments not matching the maximum number of rows or cols) to uniformly populated vectors of the required size).

Then the above example wouldn't even need a helper function as you could write
Code:
augment(x,y,"*",10,"red")


Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 17/02/2018(UTC),  on 17/02/2018(UTC)
Offline Andrey Ivashov  
#37 Posted : 17 February 2018 15:39:40(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Very good suggestion, Martin! I think I could do this.

Best regards.
thanks 4 users thanked Andrey Ivashov for this useful post.
on 17/02/2018(UTC),  on 17/02/2018(UTC),  on 17/02/2018(UTC),  on 17/02/2018(UTC)
Offline omorr  
#38 Posted : 17 February 2018 19:20:11(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Originally Posted by: mkraska Go to Quoted Post
For such uses it would be good if the augment and stack functions could expand scalar arguments (or more generally any arguments not matching the maximum number of rows or cols) to uniformly populated vectors of the required size).

Then the above example wouldn't even need a helper function as you could write
Code:
augment(x,y,"*",10,"red")



I also vote for that augment() and stack () functionality.

In that case, we could even have "plot" functions (with the same functionality as augment())
Code:

plot(x,y)
plot(x,y,"*")
plot(x,y,"*",10)
plot(x,y,"*",10,"red")

This efforts are, of course, not justified if the micro Mathematics plot style would be introduced.

Regards,
Radovan

Edited by user 17 February 2018 19:24:41(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 19/02/2018(UTC)
Offline Jean Giraud  
#39 Posted : 19 February 2018 04:58:48(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Hello Marco,

I'm trying for the intersection of the two Trifolium, .
blue => native ... red => rotated.
They are created in "Page1 Trifolium.sm
Then recalled for the InterX(T1,T2)
Nothing happens >>> 1 hr ? [Win 7 Starter Edition ... 1.66 GHz]
Is it supposed to work ? Thanks in advance.

Page1 Trifolium.sm (33kb) downloaded 12 time(s).

Maths InterseX [Marco].sm (52kb) downloaded 11 time(s).
Offline Razonar  
#40 Posted : 19 February 2018 06:26:16(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi Jean.

You are using an old version of the program. Try this one.

Notice that the point (0,0) is found several times by the algorithm. It could be interesting to check if it get the correct number of crosses at the origin.

Best regards.

Alvaro.

cross.jpg

InterX.r1 - ranged indices_alyles.sm (89kb) downloaded 23 time(s).
Users browsing this topic
Guest
3 Pages<123>
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.