UnitsOf()

UnitsOf() - Is this a bug? - Messages

#1 Posted: 1/20/2021 10:52:57 PM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: 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 Posted: 1/21/2021 1:57:54 AM
Anders or Eric

Anders or Eric

4 likes in 40 posts.

Group: User

You can do this--
Screenshot_20210120_225519.png
#3 Posted: 1/21/2021 3:35:47 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1674 posts.

Group: 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 Posted: 1/21/2021 10:04:29 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 1/21/2021 11:15:43 AM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: 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 KiB) downloaded 44 time(s).
#6 Posted: 1/21/2021 1:25:38 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 KiB) downloaded 21 time(s).

#7 Posted: 1/21/2021 1:50:07 PM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: 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 Posted: 1/21/2021 5:19:25 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 1/21/2021 5:33:21 PM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

Group: 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 Posted: 1/21/2021 10:26:31 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: 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 Posted: 1/22/2021 12:35:12 AM
Ruben Sidranski

Ruben Sidranski

17 likes in 463 posts.

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