1 Pages (4 items)
Repeating calculations - Messages
#1 Posted: 4/11/2013 4:48:07 PM
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 109 time(s).
Another way of creating tabular data.
repeating_calculations3.sm (9 KiB) downloaded 109 time(s).
2 users liked this post
#2 Posted: 4/11/2013 5:50:05 PM
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 90 time(s).
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 90 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
#3 Posted: 4/11/2013 6:33:40 PM
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.
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
WroteThanks! 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
1 Pages (4 items)
-
New Posts
-
No New Posts