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 ioncube  
#1 Posted : 23 April 2018 20:20:34(UTC)
ioncube


Rank: Member

Groups: Registered
Joined: 04/12/2017(UTC)
Posts: 27
Man
Pakistan

In the attachment at the start of Page.5 I (so far) am unable to construct a loop or something that cumulatively adds vector elements down the column. So I am manually doing this for now, any ideas?



I have started additions from the 6th element because first x4 were zero ...but I think you get the idea!

https://imgur.com/7KSBDM8

Secondly in the last page there is a 2D-graph. One can easily read the intersection of two lines however is there any solution to find the intercept of two lines when they aren't functions but are rather data points?

Remembraning.sm (39kb) downloaded 17 time(s).
Online Jean Giraud  
#2 Posted : 23 April 2018 20:47:10(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
Originally Posted by: ioncube Go to Quoted Post
cumulatively adds vector elements


VectSum.PNG
Offline ioncube  
#3 Posted : 23 April 2018 21:03:49(UTC)
ioncube


Rank: Member

Groups: Registered
Joined: 04/12/2017(UTC)
Posts: 27
Man
Pakistan

no no ...I think I was unable to make you understand. The summation gives one value ...instead I wanted to have a cumulative elements in a vector. The latter thus can be plotted. please revisit the screenshot
Offline PompelmoTell  
#4 Posted : 23 April 2018 21:37:46(UTC)
PompelmoTell


Rank: Advanced Member

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

Was thanked: 64 time(s) in 54 post(s)

sergio
thanks 1 user thanked PompelmoTell for this useful post.
on 09/08/2019(UTC)
Offline ElSid  
#5 Posted : 23 April 2018 21:59:45(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 279
Man
United States
Location: USA

Was thanked: 9 time(s) in 8 post(s)
Sum the vectors and vectorize ...
Online Jean Giraud  
#6 Posted : 23 April 2018 22:48:03(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
Originally Posted by: ioncube Go to Quoted Post
cumulatively adds vector elements


... as you wish

VectSumCumul.PNG
Online Jean Giraud  
#7 Posted : 23 April 2018 22:56:06(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
Maths Vectorize.sm (10kb) downloaded 30 time(s).
Offline ioncube  
#8 Posted : 23 April 2018 22:56:33(UTC)
ioncube


Rank: Member

Groups: Registered
Joined: 04/12/2017(UTC)
Posts: 27
Man
Pakistan

Thank you PompelmoTell
Offline ioncube  
#9 Posted : 23 April 2018 23:01:59(UTC)
ioncube


Rank: Member

Groups: Registered
Joined: 04/12/2017(UTC)
Posts: 27
Man
Pakistan

Jean Giraud, why do you add Line in the following code, I mean why not just type them separately or am I missing something?

Screenshot_3.png
Offline ElSid  
#10 Posted : 23 April 2018 23:13:07(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 279
Man
United States
Location: USA

Was thanked: 9 time(s) in 8 post(s)
Jean,
Why did you use Sum(1) with a J loop?

Ioncube,
Just use Sum(4)
Sum Vector.PNG

Edited by user 23 April 2018 23:16:04(UTC)  | Reason: Not specified

Offline mkraska  
#11 Posted : 24 April 2018 02:27:53(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 789 time(s) in 504 post(s)
cumsum.png
cumsum.sm (4kb) downloaded 21 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
Online Jean Giraud  
#12 Posted : 24 April 2018 03:47:19(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
Originally Posted by: ioncube Go to Quoted Post
Jean Giraud, why do you add Line in the following code, I mean why not just type them separately or am I missing something?


Yes my friend, you are missing best using Smath feature,
1. the line | collects/instructs the project
2. the { collects for plotting
Visit attached Project PR EOS.sm

Here is your plot and cumulative.

Cumulative.PNG

Project PR EOS.sm (130kb) downloaded 22 time(s).
Offline ioncube  
#13 Posted : 24 April 2018 04:08:11(UTC)
ioncube


Rank: Member

Groups: Registered
Joined: 04/12/2017(UTC)
Posts: 27
Man
Pakistan

Thanks Jean. I myself am a chemical engineer & Equations of state example is very much appreciated!

mkraska, thanks for helping, but your file is created with a newer version of SMATh & throws error in my current version 0.98.6528
Online Jean Giraud  
#14 Posted : 24 April 2018 06:11:37(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
Originally Posted by: ioncube Go to Quoted Post
mkraska, thanks for helping, but your file is created with a newer version of SMATh

You are right: Martin latest version throws error in my 6179.
I love Martin code ... Bingo !
The code I provided should work, as it did previous Smath 5346.
Online Jean Giraud  
#15 Posted : 24 April 2018 06:28:22(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
You are right: Martin latest version throws error in my 6179.


Try that in your version.

Cumul 6179.PNG
Offline ndtma  
#16 Posted : 09 August 2019 09:16:20(UTC)
ndtma


Rank: Advanced Member

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

Was thanked: 66 time(s) in 44 post(s)
Originally Posted by: PompelmoTell Go to Quoted Post

sergio


I tested 3 programs to find the cumulative totals of a large array of 20820 elements.
The method of Sergio was incredibly fast, while other two methods were much slower.
Thanks Sergio.
Forgot to attach DATA file

Rainfal_Data.xlsx (487kb) downloaded 6 time(s).

Cumulative Sum of a Large Matrix.sm (31kb) downloaded 7 time(s).

Cum_Totals_Super Fast.png

Cum_Totals.png

Edited by user 09 August 2019 09:39:44(UTC)  | Reason: Forgot to attach DATA file

Never Give up. Great things take time.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
thanks 1 user thanked ndtma for this useful post.
on 09/08/2019(UTC)
Offline Razonar  
#17 Posted : 09 August 2019 11:38:20(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 384
Uruguay

Was thanked: 193 time(s) in 118 post(s)
Hi Nugegodage. Try this other one.

Cumulative Sum of a Large Matrix.sm (26kb) downloaded 11 time(s).

Clipboard.gif

(Notice that mi computer is very slow)
Best regards.
Alvaro

thanks 3 users thanked Razonar for this useful post.
on 09/08/2019(UTC),  on 09/08/2019(UTC),  on 09/08/2019(UTC)
Offline ndtma  
#18 Posted : 09 August 2019 17:33:32(UTC)
ndtma


Rank: Advanced Member

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

Was thanked: 66 time(s) in 44 post(s)
Hello Alvaro
I get following result in my laptop.
Yours is a very good alternative.
Thanks.

Cum_Totals_Super Fast2.png

Edited by user 09 August 2019 17:38:33(UTC)  | Reason: Not specified

Never Give up. Great things take time.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Online Jean Giraud  
#19 Posted : 09 August 2019 19:31:37(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
Originally Posted by: ndtma Go to Quoted Post
cumulative totals of a large array of 20820 elements.

... the word is array
1. Unwrap the array in vector
2. ΣV ... vector sum over the unwrapped array
SS 6179 does not open your document.

vectSum.PNG
Online Jean Giraud  
#20 Posted : 10 August 2019 01:12:35(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 3,852
Canada

Was thanked: 696 time(s) in 544 post(s)
...more and otherwise.

vectSum.sm (16kb) downloaded 6 time(s).
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.