1 páginas (7 elementos)
Wrong symbolic computation - Mensajes
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).

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).
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
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
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!"
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!
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
WroteThis 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
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
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
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
That's what I meant about the rule "object * function".
Please read more in the attached work sheet.
Jean

2D Plot Multitrace [Vector_Function].sm (20,13 KiB) descargado 1065 vez(es).
Please read more in the attached work sheet.
Jean

2D Plot Multitrace [Vector_Function].sm (20,13 KiB) descargado 1065 vez(es).
1 páginas (7 elementos)
- Nuevos mensajes
- Sin mensajes nuevos