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

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline ioncube  
#1 Posted : 23 April 2018 20:20:34(UTC)
ioncube


Rank: Advanced Member

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

Was thanked: 2 time(s) in 2 post(s)
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 22 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 23 April 2018 20:47:10(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 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: Advanced Member

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

Was thanked: 2 time(s) in 2 post(s)
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: 318
Man
Italy
Location: italy

Was thanked: 109 time(s) in 93 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: 433
Man
United States
Location: USA

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

Rank: Guest

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

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


... as you wish

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

Rank: Guest

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

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


Rank: Advanced Member

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

Was thanked: 2 time(s) in 2 post(s)
Thank you PompelmoTell
Offline ioncube  
#9 Posted : 23 April 2018 23:01:59(UTC)
ioncube


Rank: Advanced Member

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

Was thanked: 2 time(s) in 2 post(s)
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: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 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,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
cumsum.png
cumsum.sm (4kb) downloaded 32 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#12 Posted : 24 April 2018 03:47:19(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 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 34 time(s).
Offline ioncube  
#13 Posted : 24 April 2018 04:08:11(UTC)
ioncube


Rank: Advanced Member

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

Was thanked: 2 time(s) in 2 post(s)
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
Offline Jean Giraud  
#14 Posted : 24 April 2018 06:11:37(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 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.
Offline Jean Giraud  
#15 Posted : 24 April 2018 06:28:22(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 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: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 124 time(s) in 82 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 16 time(s).

Cumulative Sum of a Large Matrix.sm (31kb) downloaded 22 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

Look within!... The secret is inside you.
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: 1,356
Uruguay

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

Cumulative Sum of a Large Matrix.sm (26kb) downloaded 19 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: 348
Man
Sri Lanka
Location: Colombo

Was thanked: 124 time(s) in 82 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

Look within!... The secret is inside you.
Best Regards
Eng. NDTM Amarasekera - Sri Lanka
Offline Jean Giraud  
#19 Posted : 09 August 2019 19:31:37(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 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
Offline Jean Giraud  
#20 Posted : 10 August 2019 01:12:35(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
...more and otherwise.

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