Wrong symbolic computation

Wrong symbolic computation - Mensajes

#1 Publicado: 7/9/2016 11:03:15
Martin Kraska

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: Moderator

I try to understand what the problem in the given example is. To me, the result highlighted in red looks like a plain bug.

Usually, unexpected results of function evaluation can be avoided by inspecting the actually stored definition in the dynamic assistant.

In the given example, the stored definition looks pretty innocent. Thus, how would you be safe in this situation, except for sticking to the survival rule "never use symbolic optimization".

If you don't want to rely on user's care at evaluation time, you have to enforce this by casting eval() into the definition. This deteriorates the readibility of the documents, makes them more like program code, less like paper and pencil.

I am aware of Davide's great user function tutorial in the online gallery but did not find an explanation for the observed behaviour.

Could the bug be related to some sort of short cut of the type "zero times something is zero"? This is only true if both factors are scalars...

mat-sym.sm (30,56 KiB) descargado 1237 vez(es).
mat-sym.PNG
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
A 1 usuarios les gustó este mensaje
Radovan Omorjan 7/9/2016 11:09:00
#2 Publicado: 7/9/2016 11:20:15
Radovan Omorjan

Radovan Omorjan

325 me gusta y 1 no me gusta en 2.052 mensajes.

Grupo: Moderator

Hello Martin,

Just to repeat, after so many years of using SMath I just feel we are in some kind of an infinite loop (like on a roller coaster), over and over, and we seek for some escape - but I do not know what the escape really means.

Regards,
Ra
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Publicado: 7/9/2016 11:34:47
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: Super Administrator

This is very simple - bug in symbolic library. It thinks that everything that multiplied by zero should result to zero. Bug. Will fix it today in the evening.

Numeric calculation engine has no such issue and that is why eval() helps you. As I already mentioned, eval allows to calculate expression numerically without help from symbolic calculation library.

This is also described here: http://smath.info/bts/Issues/IssueDetail.aspx?id=15. Unfortunately I've missed this ticked earlier.

Thank you!
A 1 usuarios les gustó este mensaje
sergio 7/9/2016 12:20:00
#4 Publicado: 7/9/2016 12:17:08
Martin Kraska

Martin Kraska

1.361 me gusta en 2.275 mensajes.

Grupo: Moderator

Wrote

This is very simple - bug in symbolic library. It thinks that everything that multiplied by zero should result to zero. Bug. Will fix it today in the evening.

Numeric calculation engine has no such issue and that is why eval() helps you. As I already mentioned, eval allows to calculate expression numerically without help from symbolic calculation library.



Thanks for the explanation. Great to hear that the fix doesn't require rewriting SMath.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#5 Publicado: 7/9/2016 13:57:24
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Martin, Radovan, Andrey: you are all wrong !

The example is incorrectly setup. You do't multiply
a function by a vector, the other way around: multiply
a vector by a function. Same as 2D rotation, 3D rotation.
Here Mathcad 11 would turn red with an error message.
Vector and function product is NOT commutative.

Jean

VectorFunction Rule.gif
#6 Publicado: 7/9/2016 17:16:22
Andrey Ivashov

Andrey Ivashov

2.343 me gusta en 4.056 mensajes.

Grupo: Super Administrator

Fixed.

A 4 usuarios les gustó este mensaje
Martin Kraska 7/9/2016 19:27:00, NDTM Amarasekera 7/9/2016 23:23:00, Mike Kaganski 8/9/2016 0:57:00, Radovan Omorjan 8/9/2016 2:03:00
#7 Publicado: 8/9/2016 9:27:36
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

That's what I meant about the rule "object * function".
Please read more in the attached work sheet.

Jean

Forum VectorFunction Rule.gif

2D Plot Multitrace [Vector_Function].sm (20,13 KiB) descargado 1065 vez(es).
  • Nuevos mensajes
  • Sin mensajes nuevos