Minus kelvin

Minus kelvin - лишние скобки - 消息

#1 已发布: 2023/4/30 15:55:23
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

minus-K.png
#2 已发布: 2023/4/30 17:18:37
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Mathsoft had this very sentence ... Watch where you thread.

degC.PNG
#3 已发布: 2023/5/1 12:04:42
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

85个赞,共181个帖子。

组: User

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 BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
#4 已发布: 2023/5/1 12:41:51
Valery Ochkov

Valery Ochkov

67个赞,共716个帖子。

组: User

Wrote

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
#5 已发布: 2023/5/1 12:56:33
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

85个赞,共181个帖子。

组: User

Greetings,

Wrote

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. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
#6 已发布: 2023/5/1 16:13:13
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

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).
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#7 已发布: 2023/5/1 20:17:27
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

So you have to use parenthesis in SMath


Golden rule from numerical priority rule(s)
Not unique to this application.
#8 已发布: 2023/6/21 16:16:28
Arie

Arie

94个赞,共285个帖子。

组: User

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 (4.71 KiB)已下载 1912 次。
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#9 已发布: 2023/6/21 16:29:58
Arie

Arie

94个赞,共285个帖子。

组: User

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
#10 已发布: 2024/2/20 19:10:50
miki

miki

0个赞,共1个帖子。

组: User

Wrote

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)

#11 已发布: 2024/2/20 23:12:54
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

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
  • 有新帖
  • 无新帖