Bug in implementation of Matrices

Bug in implementation of Matrices - Messaggi

#1 Pubblicato: 01/12/2016 13:50:20
Steelweaver52

Steelweaver52

0 apprezzamenti in 3 post.

Gruppo: 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 Pubblicato: 01/12/2016 14:20:23
Alexander O. Melnik

Alexander O. Melnik

127 apprezzamenti in 498 post.

Gruppo: 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) scaricato 1324 volta(e).

P.S.: Once you learn SMath, mathcad feels awkward (but faster in some cases).
3 utenti hanno apprezzato questo post
Steelweaver52 01/12/2016 15:53:00, frapuano 01/12/2016 16:35:00, Davide Carpi 01/12/2016 21:01:00
#3 Pubblicato: 01/12/2016 20:48:59
Jean Giraud

Jean Giraud

983 apprezzamenti in 6.866 post.

Gruppo: User

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

Inst_Wind Mill.sm (310,09 KiB) scaricato 1394 volta(e).
  • Nuovi post
  • Nessun nuovo post