Making Vector Elements Cumulative

Making Vector Elements Cumulative - Adding Vector Elements down the column - Poruke

#1 Objavljeno: 23. 4. 2018. 14:20:34
usamakhan

usamakhan

7 svidjanja u 98 postova.

Grupa: User

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 (38,42 KiB) preuzeto 1181 put(ova).
#2 Objavljeno: 23. 4. 2018. 14:47:10
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

cumulatively adds vector elements



VectSum.PNG
#3 Objavljeno: 23. 4. 2018. 15:03:49
usamakhan

usamakhan

7 svidjanja u 98 postova.

Grupa: User

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
#4 Objavljeno: 23. 4. 2018. 15:37:46
sergio

sergio

127 svidjanja u 342 postova.

Grupa: User

cumulativa.png
sergio
1 korisnika je svidelo ovu objavu
NDTM Amarasekera 9. 8. 2019. 03:20:00
#5 Objavljeno: 23. 4. 2018. 15:59:45
Ruben Sidranski

Ruben Sidranski

17 svidjanja u 465 postova.

Grupa: User

Sum the vectors and vectorize ...
#6 Objavljeno: 23. 4. 2018. 16:48:03
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

cumulatively adds vector elements



... as you wish

VectSumCumul.PNG
#7 Objavljeno: 23. 4. 2018. 16:56:06
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Maths Vectorize.sm (9,06 KiB) preuzeto 1223 put(ova).
#8 Objavljeno: 23. 4. 2018. 16:56:33
usamakhan

usamakhan

7 svidjanja u 98 postova.

Grupa: User

Thank you PompelmoTell
#9 Objavljeno: 23. 4. 2018. 17:01:59
usamakhan

usamakhan

7 svidjanja u 98 postova.

Grupa: User

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
#10 Objavljeno: 23. 4. 2018. 17:13:07
Ruben Sidranski

Ruben Sidranski

17 svidjanja u 465 postova.

Grupa: User

Jean,
Why did you use Sum(1) with a J loop?

Ioncube,
Just use Sum(4)
Sum Vector.PNG
#11 Objavljeno: 23. 4. 2018. 20:27:53
Martin Kraska

Martin Kraska

1.369 svidjanja u 2.283 postova.

Grupa: Moderator

cumsum.png
cumsum.sm (3,95 KiB) preuzeto 1150 put(ova).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#12 Objavljeno: 23. 4. 2018. 21:47:19
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

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 (129,66 KiB) preuzeto 1200 put(ova).
#13 Objavljeno: 23. 4. 2018. 22:08:11
usamakhan

usamakhan

7 svidjanja u 98 postova.

Grupa: User

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
#14 Objavljeno: 24. 4. 2018. 00:11:37
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

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.
#15 Objavljeno: 24. 4. 2018. 00:28:22
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

You are right: Martin latest version throws error in my 6179.



Try that in your version.

Cumul 6179.PNG
#16 Objavljeno: 9. 8. 2019. 03:16:20
NDTM Amarasekera

NDTM Amarasekera

130 svidjanja u 352 postova.

Grupa: User

Wrote

cumulativa.png
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 (486,31 KiB) preuzeto 812 put(ova).

Cumulative Sum of a Large Matrix.sm (30,38 KiB) preuzeto 1199 put(ova).

Cum_Totals_Super Fast.png

Cum_Totals.png
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
1 korisnika je svidelo ovu objavu
frapuano 9. 8. 2019. 03:43:00
#17 Objavljeno: 9. 8. 2019. 05:38:20
Alvaro

Alvaro

1.139 svidjanja u 1.805 postova.

Grupa: User

Hi Nugegodage. Try this other one.

Cumulative Sum of a Large Matrix.sm (25,32 KiB) preuzeto 1461 put(ova).

Clipboard.gif

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

3 korisnika je svidelo ovu objavu
sergio 9. 8. 2019. 06:43:00, frapuano 9. 8. 2019. 10:47:00, NDTM Amarasekera 9. 8. 2019. 11:43:00
#18 Objavljeno: 9. 8. 2019. 11:33:32
NDTM Amarasekera

NDTM Amarasekera

130 svidjanja u 352 postova.

Grupa: User

Hello Alvaro
I get following result in my laptop.
Yours is a very good alternative.
Thanks.

Cum_Totals_Super Fast2.png
Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
#19 Objavljeno: 9. 8. 2019. 13:31:37
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

Wrote

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
#20 Objavljeno: 9. 8. 2019. 19:12:35
Jean Giraud

Jean Giraud

983 svidjanja u 6.866 postova.

Grupa: User

...more and otherwise.

vectSum.sm (15,92 KiB) preuzeto 1339 put(ova).
  • Novi postovi
  • Nema novih postova