Repeating calculations

Repeating calculations - 消息

#1 已发布: 2013/4/11 16:48:07
kilele

kilele

134个赞,共397个帖子。

组: 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.69 KiB)已下载 1634 次。
2位用户喜欢此帖子
Radovan Omorjan 2013/4/12 04:17:00, Davide Carpi 2013/4/12 06:52:00
#2 已发布: 2013/4/11 17:50:05
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: 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.96 KiB)已下载 1614 次。
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
2位用户喜欢此帖子
Radovan Omorjan 2013/4/12 04:17:00, Davide Carpi 2013/4/12 06:52:00
#3 已发布: 2013/4/11 18:33:40
kilele

kilele

134个赞,共397个帖子。

组: 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位用户喜欢此帖子
Radovan Omorjan 2013/4/12 04:18:00
#4 已发布: 2013/4/14 05:51:21
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: 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.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
  • 有新帖
  • 无新帖