## Empirical Equations

## Empirical Equations

(OP)

I just had occssion to fix a problem that I've been having with a very complex empirical equation for several years.

Units are a problem in equations with fractional exponents, logs, trig functions so most of the time people just put in the numbers with confidence that the constants take care of unit conversions.

I had an equation that was expecting pressure in lbf/ft^2. I put this equation into my "notebook" MathCAD file (13 MB of useful relationships) several years ago and didn't document it very well. I use the equation a few times a year and for the last couple of years I've gotten answers that haven't made much sense. This morning I looked it up and found that it wanted psf not the psi that I was giving it.

I just went through my whole notebook and changed every entry in every empirical equation to require units. I did this by dividing each varible by the proper unit within the equation and then multiply the entire expression times the units that the empirical equation is supposed to return. I get the added benefit that I don't have to convert units offline anymore. If the equation wants pipe length in miles, I can define the "PipeLen" vairable in meters and the "PipeLen/mi" in the equation converts it.

This technique also makes the equations self documenting. For anyone who regularly uses empirical equations I would highly recommend it.

David

Units are a problem in equations with fractional exponents, logs, trig functions so most of the time people just put in the numbers with confidence that the constants take care of unit conversions.

I had an equation that was expecting pressure in lbf/ft^2. I put this equation into my "notebook" MathCAD file (13 MB of useful relationships) several years ago and didn't document it very well. I use the equation a few times a year and for the last couple of years I've gotten answers that haven't made much sense. This morning I looked it up and found that it wanted psf not the psi that I was giving it.

I just went through my whole notebook and changed every entry in every empirical equation to require units. I did this by dividing each varible by the proper unit within the equation and then multiply the entire expression times the units that the empirical equation is supposed to return. I get the added benefit that I don't have to convert units offline anymore. If the equation wants pipe length in miles, I can define the "PipeLen" vairable in meters and the "PipeLen/mi" in the equation converts it.

This technique also makes the equations self documenting. For anyone who regularly uses empirical equations I would highly recommend it.

David

## RE: Empirical Equations

Definitely worth doing.

Philip

## RE: Empirical Equations

x=0.2794·(f/60)·log(a)

comes up quite often where f is frequency in Hz and the answer is in ohms/mile. The equation

x=4·pi·f·10^-7·ln(a)·(henry/m)

is a more basic equivalent that doesn't depend on units.

I also find that documentation can be more clear to someone familiar with the empirical equation if I predefine the variables with units ahead of the equation and just use the new variable in the equation.

## RE: Empirical Equations

The curve fitting that people did 50-75 years ago (mostly with slide rules and very sparse data sets) is pretty amazing.

David

## RE: Empirical Equations

In this equation 'a' must be unitless (which includes radians and steradians).

I also like to make sure that I have the fundamental formual, but somethime one needs to use the 'book' formula and embed the units in that, so f -> f/Hz, l -> l/m, h -> h/ft, m -> m/kg etc.

[noting:

1) that the US pound is sometmes a force and sometimes a mass;

2) that m can be both mass and metres, so use the maths styles to discriminate between them.]

Philip

## RE: Empirical Equations

What nonsense. An emirical equation is an empirical equation. I've seen examples of Oil & Gas equations converted to "SI" and the units chosen are just as stupid as the original. Pipe diameter may be in mm, cm, or m (and I've seen all of them). Pressure may be in bar, Pa, kPa, MPa, or kg/m^2 for gods sake (interesting that kg can be either a force or a mass in the hands of real people). Temperature may be in C or K.

I know there are very precise acceptable units in SI, but I've seen every bit as much confusion with meters as with feet because people use what makes sense to them not to some committee.

Empirical equaitons are created through observation, not through derivation. If a person can make a line fit his data better by taking a log of an expression that is just fine, but the units need to be stripped within the function.

David

## RE: Empirical Equations

I think you'll have a friend in JmG over on the collab http://collab.mathsoft.com/~Mathcad2000.

He also disdains the use of units, thinking that they should be done off-line (usually by hand / error prone) and that the formulas are just arithmetic.

The biggest problem in all this is not realising where the errors are comming from in one's local domain.

In some instances it comes from poor arithmetic skills so having the formula written in 'local' units avoid some large errors.

Some times it is typographic (Jmg mentions a 4" valve that was delivered as a 4' one (that is delivered in feet, requested in inches).

While at other times the problems are in the conversion between one unit of measure to those needed in the formulas (e.g the Mars Lander).

Then there is the mass - weight problem.

The MathCAD philosophy (which is unique among the computer packages) is to display and remember the units and know their conversions throughout the worksheet.

There is still a need for proper engineering review of the results for 'reasonableness' no matter what the tool. But we should seek out as much support and error checking and warnings as possible.

Hence I am for the inclusion of the units convertion within the empirical formula (not converting the formulas). Tthe user can then see the normal measure that is to be expected, rather than it being a note that might be lost.

Grade = log(weight/tonne)

is better than

Grade = log(weight) ..... [note weight to be the number of tonnes]

The latter is the sort of thing that happens in Excel, matLab, C, etc.

Philip

(all science is empirical: repeatable demonstrable observations. Engineering equations are no different, the error bars may be larger though

## RE: Empirical Equations

I don't disdain units, the thing that saved me in Nuc School, college, graduate school, and the PE exam was unit analysis. For the pretty equations that you see in those places, I really like the way MathCad handles units. In fact I like the way it handles them in empirical equations--I can put in a length in "km" and since I divide the length in the equation by "mi" I get the right answer without ever having to do the conversion at all.

David

## RE: Empirical Equations

TTFN

FAQ731-376: Eng-Tips.com Forum Policies

## RE: Empirical Equations

## RE: Empirical Equations

I always tried to do that too (it didn't always work) before I started using MathCAD. Now I just multiply the constant times the units of the answer and divide everything else by its unit. Life got so much simpler when I gave up and started doing that.

David