This content has been marked as final.
Show 378 replies
0. Working with numbers or variables with Units
FredKohlhepp Oct 9, 2006 12:00 AM (in response to depineresdisabled)One of the things I have done is build a new template file. This file has a colapsed area at the very top with the constants and units I usually use (rpm = Hza/60, psf = psi/144) that aren't native to mathcad. This area does not appear in the worksheet, yet the definitions are in place without having to input them each time and worry about getting it right.
In your case kip = 1000 lbf, etc.
Fred Kohlhepp
fkohlhepp@sikorsky.com
In your case kip = 1000 lbf, etc.
Fred Kohlhepp
fkohlhepp@sikorsky.com

1. Working with numbers or variables with Units
TheodoreM.Bones Oct 9, 2006 12:00 AM (in response to depineresdisabled)A problem in thermodynamics can give a solved result that can be either British Thermal Units (BTU) or Centigrade Heat Units (CHU) equally. In other cases it is best to plan the solution in one system or the other and define the answer at the end. No use in carrying units in equations. Irrational fractions cannot be made whole if units are carried in the process. 
2. Working with numbers or variables with Units
TomGutman Oct 9, 2006 12:00 AM (in response to depineresdisabled)You just define all the units you will need, excepting those you know are already defined by Mathcad, at the top of the sheet. I recommend a collapsed area that contains all the units you need. You can then copy that into sheets that need it, or if most sheets need it add it to the template.
Once you consistently apply units to your input values (including constants in equations) you don't have to (and, largely, cannot) keep track of units. Mathcad simply stores a representation of the quantity which you can then display in any units you want (using the units placeholder, Mathcad does have default units for all types of quantities). Thus in Mathcad there is absolutely no difference between the value 1ft and the value 12in. Both are exactly the same length. The internal representation will vary depending on the current units system and the Mathcad version, but that should be irrelevant to their use.
� � � � Tom Gutman 
3. Working with numbers or variables with Units
FredKohlhepp Oct 9, 2006 12:00 AM (in response to depineresdisabled)Please note (after a second look) that many of the units you specify (ft, in, yard (yd) are already in Mathcad and do not require definition. Mathcad will automatically convert to make the numbers correct.
Fred Kohlhepp
fkohlhepp@sikorsky.com
units3.mcd 7.8 K


5. Working with numbers or variables with Units
ptc1368288 Oct 10, 2006 12:00 AM (in response to depineresdisabled)It is wise never use units ,
only dimension the intrants as per the design of the formula(s).
Think in terms of "what is what" and "what is not what" ... solvers...etc.
Only append the "UnitResult" .
Formulas evolve in the course, they may reach an unsuspected state of simplicity.
jmG
0_Models_csgn.mcd 9.4 K


6. Working with numbers or variables with Units
superres Oct 10, 2006 12:00 AM (in response to FredKohlhepp)Life would be truly miserable if Mathcad couldn't do its thing with units. We get mixed units all the time; trying to reconcile and convert them to do a trivial calculation would triple the work load.
TTFN,
Eden 
7. Working with numbers or variables with Units
PhilipOakley Oct 10, 2006 12:00 AM (in response to TomGutman)If you are using text book formulae which expect values in certain units then getting the units correct takes care. The formulae almost always have 'special constants' in them.
One method is to divide each variable in the equation by the units the text book stated, and then multiply the overall equation by the units of the final answer. This can look quite intuitive if the (var/units) are nicely bracketted.
Another approach is to find the 'special constants' (usually real number in the equation) and using known values, or the first method, find the units of those special constants and just apply the units there.
Watch for Log, Exp, Sin, Cos etc. in the equations which require unitless or radian measures and may hide a 'special constant'.
Philip 
8. Working with numbers or variables with Units
PhilipOakley Oct 10, 2006 12:00 AM (in response to FredKohlhepp)
One of my hopes for future releases is a way of handling units with the solvers  even some sort of 'wrapper' that can remove & replace the units as it passes to/from the solver.
One of the [much] less talked about engineering methods is that of 'Per Unit', where all equations are converted to a relative scale so Full_Power = 1, etc. where all the constants of proportionality in equations become 1. F=m.a, V=I.R, etc.
It is a method used in the electrical power industry because all the transformers make the [volts & amps] numbers change but the power delivered is fixed, as is [nearly] the frequency, while results in SI have widely varying exponents, so perunit measures work well, and they match the numerical stability criteria quite well!
Philip 
9. Working with numbers or variables with Units
ptc1176891 Oct 10, 2006 12:00 AM (in response to ptc1368288) 
10. Working with numbers or variables with Units
FredKohlhepp Oct 10, 2006 12:00 AM (in response to ptc1176891)Jean (jmG) is as staunch an opponent of units as I am of using them. I agree that they are one of the best features of Mathcad and have caught a lot of my mistakes.
That said, improperly defined units will cause more problems than they find; and there are a number of Mathcad constructs (the differential equation solvers for example) where they can be particularly troublesome.
Both sides have strong arguments.
Fred Kohlhepp
fkohlhepp@sikorsky.com 
11. Working with numbers or variables with Units
superres Oct 11, 2006 12:00 AM (in response to ptc1368288)On 10/11/2006 2:36:50 AM, jmG wrote:
>To convince yourself that
>units are useless and that you
>should use work done by others
>before you , try that one:
>
>P*V := Z*n*R*T
>
>with 14 pressure bases, 10
>volume bases, 3 mole bases, 2
>temperature bases
>
>jmG
That's where Mathcad can cut to the chase. You don't need Uconeer or another units converter with Mathcad. The ideal gas equation will work with any combination of units from the different choices transparently.
You seem to want to go out of your way to complicate your life with a separate units conversion when Mathcad does the unit conversion transparently and without having to transfer numbers from one program to another.
TTFN,
Eden 
12. Working with numbers or variables with Units
PhilipOakley Oct 11, 2006 12:00 AM (in response to Ninetrees)One of the subtle distinction is 'Units' or 'Unity'. The former allows multiple 'Units of measure' (and hides unity) while the latter allows only the one god [or is that the 'god of 'one']. So many things in maths work out better when values are near zero(0), or one(1)!
Working in general engineering I tend to value the former to (try to) avoid Mars Lander style problems [often an assumetextbooksolve process], while JmG is a great advocate of the latter [a thinknormalisesolve process]
I'm currently working on a problem where the team is using principal components analysis and didn't realise they will get different results if the distances are measured in km or um (microns) as the variance will change by 10^18 (so the leading component changes), even though the problem hasn't changed. This is a case where the units are best(?) standardised relative to the measurement noise (i.e. SNR).
I find that MathCAD's units helps catch the bugs when the need to think hasn't been realised. [see the ignoble awards for "Unskilled and Unaware of It: How Difficulties in Recognizing One�s Own Incompetence Lead to Inflated SelfAssessments,� http://www.apa.org/journals/features/psp7761121.pdf]
Each viewpoint has its advantages and disadvantages. Human falibility will continue to require as many techniques as we can muster!
Philip 
13. Working with numbers or variables with Units
ptc1368288 Oct 11, 2006 12:00 AM (in response to Ninetrees)[Philip] ... So many things in maths work out better when values are near zero(0), or one(1)!
=> In fact, the digital computers work only in the range of 0 ... 2 in 21 digits floating point unless forced otherwise . The Pentium returns 18 "decimals" as a safe margin to the inerrant � 3 digits probable error .
That kind of "accuracy" is purely arithmetic between the *, /, +,  It does not specify the accuracy of the numerical approximation of functions as these approximations generally range much lower, for instance ln(x) ... etc. It means that ln(1.987654321) is no more 21 digits from the Pentium.
[Rich] ... I /prefer/ to use units because I think that they contribute to traceability, though I can also see assigning the units in text near the equations.
=> assign units in text ? Units are names only, you assign values to variables.
=> Units carried all the way down work sheet(s) to ease the traceability ... my opinion is just the opposite .
.
.
. Mixed units like 0.785*D(m)^2*h(ft) = something !
I call that a "glorified idiosyncrasy". No problem for the arithmetic of it but you still have to define the result in ft� or m� (or else sub of them ) .
What you don't convert beforehand you must "afterhand".
Scaling [Philip] ... that is part of the task , not to be neglected sometimes .
It reminds the Regress scaling problem in Mathcad 8 ... up to 11 .
jmG 
14. Working with numbers or variables with Units
FredKohlhepp Oct 11, 2006 12:00 AM (in response to superres)Hear! Hear!
Fred Kohlhepp
fkohlhepp@sikorsky.com