Units into a loop

Units into a loop - units - Сообщения

#1 Опубликовано: 11.12.2020 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 Опубликовано: 11.12.2020 08:57:26
sergio

sergio

115 сообщений из 329 понравились пользователям.

Группа: 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 Опубликовано: 11.12.2020 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 Опубликовано: 11.12.2020 09:51:56
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

it is necessary to sterilize the units


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

SterilizeUnits.sm (16 КиБ) скачан 51 раз(а).

#5 Опубликовано: 11.12.2020 11:10:09
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: 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 Опубликовано: 11.12.2020 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 Опубликовано: 11.12.2020 14:40:00
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: 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 Опубликовано: 12.12.2020 10:51:18
overlord

overlord

552 сообщений из 1332 понравились пользователям.

Группа: 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 Опубликовано: 29.12.2020 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).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений