SMath Studio Forum
»
SMath Studio
»
Questions
»
Making Vector Elements Cumulative
Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 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/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 22 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube cumulatively adds vector elements
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 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
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 319 Location: italy Was thanked: 109 time(s) in 93 post(s)
|
sergio
|
1 user thanked PompelmoTell for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 Location: USA Was thanked: 17 time(s) in 15 post(s)
|
Sum the vectors and vectorize ...
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube cumulatively adds vector elements ... as you wish
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 Was thanked: 2 time(s) in 2 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 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?
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 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) Edited by user 23 April 2018 23:16:04(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,985 Was thanked: 1124 time(s) in 721 post(s)
|
|
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube 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. Project PR EOS.sm (130kb) downloaded 34 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/12/2017(UTC) Posts: 61 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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ioncube 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: Jean Giraud You are right: Martin latest version throws error in my 6179. Try that in your version.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/06/2014(UTC) Posts: 348 Location: Colombo Was thanked: 125 time(s) in 82 post(s)
|
Originally Posted by: PompelmoTell 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).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 |
1 user thanked ndtma for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
|
3 users thanked Razonar for this useful post.
|
on 09/08/2019(UTC), on 09/08/2019(UTC), on 09/08/2019(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/06/2014(UTC) Posts: 348 Location: Colombo Was thanked: 125 time(s) in 82 post(s)
|
Hello Alvaro I get following result in my laptop. Yours is a very good alternative. Thanks. 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 |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ndtma 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 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.