March 2008
Identifying the Use and Source of Numbers
by Leslie Bondaryk


This article discusses the importance of identifying the use and source of numbers in engineering calculation and how to support this in Mathcad.

3 is a magic number. So is two. So is any other unlabeled value in an engineering calculation.

If you are looking at an equation that reads:



what does that calculate (aside from 12, of course)? How about



C could be anything, although likely it has a specific significance in your domain of engineering. OK, now suppose the equations said




You might guess that C is circumference, and r is a radius. But what about the 3? If the equation read



then you'd be almost certain that the magic number is pi, and you'd want the equation to read



as much for documentary purposes as for accuracy in calculation, 5 places after the decimal might be enough for average applications, but the difference between writing Π  and writing 3.14159 is clarity and traceability. The labeled equation is specific and can be referenced in any number of geometry texts, while the one with a 3, or 3.14, or 3.14159... is not.

But that one's pretty easy, since it's so universal. What about this?




This is actually a torque calculation, and there are a host of magic numbers in here, the most difficult of which is 2.54 multiplying L1. The number 2.54, in this context, is the conversion factor from inches to centimeters. You may have thought that's what it might mean in this equation. But you'll never know the interpretation of 2.54 with certainty without some kind of label or reference. If someone reviews or reuses this equation and enters the length, L1, in units of centimeters (cm) instead of inches (in), then the factor is not required, and the answer will be wrong. If the length is entered in feet (ft), the result is wrong in a different way.


So what does this mean, and why should you care?


Use Units


My first message is to let Mathcad constants and units do their documentary work for you (see the article on units in the February 2008 issue). If units are associated with each number, then the right conversion factors are always used, and don't have to appear explicitly - and mysteriously - in the expression.


Name Your Variables


Second, name your variables whenever you can. The numbers 3.98 and 12.6 represent weight and a time, respectively. If the units are associated with these numbers, then we at least know their meaning, although we still don't know where they come from. It's always best to give descriptive names to variable to identify them. Suppose the time quantity in this expression is a measured one, and the mass quantity is derived from the density of aluminum. That information ought to be recorded in appropriate variable names. Let's call the density of aluminum rhoAL, and then calculate the mass of this particular piece. Here's the new calculation








You can then either look at the value of T1 in terms of the substituted values, using an explicit calculation:



or get the results scaled to SI or US units.




Annotate with Source Information


This in-worksheet style works well, particularly if the design is a one-off calculation. However, often a  number of people in the company are using the same source for aluminum parts, and they want to know the "official" density reported by the manufacturer. So ideally, this value is either referenced in a separate worksheet, or at least annotated with its source.


Note that the density of aluminum above has green parentheses around it. If you select the entire expression, then right-click on it in the attached Mathcad worksheet, you can see that I've annotated it with the website that is the source of the value.



Insert Referenced Files


Ultimately, any important numbers that are used, reused, or updated during the course of a project should be stored in a referenced file (Insert > Reference). File references in Mathcad use the latest value for any variable or function defined in the file.

You'll want to use references judiciously; if a value in a worksheet you reference changes, perhaps without you knowing it, your dependent calculations update right along with it. This kind of undocumented update is not always desirable for record-keeping. If the goal is to keep everyone using the latest numbers, however, then the reference can be very helpful, and keep you from having to update the numbers across many individual files.


Save Standard Values in Templates


Some companies choose to keep all the "important" values and supplemental defined units for a project in a single reference file on a network drive. In order to ensure use of these centralized values, companies typically update and distribute the Mathcad "New File" template to include the reference to that file to their employees. Other project templates can be made to include particular subsets of relevant named values. Once the templates are available in Mathcad, every new worksheet created by engineers working on the project has that reference at the top of the document. This removes many "magic numbers" that might creep into engineering calculations, and it helps with change management by centralizing the storage of reference factors, constants, or other values important for the project.


Whether you choose to use references or just explicitly declare values in your worksheet, the practice of consistently applying names, annotations, and using named constants will keep engineering calculations readable, verifiable, reusable, and consistent. This saves the magic for the clever engineering design, where it belongs!


3 is a magic number.

Don't use it lightly in your worksheets. (With apologies to Bob Dorough and School House Rock.)





Right-click, choose Save Target As, and change the extension to XMCD and File Type to All to download Mathcad file
. (Mathcad 14)


Was this article helpful? Let us know.









[PRINTER FRIENDLY VERSION]
HOME

What’s New in Pro/ENGINEER Wildfire 4.0 for NC and Tooling?
PTC Updates
Tips of the Month
Mathcad Methods
Knowledge Base Exclusive
Webcasts & Events
Lost in Translation? Arbortext IsoDraw Can Help
Personal Handbooks and Corporate Design Manuals

Contact PTC | Privacy Policy | PTC Express Archive | Subscribe | Edit Profile

  PTC, 140 Kendrick Street, Needham, MA 02494 USA