Numerics or unit operation bug?

Numerics or unit operation bug? - Wrong calculation with units - Сообщения

#1 Опубликовано: 27.09.2016 19:58:16
MSL

MSL

1 сообщений из 22 понравились пользователям.

Группа: 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 КиБ) скачан 36 раз(а).
#2 Опубликовано: 28.09.2016 04:34:35
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: 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 пользователям понравился этот пост
sergio 28.09.2016 05:26:00, MSL 28.09.2016 11:25:00, Andrey Ivashov 28.09.2016 10:03:00
#3 Опубликовано: 28.09.2016 05:23:11
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Davide Carpi 28.09.2016 11:09:00, sergio 28.09.2016 05:31:00, MSL 28.09.2016 11:25:00
#4 Опубликовано: 28.09.2016 11:24:16
MSL

MSL

1 сообщений из 22 понравились пользователям.

Группа: User

Thank you very much for your quick and kind response!

It is very helpfull for me!!
#5 Опубликовано: 28.09.2016 13:36:05
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3732 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Davide Carpi 28.09.2016 18:43:00
#6 Опубликовано: 28.09.2016 23:59:59
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

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

Jean

Bug report Comment.sm (27 КиБ) скачан 25 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений