1 Pages (6 items)
Numerics or unit operation bug? - Wrong calculation with units - Messages
#1 Posted: 9/27/2016 7:58:16 PM
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!

Bug report.sm (9 KiB) downloaded 36 time(s).
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!
Bug report.sm (9 KiB) downloaded 36 time(s).
#2 Posted: 9/28/2016 4:34:35 AM
Seems you defined Rf as 1/Utest (definition in a placeholder)
![2016-09-28 09_35_56-SMath Studio Desktop - [Bug%20report.sm].png](/en-US/file/rxvzMn/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](/en-US/file/Vhkaux/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](/en-US/file/6DCZnE/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](/en-US/file/3KRED2/2016-09-28-09_48_47-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
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
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
#3 Posted: 9/28/2016 5:23:11 AM
WroteHi
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.
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
3 users liked this post
#4 Posted: 9/28/2016 11:24:16 AM
Thank you very much for your quick and kind response!
It is very helpfull for me!!
It is very helpfull for me!!
#5 Posted: 9/28/2016 1:36:05 PM
WroteWhat 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
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).
explained/examplified Smath 5346.
Appropriately cross-checked [sanity].
Jean
Bug report Comment.sm (27 KiB) downloaded 26 time(s).
1 Pages (6 items)
-
New Posts
-
No New Posts