Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 429 Was thanked: 42 time(s) in 39 post(s)
|
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
Mathsoft had this very sentence ... Watch where you thread.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 11/01/2018(UTC) Posts: 150 Location: Wisconsin Was thanked: 71 time(s) in 45 post(s)
|
Greetings,
It is important to note that temperature is a variable unit in SMath and not a function as it is in Mathcad.
Regardless, the first line is converting 10°C --> 283.15K; and then applying the unary operator of minus (-) to the value; thus: -283.15K; Make sure you apply the unit °C to -10 and not just 10; use the space bar to group your operations correctly.
When in doubt: use parenthesis for grouping your operations.
May this be of Good Help, - SK Kenny Lemens, P.E. ᵂᴵ |
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 06/04/2023(UTC) Posts: 429 Was thanked: 42 time(s) in 39 post(s)
|
Originally Posted by: Kenny Lemens Greetings,
It is important to note that temperature is a variable unit in SMath and not a function as it is in Mathcad.
Regardless, the first line is converting 10°C --> 283.15K; and then applying the unary operator of minus (-) to the value; thus: -283.15K; Make sure you apply the unit °C to -10 and not just 10; use the space bar to group your operations correctly.
When in doubt: use parenthesis for grouping your operations.
May this be of Good Help, - SK Kenny Lemens, P.E. ᵂᴵ 2+2*2=8 2+(2*2)=6
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 11/01/2018(UTC) Posts: 150 Location: Wisconsin Was thanked: 71 time(s) in 45 post(s)
|
Greetings,
Originally Posted by: OchkovVF 2+2*2=8 I tried to duplicate this result, but was unsuccessful. However, the following will achieve '8':(2+2)*2=8
or
2*(+2)*2=8 On the larger issue, I would refer you to the following handbook; it can be downloaded via your Extension Manager (i.e., [Tools] -> [Plugins...] -> [Interactive books]): https://en.smath.com/view/interactivebook/There is a section that reviews the Priority of operators; you will see that units are level 1, whereas unary is level 2: thus the disconnect for negative numbers. Those respective sheets are as follows:
May this be of Good Help, - Kenny Lemens, P.E. ᵂᴵEdited by user 03 May 2023 18:16:02(UTC)
| Reason: Original Post was incomplete; Added greeting, as well as links/resources (changes shown as brown tex |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,037 Was thanked: 1169 time(s) in 748 post(s)
|
This issue is constantly confusing new users. The evil is in the design decision that the unary minus has the same priority as the binary plus and minus, both are less than multiply and divide. This is counter-intuitive. So you have to use parentesis in SMath where you would not expect to need them with pencil and paper. Changing these priority rules might fix the problem (and perhaps cause other ones). |
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 983 time(s) in 811 post(s)
|
Originally Posted by: mkraska So you have to use parenthesis in SMath Golden rule from numerical priority rule(s) Not unique to this application.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/03/2016(UTC) Posts: 279 Was thanked: 92 time(s) in 58 post(s)
|
I've gotten in the habit of using this function. This is probably dumb to do, but it forces me to use parenthesis for all temps. temperature.sm (5kb) downloaded 8 time(s).Edited by user 21 June 2023 22:22:08(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/03/2016(UTC) Posts: 279 Was thanked: 92 time(s) in 58 post(s)
|
Also this function can be useful when variables are defined in Celsius but need to be used relatively. |
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 21/02/2024(UTC) Posts: 1
|
Originally Posted by: Kenny Lemens Greetings,
It is important to note that temperature is a variable unit in SMath and not a function as it is in Mathcad.
Regardless, the first line is converting 10°C --> 283.15K; and then applying the unary operator of minus (-) to the value; thus: -283.15K; Make sure you apply the unit °C to -10 and not just 10; use the space bar to group your operations correctly.
When in doubt: use parenthesis for grouping your operations.
Ok
I put my negativ temp like t2=(-43), ant t1=20, all in degC
Now I got this in Smath editor
t1-t2 = 63K it is OK
but t1-t2 = -210,15degC
it works like this: t1-t2 = ((20+273) - (-43 + 273) - 273) = -210,15degC THIS IS WRONG. there should not be extra (-273) on the end when you enter degC in the placeholder of expresion for convert from K to degC
What is right
t1-t2 = 20-(-43) = 63degC
t1-t2 = (20+273) - (-43+273) = 63K
Difference deltaT/deltat do not depend of scale (for degC and K for sure)
so definitely there is a bug in conversion (adlist when conversion is done by manipulating placeholder behind result)
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,173 Was thanked: 534 time(s) in 358 post(s)
|
Originally Posted by: Miki_00 I put my negativ temp like t2=(-43), ant t1=20, all in degC
Now I got this in Smath editor
t1-t2 = 63K it is OK
but t1-t2 = -210,15degC
it works like this: t1-t2 = ((20+273) - (-43 + 273) - 273) = -210,15degC THIS IS WRONG. there should not be extra (-273) on the end when you enter degC in the placeholder of expresion for convert from K to degC
What is right
t1-t2 = 20-(-43) = 63degC
t1-t2 = (20+273) - (-43+273) = 63K
Difference deltaT/deltat do not depend of scale (for degC and K for sure)
so definitely there is a bug in conversion (adlist when conversion is done by manipulating placeholder behind result)
This is not a bug, this is how SMath works. You have to use delta temperatures for that kind of calculations. Unfortunately there is no easier way. If you really need to calculate without delta temperatures, You can use a custom equation/function like this. Regards Edited by user 21 February 2024 05:17:21(UTC)
| Reason: Not specified
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.