Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline ElSid  
#1 Posted : 21 January 2021 04:52:57(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
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.
Screenshot 2021-01-20 204846.png
It appears that the function UofM() is the equivalent to UnitsOf()

Edited by user 21 January 2021 06:37:33(UTC)  | Reason: Added UoM()

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Eric Myers  
#2 Posted : 21 January 2021 07:57:54(UTC)
Eric Myers


Rank: Advanced Member

Groups: Registered
Joined: 03/10/2018(UTC)
Posts: 33
United States

Was thanked: 4 time(s) in 4 post(s)
You can do this--
Screenshot_20210120_225519.png
Offline Razonar  
#3 Posted : 21 January 2021 09:35:47(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: ElSid Go to Quoted Post
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/...xplaining_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.
Offline Jean Giraud  
#4 Posted : 21 January 2021 16:04:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ElSid Go to Quoted Post
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

Offline ElSid  
#5 Posted : 21 January 2021 17:15:43(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
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

Offline Jean Giraud  
#6 Posted : 21 January 2021 19:25:38(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ElSid Go to Quoted Post
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).

Offline ElSid  
#7 Posted : 21 January 2021 19:50:07(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
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
Offline Jean Giraud  
#8 Posted : 21 January 2021 23:19:25(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ElSid Go to Quoted Post
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.
Offline ElSid  
#9 Posted : 21 January 2021 23:33:21(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
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 ...
Screenshot 2021-01-21 153138.png

Edited by user 21 January 2021 23:35:50(UTC)  | Reason: Not specified

Offline Jean Giraud  
#10 Posted : 22 January 2021 04:26:31(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: ElSid Go to Quoted Post
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
Offline ElSid  
#11 Posted : 22 January 2021 06:35:12(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
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).
Screenshot 2021-01-21 222624.png
Users browsing this topic
Guest
Similar Topics
UnitsOf() to handle custom units (Feature Requests)
by mkraska 29/10/2023 04:48:22(UTC)
UnitsOf() what is the correct result? (Questions)
by mkraska 18/09/2016 18:33:30(UTC)
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.