Bug in implementation of Matrices

Bug in implementation of Matrices - 消息

#1 已发布: 2016/12/1 13:50:20
Steelweaver52

Steelweaver52

0个赞,共3个帖子。

组: User

[Version: 0.97 (Build: 5346), portable version]

Hi, Friends:

I'm seeing a bug in SMath's implementation of matrices...or at least column matrices...or at least in my use of them. Refer to the embedded image below.

On the left-hand side of the image is a MathCad calculation. On the right-hand side is the equivalent SMath calculation. At the top of the Mathcad worksheet, I defined MW to be "MegaWatts" so that I could produce a unit equivalent to SMath's "MW". Notice that these two worksheets track identically until one gets to the output value for Power. The Mathcad result differs from the SMath result. In the three bottom lines of the SMath worksheet, I essentially verify that the Mathcad worksheet contains the correct values. I did this by entering the velocity values individually, rather than as elements of a matrix.

I first noticed that there was a problem when I produced a similar SMath worksheet for a different assignment. On that assignment, I changed the top value of the matrix, and observed all three values of the output matrix changed! This shouldn't have happened. Only the top value of the output matrix should have changed. If you would like to recreate the very simple SMath worksheet shown on the right side above, you can observe that problem for yourself.

Thanks very much! (And SMath is still a great product!) ---Tom Nally

SMath_Bug.JPG
#2 已发布: 2016/12/1 14:20:23
Alexander O. Melnik

Alexander O. Melnik

127个赞,共498个帖子。

组: Moderator

what was your intention when doing v^3? From perspective of matrix operations it is equivalent to v*v*v which dot product of v & v times v.

What you want to use is vectorize(v^3), which will apply ^3 to each element of v.
VDOT.sm (7.69 KiB)已下载 1339 次。

P.S.: Once you learn SMath, mathcad feels awkward (but faster in some cases).
3位用户喜欢此帖子
Steelweaver52 2016/12/1 15:53:00, frapuano 2016/12/1 16:35:00, Davide Carpi 2016/12/1 21:01:00
#3 已发布: 2016/12/1 20:48:59
Jean Giraud

Jean Giraud

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

组: User

Your Smath & Mathcad are both wrong.
If it can help: read more =>

Inst_Wind Mill.sm (310.09 KiB)已下载 1408 次。
  • 有新帖
  • 无新帖