bug in matrix function involving a double loop

bug in matrix function involving a double loop - 消息

#1 已发布: 2022/3/29 12:52:52
Laurent Fournier

Laurent Fournier

9个赞,共66个帖子。

组: User

Hello, there is a simple turnaround so it's not a big deal, but still... This looks like a bug...
Or is there something I didn't understand?
I like to see the numbers in my engineering calculations, that why I use matrices.
Thanks everyone for your help/advice,
Thank you Andrey for this incredible software.
Regards
Laurent

未找到文件。未找到文件。
#2 已发布: 2022/3/29 15:10:10
sergio

sergio

127个赞,共342个帖子。

组: User

It's not really a bug but a smath behavior. If you add an "eval" that forces the numerical evaluation of the nested producer, it works
bug(s).sm (6.48 KiB)已下载 1629 次。
sergio
1位用户喜欢此帖子
Alvaro 2022/3/30 14:23:00
#3 已发布: 2022/3/29 16:00:13
Martin Kraska

Martin Kraska

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

组: Moderator

I'd still call it a bug. Is there any good reason why definition and display in separate cells behave differently from definition and display in the same cell?

There is no problem with def and display in different cells with the original definition (without eval). You also can use M:eval(sumofproduct(Ma))=

One would expect that the combination a:b=c would store b in a and then display a just as it would be displayed with a= in a subsequent cell.

Obviously this is not the case, either because
- there is a good reason from usage point of view (which I don't know) or
- there is a good reason from development point of view (e.g. too complicated to do it this way) or
- it is just a bug.

The error message "j not defined" is definitely a bug, why would one expect loop variables to require an additional definition.

In case the behaviour is too hard to fix, I would even recommend to remove the feature of display and def in the same cell. I know I was among those who asked for it many years ago but not at the cost of having to weave eval() into the sheet wherever it might help.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
2位用户喜欢此帖子
sergio 2022/3/29 16:02:00, Alvaro 2022/3/30 14:23:00
#4 已发布: 2022/3/29 16:24:05
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Augmented version ... no red SS 6179
If you don't see or have red the 3 blocks,
please let me know for a snippet image.
Cheers ... Jean.

bug 6179.sm (39.3 KiB)已下载 1666 次。
#5 已发布: 2022/3/29 19:11:50
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

I'd still call it a bug.


Yes, me too.
sum() and product() creates havoc sometimes.
The bug can be iron out with line() also, but why?
Why we need line() or eval() or symbolic/numeric to resolve these kind of issues?
sum() and product() used functions can't solve() or roots() too.

2022-03-30_01-01.png

otherbugs.png
#6 已发布: 2022/3/30 08:09:09
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

no red SS 6179



sumofproduct.PNG

  • 有新帖
  • 无新帖