×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Engine-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Engine-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Mathcad needs a "remove units" function.
3

Mathcad needs a "remove units" function.

Mathcad needs a "remove units" function.

(OP)
I like Mathcad's ability to convert between different units but some times it is nice to remove the units. I know that dividing by the units will work but that is kind of a kludge.
A simple ru(var) function would be nice. Then one can do this
var_unitless = ru(var_with_units)
I have spent too much time fussing with units.
Variables with exponents and returning multiple variables from a function is a pain in the back side.
The c programmer in me wants a type() function too
I am still using Mathcad 13 a lot because it is the devil I know. I haven't upgraded because the upgrades haven't really improved the product from what I have seen so far.

Peter Nachtwey
Delta Computer Systems
http://www.deltamotion.com
http://forum.deltamotion.com/
IFPE Hall of Fame Member

RE: Mathcad needs a "remove units" function.

2
I respectfully disagree.

If you need to strip units (e.g. because you are using an empirical Code expression which is dimensionally inconsistent, and assumes a particular set of units is being used for all terms in the expression), then you need to be VERY careful that you are using the correct units when you "strip" the expression. Dividing out the various terms by the units used is an error-free means of creating a dimensionless expression when required; to not do so risks gross error if you happen to be using incorrect units for any of your variables.

E.g. the Australian Concrete code defines the characteristic flexural tensile strength of concrete in terms of the compressive strength as being:

f'ctf = 0.6 (f'c)^0.5

This expression only works when the tensile strength and compressive strength are in units of MPa, it won't work when you are using Pa, psi, ksf, etc.

If you try to code the expression exactly as written, Mathcad will return incorrect units of (stress)^0.5 for the flexural tensile strength - which is a surefire sign that you have either made an error in entering your expression, or that the expression is dimensionally inconsistent. Either way - this is one of the best error-trapping features of Mathcad in my opinion.

You need to write the expression dividing f'c (and / or any other terms) by their units to render them dimensionless, and then multiply the solution back by the desired units to get the expression to work. An added bonus is that you can then view your results in whatever units system you like; e.g. you may be using a metric SI source document, but you want to present the results in US customary units for your audience.

Conversely - if you do create dimensionless expressions, there is a chance that someone (maybe even you!) will use your worksheet with incorrect units for the various terms, and get catastrophically incorrect results. This is the main reason that I use Mathcad rather than Excel as my "go-to" engineering calculation tool.

http://julianh72.blogspot.com

RE: Mathcad needs a "remove units" function.

I think that dividing out units for such equations is always the best approach, since that means you can use quantities with different units and the units division will correctly convert them and make them usable in the equation.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Engine-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://engine-tips.com/forumlist.cfm

RE: Mathcad needs a "remove units" function.

PNachtwey,
I think I know what you mean. There are some archaic engineering expressions published in the 1800's that americans still use for bridges and planes and rockets which were originally written in unitless form and a pain to solve in Mathcad without removing the units, then putting them back on. It wouldn't be so bad but the empirical equations tend to be the things you want to copy-paste into a report so they have to look like the original thing...

Attempting to develop a universal units stripping function would be dependent on the unit system your empirical equation uses - which is NOT always internally consistent, either!
For example, there is a standard gust velocity equation specified by the FAA (use it as they specify or never fly your plane) that is based on both feet/second and knots at the same time, slugs and pounds at the same time. You could never come up with an automatic function that could deal with that. You have to divide out each variable's units per the intent of the equation.

www.sparweb.ca

RE: Mathcad needs a "remove units" function.

(OP)

Quote:


Conversely - if you do create dimensionless expressions, there is a chance that someone (maybe even you!) will use your worksheet with incorrect units for the various terms, and get catastrophically incorrect results. This is the main reason that I use Mathcad rather than Excel as my "go-to" engineering calculation tool.
But this danger exists as soon as one divides by the units.
It also happens when the units are such a pain that they aren't used at all.

Mathcad does not have structures. I often return arrays of target positions, actual positions and control output.
I cannot return an array of arrays when they have different types.
I could do this with a structure.
Now I divide by the units to return an array of unitless arrays.

I have also hand problems with the gas laws where PV^1.4=nRT
I use this formula for sizing and simulating hydraulic accumulators in a system.

The dividing by units looks so screwy when I make videos.
It is just one more thing I must waste time explaining.



Peter Nachtwey
Delta Computer Systems
http://www.deltamotion.com
http://forum.deltamotion.com/
IFPE Hall of Fame Member

RE: Mathcad needs a "remove units" function.

Quote:

The dividing by units looks so screwy when I make videos.
It is just one more thing I must waste time explaining.

But, for a typical empirical formula, you have to explain what the units are anyway, and the person has to have a crib sheet or a giant footnote that captures that information, and can still get it wrong. In this case, it's captured directly in the equation itself, so I think you should spin it that way, "It's a self-documenting empirical formula that eliminates the crib sheet of the correct units needed to make the equation work, and allows you to detect entry errors with the units"

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Engine-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://engine-tips.com/forumlist.cfm

RE: Mathcad needs a "remove units" function.

(OP)
[quote=IRstuff]
But, for a typical empirical formula, you have to explain what the units are anyway,
[/quote]
I do! I just don't use the units feature or Mathcad. You, IRstuff, have seen a few of my Mathcad worksheets on control. I explain the units in text but I don't apply units to the variables.

Peter Nachtwey
Delta Computer Systems
http://www.deltamotion.com
http://forum.deltamotion.com/
IFPE Hall of Fame Member

RE: Mathcad needs a "remove units" function.

Yes, but what typically happens, as shown in a couple of posts in ET over the years, is that the definition of the units tends to wander away from the equation, or vice-versa, resulting in a bunch of variables, sans units, and the user or inheritor is scratching their head trying to get the equation to spit out something plausible.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Engine-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://engine-tips.com/forumlist.cfm

RE: Mathcad needs a "remove units" function.

I side with IRstuff as a matter of personal preference. When I see M/kg, I read it as "mass in kilograms" and it seems a more precise way to deal with it than adding a footnote somewhere to define the units of every variable.

On the other hand, all the extra units start to clutter things up if you are manipulating a lot of variables in complicated expressions, so I can see the other side too.

On the third hand (wait I ran out of hands!), maybe those complicated expressions are exactly the times that you most need to carry your units (to avoid errors).

Either way, it is what it is (mathcad isn't going to change).



=====================================
(2B)+(2B)' ?

RE: Mathcad needs a "remove units" function.

A couple of quick questions for the OP:

What units should Mathcad assume when you apply the unitless function to get a scalar result? E.g. if the expression has dimensions of "Power", should it present the numerical result as watts, milliwatts, kilowatts, megawatts, horsepower (Imperial hp or metric hp?), BTU/hr, ...

All are commonly used units of power - what should Mathcad assume? How would it know?

And what should it do for empirical dimensionally-inconsistent expressions, like my example of the Code expression for tensile strength of concrete? Such expressions only work if the variables are entered in the correct units - how would Mathcad know whether you have used the right units?

http://julianh72.blogspot.com

RE: Mathcad needs a "remove units" function.

(OP)

Quote:


What units should Mathcad assume when you apply the unitless function to get a scalar result? E.g. if the expression has dimensions of "Power", should it present the numerical result as watts, milliwatts, kilowatts, megawatts, horsepower (Imperial hp or metric hp?), BTU/hr, ...
None. That is the whole point.

Peter Nachtwey
Delta Computer Systems
http://www.deltamotion.com
http://forum.deltamotion.com/
IFPE Hall of Fame Member

RE: Mathcad needs a "remove units" function.

Quote (None. That is the whole point.)


I think you missed my point. Let's say you calculate the power demand of an electrical device to be 250 milliwatts. What scalar value should the "strip units" function return? 250? 0.25?

The calculation is part of a control system for an electric vehicle drive system, with a 100 kW motor. What scalar value does the "strip units" function return for the motor power? 100000? 100? 134 (horsepower)?

http://julianh72.blogspot.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Engine-Tips Forums free from inappropriate posts.
The Engine-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Engine-Tips forums is a member-only feature.

Click Here to join Engine-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Engine-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Engine-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close