Numerics or unit operation bug?

Numerics or unit operation bug? - Wrong calculation with units - Messages

#1 Posted: 9/27/2016 7:58:16 PM
MSL

MSL

1 likes in 22 posts.

Group: User

Hi
I always thank you for your efforts to improve the SMath.
I think that I found a bug of SMath calculation.
Please, check it.

Thank you!


pic.JPG
Bug report.sm (9 KiB) downloaded 36 time(s).
#2 Posted: 9/28/2016 4:34:35 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Seems you defined Rf as 1/Utest (definition in a placeholder)

2016-09-28 09_35_56-SMath Studio Desktop - [Bug%20report.sm].png
2016-09-28 09_37_48-SMath Studio Desktop - [Bug%20report.sm].png

In latest RC if you try to edit the formula (f.e. removing the unit from the result), the auto correction applies the parenthesis showing the error

2016-09-28 09_29_41-SMath Studio Desktop - [Bug%20report.sm_].png

Copy the "local" RHS 1/Utest -> remove Rf:1/Utest -> Paste 1/Utst in the placeholder -> cut the new LHS -> Type RF: in the placeholder -> paste the LHS previusly cutted

2016-09-28 09_48_47-SMath Studio Desktop - [Bug%20report.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 users liked this post
sergio 9/28/2016 5:26:00 AM, MSL 9/28/2016 11:25:00 AM, Andrey Ivashov 9/28/2016 10:03:00 AM
#3 Posted: 9/28/2016 5:23:11 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

Hi
I always thank you for your efforts to improve the SMath.
I think that I found a bug of SMath calculation.
Please, check it.



Original expression: the expected value is shown but not assigned to Rf. Rf just gets the first term, as the scope of the assignment operator is limited to the term 1/Utest. The remaining terms just change the displayed value but not the storage for Rf.

Rf:1/Utest-Aeff/{Ao*hsc}-Aeff/Aw*Rw-Aeff/{Ai*htc}=7.53296257076935*10^{-4}@{'hr*'ft^2*'Δ°F}/'BTU

Expression with parens, the displayed value is the same as before but now coincides with the value assigned to Rf

Rf: (1/Utest-Aeff/{Ao*hsc}-Aeff/Aw*Rw-Aeff/{Ai*htc})=7.53296257076931*10^{-4}@{'hr*'ft^2*'Δ°F}/'BTU

Expression as before, but with the outer parens deleted. There is no difference to the original expression in the serial representation from the clipboard, still the whole expression is assigned to Rf.

Rf:1/Utest-Aeff/{Ao*hsc}-Aeff/Aw*Rw-Aeff/{Ai*htc}=7.53296257076931*10^{-4}@{'hr*'ft^2*'Δ°F}/'BTU

The differences between first and third expressions are visible in the file (stack based UPN-like format) and this is obviously also the base of the actual calculation.

Core of the problem:

Non-unique translation between math storage format and both
- visual representation in the math region
- serialized text in the clipboard

What can you do?

- Watch the underline of the input marker when you type equations. It shows the scope of the currently entered operation.
- Watch in the dynamic assistant, what is actually stored in a definition. For numerical results, this is not straightforward to compare with displayed values, as usually some fraction of numbers is stored.
- If you only use undefined variables (switch off the assignments above) then you see the stored expression as a formula.

klammer.PNG

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
3 users liked this post
Davide Carpi 9/28/2016 11:09:00 AM, sergio 9/28/2016 5:31:00 AM, MSL 9/28/2016 11:25:00 AM
#4 Posted: 9/28/2016 11:24:16 AM
MSL

MSL

1 likes in 22 posts.

Group: User

Thank you very much for your quick and kind response!

It is very helpfull for me!!
#5 Posted: 9/28/2016 1:36:05 PM
Andrey Ivashov

Andrey Ivashov

2269 likes in 3734 posts.

Group: Super Administrator

Wrote

What can you do?


Actually this issue was fixed in latest versions of SMath Studio 0.98 and it is just impossible now to enter such equations - program will automatically add parenthesis where it is required.
The only chance to see this issue is to use previous versions of SMath Studio. At least I hope so
1 users liked this post
Davide Carpi 9/28/2016 6:43:00 PM
#6 Posted: 9/28/2016 11:59:59 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

On my side, this bug report ends here,
explained/examplified Smath 5346.
Appropriately cross-checked [sanity].

Jean

Bug report Comment.sm (27 KiB) downloaded 26 time(s).
  • New Posts New Posts
  • No New Posts No New Posts