Repeating calculations

Repeating calculations - Messages

#1 Posted: 4/11/2013 4:48:07 PM
kilele

kilele

133 likes in 397 posts.

Group: User

Hi, this is a sample made by Radovan on how to repeat calculations but using mat2sys and sys2mat from the customFunctions plugin
Another way of creating tabular data.

repeating_calculations3.sm (9 KiB) downloaded 137 time(s).
2 users liked this post
Radovan Omorjan 4/12/2013 4:17:00 AM, Davide Carpi 4/12/2013 6:52:00 AM
#2 Posted: 4/11/2013 5:50:05 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Some care is required when creating tables by application of functions to lists (systems).

If more than one list or more than one occurance of a list is involved in the expression to apply, then the resulting list contains all possible combinations of elements from the individual lists and the resulting length is a power of the input list length.

There may be unexpected effects of symbolic optimization of the function definition. At least, symbolic and numeric optimization may result in different list sizes.

In the example, symbolic optimization results in storage of 2*x instead of x+x thus reducing the number of list occurences and thereby the size of the result.
listen.sm (7 KiB) downloaded 114 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 users liked this post
Radovan Omorjan 4/12/2013 4:17:00 AM, Davide Carpi 4/12/2013 6:52:00 AM
#3 Posted: 4/11/2013 6:33:40 PM
kilele

kilele

133 likes in 397 posts.

Group: User

Thanks! so I was quite wrong as of suggesting systems to create tables.
It is error-prone because most of the time one wants to compute several lists on the same expression.
1 users liked this post
Radovan Omorjan 4/12/2013 4:18:00 AM
#4 Posted: 4/14/2013 5:51:21 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Thanks! so I was quite wrong as of suggesting systems to create tables.
It is error-prone because most of the time one wants to compute several lists on the same expression.



I would not go that far to say the suggestion was wrong. The procedure is safe and convenient as long as you know what you are doing. However, people just seeing such examples may wrongly generalize to expressions with multiple list occurences. It would help a lot if implicit looping with index vectors just as in Mathcad was available.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
  • New Posts New Posts
  • No New Posts No New Posts