Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline OchkovVF  
#1 Posted : 30 April 2023 21:55:23(UTC)
OchkovVF


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 06/04/2023(UTC)
Posts: 429
Man
Russian Federation

Was thanked: 42 time(s) in 39 post(s)
minus-K.png

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 30 April 2023 23:18:37(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 983 time(s) in 811 post(s)
Mathsoft had this very sentence ... Watch where you thread.

degC.PNG
Offline Kenny Lemens  
#3 Posted : 01 May 2023 18:04:42(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 150
Man
United States
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. ᵂᴵ
"No matter where you go, there you are." -Buckaroo Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
Offline OchkovVF  
#4 Posted : 01 May 2023 18:41:51(UTC)
OchkovVF


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 06/04/2023(UTC)
Posts: 429
Man
Russian Federation

Was thanked: 42 time(s) in 39 post(s)
Originally Posted by: Kenny Lemens Go to Quoted Post
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
Offline Kenny Lemens  
#5 Posted : 01 May 2023 18:56:33(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 150
Man
United States
Location: Wisconsin

Was thanked: 71 time(s) in 45 post(s)
Greetings,

Originally Posted by: OchkovVF Go to Quoted Post
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.
Expressions with operators of varying priority
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

"No matter where you go, there you are." -Buckaroo Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
Offline mkraska  
#6 Posted : 01 May 2023 22:13:13(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,037
Germany

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).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#7 Posted : 02 May 2023 02:17:27(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 983 time(s) in 811 post(s)
Originally Posted by: mkraska Go to Quoted Post
So you have to use parenthesis in SMath

Golden rule from numerical priority rule(s)
Not unique to this application.
Offline alyles  
#8 Posted : 21 June 2023 22:16:28(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 279
United States

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.

temp.png
temperature.sm (5kb) downloaded 8 time(s).

Edited by user 21 June 2023 22:22:08(UTC)  | Reason: Not specified

Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline alyles  
#9 Posted : 21 June 2023 22:29:58(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 279
United States

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.

temp.png
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline Miki_00  
#10 Posted : 21 February 2024 01:10:50(UTC)
Miki_00

Rank: Newbie

Groups: Registered
Joined: 21/02/2024(UTC)
Posts: 1
Bosnia and Herzegovina

Originally Posted by: Kenny Lemens Go to Quoted Post
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)
Offline overlord  
#11 Posted : 21 February 2024 05:12:54(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,173
Turkey

Was thanked: 534 time(s) in 358 post(s)
Originally Posted by: Miki_00 Go to Quoted Post
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.

2024-02-20_18-08.png

If you really need to calculate without delta temperatures,
You can use a custom equation/function like this.

Regards

2024-02-20_18-15.png

Edited by user 21 February 2024 05:17:21(UTC)  | Reason: Not specified

Users browsing this topic
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.