SMath Studio Forum
»
SMath Studio
»
Questions
»
Making Vector Elements Cumulative
![ioncube ioncube](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f17342.png&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 ![Man Man](/forum/Themes/yafvision/male.gif) ![Pakistan Pakistan](/forum/Content/images/flags/PK.png) 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? ![](https://i.imgur.com/7KSBDM8.png) I have started additions from the 6th element because first x4 were zero ...but I think you get the idea! https://imgur.com/7KSBDM8Secondly 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 23 time(s).
|
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) cumulatively adds vector elements ![VectSum.PNG](/forum/resource.ashx?a=22885&b=2)
|
|
|
|
![ioncube ioncube](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f17342.png&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 ![Man Man](/forum/Themes/yafvision/male.gif) ![Pakistan Pakistan](/forum/Content/images/flags/PK.png) 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
|
|
|
|
![PompelmoTell PompelmoTell](/forum/resource.ashx?u=1505) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 319 ![Man Man](/forum/Themes/yafvision/male.gif) ![Italy Italy](/forum/Content/images/flags/IT.png) Location: italy Was thanked: 109 time(s) in 93 post(s)
|
![](/forum/resource.ashx?imgprv=1481) sergio
|
![thanks](/forum/Themes/yafvision/heart_small.png) 1 user thanked PompelmoTell for this useful post.
|
|
|
![ElSid ElSid](/forum/images/noavatar.gif) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 ![Man Man](/forum/Themes/yafvision/male.gif) ![United States United States](/forum/Content/images/flags/US.png) Location: USA Was thanked: 17 time(s) in 15 post(s)
|
Sum the vectors and vectorize ...
|
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) cumulatively adds vector elements ... as you wish ![VectSumCumul.PNG](/forum/resource.ashx?a=22886&b=2)
|
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
![ioncube ioncube](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f17342.png&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 ![Man Man](/forum/Themes/yafvision/male.gif) ![Pakistan Pakistan](/forum/Content/images/flags/PK.png) Was thanked: 2 time(s) in 2 post(s)
|
|
|
|
|
![ioncube ioncube](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f17342.png&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 ![Man Man](/forum/Themes/yafvision/male.gif) ![Pakistan Pakistan](/forum/Content/images/flags/PK.png) 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](/forum/resource.ashx?a=22888&b=2)
|
|
|
|
![ElSid ElSid](/forum/images/noavatar.gif) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 ![Man Man](/forum/Themes/yafvision/male.gif) ![United States United States](/forum/Content/images/flags/US.png) 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](/forum/resource.ashx?a=22889&b=2) Edited by user 23 April 2018 23:16:04(UTC)
| Reason: Not specified
|
|
|
|
![mkraska mkraska](/forum/images/noavatar.gif) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,990 ![Germany Germany](/forum/Content/images/flags/DE.png) Was thanked: 1128 time(s) in 724 post(s)
|
|
|
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) 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.smHere is your plot and cumulative. ![Cumulative.PNG](/forum/resource.ashx?a=22892&b=2) Project PR EOS.sm (130kb) downloaded 34 time(s).
|
|
|
|
![ioncube ioncube](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f17342.png&width=100&height=100) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 ![Man Man](/forum/Themes/yafvision/male.gif) ![Pakistan Pakistan](/forum/Content/images/flags/PK.png) 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
|
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) 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.
|
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: Jean Giraud ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) You are right: Martin latest version throws error in my 6179. Try that in your version. ![Cumul 6179.PNG](/forum/resource.ashx?a=22913&b=2)
|
|
|
|
![ndtma ndtma](/forum/resource.ashx?u=3905) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 05/06/2014(UTC) Posts: 348 ![Man Man](/forum/Themes/yafvision/male.gif) ![Sri Lanka Sri Lanka](/forum/Content/images/flags/LK.png) Location: Colombo Was thanked: 127 time(s) in 82 post(s)
|
Originally Posted by: PompelmoTell ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) ![](/forum/resource.ashx?imgprv=1481) 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](/forum/resource.ashx?a=31258&b=2) ![Cum_Totals.png](/forum/resource.ashx?a=31259&b=2) 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](/forum/Themes/yafvision/heart_small.png) 1 user thanked ndtma for this useful post.
|
|
|
![Razonar Razonar](/forum/images/noavatar.gif) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,370 ![Uruguay Uruguay](/forum/Content/images/flags/UY.png) Was thanked: 830 time(s) in 526 post(s)
|
|
![thanks](/forum/Themes/yafvision/heart_small.png) 3 users thanked Razonar for this useful post.
|
on 09/08/2019(UTC), on 09/08/2019(UTC), on 09/08/2019(UTC)
|
|
![ndtma ndtma](/forum/resource.ashx?u=3905) ![](/forum/Images/Ranks/Advanced-Member.png) Rank: Advanced Member Groups: Registered
Joined: 05/06/2014(UTC) Posts: 348 ![Man Man](/forum/Themes/yafvision/male.gif) ![Sri Lanka Sri Lanka](/forum/Content/images/flags/LK.png) Location: Colombo Was thanked: 127 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](/forum/resource.ashx?a=31273&b=2) 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 |
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ndtma ![Go to Quoted Post Go to Quoted Post](/forum/Themes/yafvision/icon_latest_reply.gif) cumulative totals of a large array of 20820 elements. ... the word is array1. Unwrap the array in vector 2. ΣV ... vector sum over the unwrapped array SS 6179 does not open your document.
|
|
|
|
![Jean Giraud Jean Giraud](/forum/resource.ashx?url=http%3a%2f%2fen.smath.info%2fforum%2fUploads%2f9678.PNG&width=100&height=100) Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 ![Canada Canada](/forum/Content/images/flags/CA.png) Was thanked: 981 time(s) in 809 post(s)
|
...more and otherwise. vectSum.sm (16kb) downloaded 15 time(s).
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Making Vector Elements Cumulative
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.