Units into a loop

Units into a loop - units - 消息

#1 已发布: 2020/12/11 06:15:09
Jadalbert

Jadalbert

0个赞,共17个帖子。

组: User

Hi everyone,
I need help with a problem:
There is a loop for (_;_;_) and a lot of lines below it. One variable, with formula, automatically, in the loop, has unit [s2/kg], but should be [mm/N]. I can see the unit from loop outside it. I cannot change the unit inside the loop and the "result" of this variable is "The result is higher then maximum available positive number". Outside the loop, when I change the unit to [mm/N] the result is correct.
How can I change the unit inside of loop?
#2 已发布: 2020/12/11 08:57:26
sergio

sergio

127个赞,共342个帖子。

组: User

It is not very clear to me how much you expose. However, in general, Smath internally stores the values ​​of the variables in the base unit of measure and not in the one you enter. If you use dimensional formulas in the cycle, the problem exists and it is necessary to sterilize the units of measurement before entering the cycle and restore them when it exits.
sergio
#3 已发布: 2020/12/11 09:47:13
Jadalbert

Jadalbert

0个赞,共17个帖子。

组: User

Thank You for response.
(I hope) I resolved the problem changing Oprimization of the for loop from symbolic to nomeric. But the behavior of the program is quite strange for me.
One part of my formula looks like this (other parts are similar):
Y := ZF*hG*(hH-hP+hQ) / EF using the unit we have: mm-3 * mm *(mm-mm+mm) / MPa and it should give as the result unit mm/N. But smath gives s^2 / kg !!! Very strange.
I tried to set the unit of Y value before loop - no effect. The result of Y is using inside the loop to calculate other formulas and seting this unit after the loop is useless.
#4 已发布: 2020/12/11 09:51:56
Jean Giraud

Jean Giraud

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

组: User

Wrote

it is necessary to sterilize the units


Engineering works have their own units from Standards, easy to manage.

SterilizeUnits.sm (16.48 KiB)已下载 1222 次。

#5 已发布: 2020/12/11 11:10:09
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

..., in the loop, has unit [s2/kg], but should be [mm/N]. ..



Hi. But that's correct: [mm/N] = 0.001 [s2/kg]. They have the same dimensions.

Clipboard01.gif

Wrote

...
One part of my formula looks like this (other parts are similar):
Y := ZF*hG*(hH-hP+hQ) / EF using the unit we have: mm-3 * mm *(mm-mm+mm) / MPa and it should give as the result unit mm/N. ...



This seems some kind of Bernoulli energy balance, but can't identify which one. Notice that you can't get from [mm^3/MPa] values in [mm/N]

Clipboard02.gif

Wrote

...
But smath gives s^2 / kg !!! Very strange. ...



Again, if you want something in [s2/kg], [mm/N] have the same dimensions.

Wrote

...
The result of Y is using inside the loop to calculate other formulas and setting this unit after the loop is useless.



That's the power of using units: that's a symptom that Y could be bad defined inside of the loop. Eventually it's only a dimensional mistake which have not effect in the final numeric unitless value, but usually it isn't the case. Maybe if you post your file someone can give better help.

Best regards.
Alvaro.
#6 已发布: 2020/12/11 13:16:56
Jadalbert

Jadalbert

0个赞,共17个帖子。

组: User

Thanks for reply.
My formula is from the standard for flange connection calculation EN 1591-1.
Y [mm/N] value(s) is axial compliance of the bolted joint related to F force(s).
mm/N and s^2/kg it is indeed the same unit.
#7 已发布: 2020/12/11 14:40:00
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

Thanks for reply.My formula is from the standard for flange connection calculation EN 1591-1.Y [mm/N] value(s) is axial compliance of the bolted joint related to F force(s).mm/N and s^2/kg it is indeed the same unit.



So, z isn't an elevation and h's aren't heads!.

In Y := ZF*hG*(hH-hP+hQ) / EF

ZF rotational flexibility in mm^-3 (I misread that before and take only mm), EF modulus of elasticity in MPa and h's geometrical parameters for the gasket in mm. Then [mm^-3]*mm*mm/MPa gives mm/N, and all looks correct. Notice that in this case the "M" of MPa kills two "m" from mm. Usually formulas in the normative have the coefficients for transforming units inside, which make confusing write them in SMath, where you need to take out those coeffs. But here the answer in the "calculator mode" don't need those coeffs because the cancelation.

Given that you're translating a copyright standard I understand that you can't share the worksheet. But maybe can share a screenshot with one of the Y' loops with units showing the error message.

Best regards.
Alvaro.
#8 已发布: 2020/12/12 10:51:18
overlord

overlord

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

组: Moderator

Wrote

My formula is from the standard for flange connection calculation EN 1591-1.


Maybe be you know already but you can check EN 13445-3 for flange calculations too.
It uses Taylor Forge method for calculations and results have bigger thickness values.

Regards
#9 已发布: 2020/12/29 10:55:24
Jadalbert

Jadalbert

0个赞,共17个帖子。

组: User

Wrote

Wrote

My formula is from the standard for flange connection calculation EN 1591-1.


Maybe be you know already but you can check EN 13445-3 for flange calculations too.
It uses Taylor Forge method for calculations and results have bigger thickness values.

Regards



Yes, I know that. But I have to work with 1591-1. I try create a tool for check results of our software (written with Delphi).
  • 有新帖
  • 无新帖