Bug in implementation of Matrices

Bug in implementation of Matrices - Сообщения

#1 Опубликовано: 01.12.2016 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 Опубликовано: 01.12.2016 14:20:23
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: 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 КиБ) скачан 39 раз(а).

P.S.: Once you learn SMath, mathcad feels awkward (but faster in some cases).
3 пользователям понравился этот пост
Steelweaver52 01.12.2016 15:53:00, frapuano 01.12.2016 16:35:00, Davide Carpi 01.12.2016 21:01:00
#3 Опубликовано: 01.12.2016 20:48:59
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

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

Inst_Wind Mill.sm (310 КиБ) скачан 47 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений