UnitsOf()

UnitsOf() - Is this a bug? - Сообщения

#1 Опубликовано: 20.01.2021 22:52:57
Ruben Sidranski

Ruben Sidranski

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

Группа: User

I need the following to output 4 as I'm trying to cancel out the units for a function using the variable.
Screenshot 2021-01-20 204846.png
It appears that the function UofM() is the equivalent to UnitsOf()
#2 Опубликовано: 21.01.2021 01:57:54
Anders or Eric

Anders or Eric

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

Группа: User

You can do this--
Screenshot_20210120_225519.png
#3 Опубликовано: 21.01.2021 03:35:47
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

I need the following to output 4 as I'm trying to cancel out the units for a function using the variable. ...



Hi. I think that SMath's UnitsOf() it's well defined, not like the equivalent in Mathcad, which it's deprecated

Clipboard1.jpg

and substitute by SIUnitsOf(), even the Mathcad error was related with the default unit system setup (SI=MKS, FPS or CGS): https://support.ptc.com/help/mathcad/en/index.html#page/PTC_Mathcad_Help/example_explaining_SIUnitsOf.html

As I underdestand, you want to recover the unit of a variable for plot in that unit as axis scale. But I guess that for that you must to write a 4 parameter version of your function: Plot(x,y,f(2),UnitForX,UnitForY)

Best regards.
Alvaro.
#4 Опубликовано: 21.01.2021 10:04:29
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I need the following to output 4
as I'm trying to cancel out the units for a function using the variable.


Make the unit silent, just decoration.

UnitOf.PNG

#5 Опубликовано: 21.01.2021 11:15:43
Ruben Sidranski

Ruben Sidranski

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

Группа: User

Eric,
This is basic. I need to eliminate units based on itself. This is so I can use it on multiple equations with varying units within my functions

Jean,
I need the units for the formulas and as a double check. At the moment, I just created/defined a second variable (t1:=t/in in this case) to make it work.

Razonar,
Using UnitOf() as a variable, does not work. It divides out and changes the value as shown in the first post. I'm trying to eliminate having to define t1 (in this example) Heat Capacity Function1.sm (20 КиБ) скачан 44 раз(а).
#6 Опубликовано: 21.01.2021 13:25:38
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Jean,
I need the units for the formulas and as a double check. At the moment,
I just created/defined a second variable (t1:=t/in in this case) to make it work.


The unit system is an SI sub-processor.
Once it has converted in 'm' you can get a vector absent of viewing units.
At this point, if you want your original vector in you must
reverse Engineer the SI sub-processor.

Unit Waterloo.sm (20 КиБ) скачан 21 раз(а).

#7 Опубликовано: 21.01.2021 13:50:07
Ruben Sidranski

Ruben Sidranski

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

Группа: User

Jean,
Your example is more detailed than mine, showing the same thing. In your case, you multiplied t by 39.37 for the conversion to inches. My intent was to "normalize" and just use the root variable to eliminate the units.
This appears to not be possible and I will just continue to define var1:=#var/units. The function is working on multiple equations, this would have been the "cherry on top".

Thanks to all for looking into this
#8 Опубликовано: 21.01.2021 17:19:25
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Jean,
Your example is more detailed than mine, showing the same thing. In your case, you multiplied t by 39.37 for the conversion to inches. My intent was to "normalize" and just use the root variable to eliminate the units.
This appears to not be possible and I will just continue to define var1:=#var/units. The function is working on multiple equations, this would have been the "cherry on top".


I you have to invent a particular reverse-Engineer for an odd application,
may as well not use units, that will solve all cases.
Or, more wisely convert before hand to SI, unfortunately here,
°F, °K don't exist ... what !
No, they don't exist ... latest ITS-90 have normalized only few fixed points.
Not in °F, °K ... in °C.
#9 Опубликовано: 21.01.2021 17:33:21
Ruben Sidranski

Ruben Sidranski

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

Группа: User

Jean,
Let's take a step back and look at the Heat Capacity sheet.
This is the one you could not open, so I'm posting the revised function below. In this example (you have your sheet to look at), I just want to eliminate the variable #X1 as all it is is the variable #X unitless. As mentioned above, I just "defined" #X1 as #X/units and we are fine. I am updating calculations to use this "generic" function for consistency. I was just hoping to eliminate having to define #X1 as a separate variable ...
Screenshot 2021-01-21 153138.png
#10 Опубликовано: 21.01.2021 22:26:31
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Jean,
Let's take a step back and look at the Heat Capacity sheet.
This is the one you could not open, so I'm posting the revised function below. In this example (you have your sheet to look at), I just want to eliminate the variable #X1 as all it is is the variable #X unitless. As mentioned above, I just "defined" #X1 as #X/units and we are fine. I am updating calculations to use this "generic" function for consistency. I was just hoping to eliminate having to define #X1 as a separate variable ...


My screen is so small for so much !
You can design your own compactum.
Cheers ... Jean

ElsidCompactum.PNG
#11 Опубликовано: 22.01.2021 00:35:12
Ruben Sidranski

Ruben Sidranski

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

Группа: User

The intent of this thread was to find a built in function to to eliminate the units (my misunderstanding of UnitsOF()). In your screenshot, you have a multiplier ... in this case, 39.37. This is what I'm trying to avoid for other equations that might be in BTU. or FT, or "widgets". Lets move on to bigger items. The simple fix is to define #X/units (t/in in this example).
Screenshot 2021-01-21 222624.png
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений