Units into a loop

Units into a loop - units - Messages

#1 Posted: 12/11/2020 6:15:09 AM
Jadalbert

Jadalbert

0 likes in 17 posts.

Group: 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 Posted: 12/11/2020 8:57:26 AM
sergio

sergio

115 likes in 329 posts.

Group: 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 Posted: 12/11/2020 9:47:13 AM
Jadalbert

Jadalbert

0 likes in 17 posts.

Group: 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 Posted: 12/11/2020 9:51:56 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

it is necessary to sterilize the units


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

SterilizeUnits.sm (16 KiB) downloaded 49 time(s).

#5 Posted: 12/11/2020 11:10:09 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: 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 Posted: 12/11/2020 1:16:56 PM
Jadalbert

Jadalbert

0 likes in 17 posts.

Group: 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 Posted: 12/11/2020 2:40:00 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: 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 Posted: 12/12/2020 10:51:18 AM
overlord

overlord

552 likes in 1332 posts.

Group: 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 Posted: 12/29/2020 10:55:24 AM
Jadalbert

Jadalbert

0 likes in 17 posts.

Group: 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).
  • New Posts New Posts
  • No New Posts No New Posts