Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 Location: USA Was thanked: 17 time(s) in 15 post(s)
|
I need the following to output 4 as I'm trying to cancel out the units for a function using the variable. It appears that the function UofM() is the equivalent to UnitsOf() Edited by user 21 January 2021 06:37:33(UTC)
| Reason: Added UoM()
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 03/10/2018(UTC) Posts: 33 Was thanked: 4 time(s) in 4 post(s)
|
You can do this--
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: ElSid 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 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/...xplaining_SIUnitsOf.htmlAs 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ElSid 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 Location: USA Was thanked: 17 time(s) in 15 post(s)
|
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 (21kb) downloaded 26 time(s).Edited by user 21 January 2021 19:51:51(UTC)
| Reason: Added link
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ElSid 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 (21kb) downloaded 6 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 Location: USA Was thanked: 17 time(s) in 15 post(s)
|
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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ElSid 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 Location: USA Was thanked: 17 time(s) in 15 post(s)
|
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 ... Edited by user 21 January 2021 23:35:50(UTC)
| Reason: Not specified
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: ElSid 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
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 05/03/2009(UTC) Posts: 433 Location: USA Was thanked: 17 time(s) in 15 post(s)
|
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).
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.