
Engineering
application design*

Winter
2000 Topic/Project:
Unit of Measure Conversion
Simple conversion:
lb => kg
Complex
conversion:
ft^3/hr
=> kg/day - requires density

Over
the next several months, this topic will be discussed at length,
as it is fundamental to engineering applications design.
It
should be noted: "this is by no means the only way to solve
this problem, nor is it necessarily the best way. The key is,
it is somewhere to start. And for the lack of any thing else...lets
begin..."
If
anyone has any suggestions, please feel free to email
them. They would be greatly appreciated and welcomed.
Our
goal:
"Design
a unit conversion module in Visual Basic 6.0"
When
designing engineering applications, one can not overlook the importance
that units play when designing algorithms.
One
would never think of adding 15 lb to 40 kg without first converting
to a common unit base, of either lbs or kg's. If this step is
ignored serious complications arise. As was seen recently with
one of the NASA Mars space probes that missed its target. Why?
Because someone forgot, or missed, a unit conversion, resulting
in an incorrect calculations. The cost? Astronomical, in both
time and money.
As
we define the problem we will see just how complicated unit conversions
are. It is impractical to think that we will consider every type
of unit conversion, but we want to cover as many possibilities
as practical.
In
the process, we want to design a module that is both functional
and extensible. Thus, as our requirements grow we will have an
algorithm that will be easy to maintain and expand.
So
lets begin with the obvious:
The
problem:
At
first glance, converting units of measure may seem quite trivial.
Yet, as we investigate the problem we quickly realize that it
is actually quite complex.
e.g.
types of conversions:
Simple
linear conversion:
2.2
lb = 1 kg (approx.)
Conversions
requiring a scale change:
F
= 9/5 * C + 32
Complex
conversions requiring additional parameters:
lb/hr
= ft^3/hr * density (lb/ft^3) (mass flow = volume flow * density)
The
problem is made more complex because the algorithm must allow
for the reciprocal unit conversion.
e.g. 2.2
lb = 1 kg and 0.45 kg = 1 lb (approx.)
Not
to be forgotten: As more units conversions are added we need to
take into account all possible combinations for unit within a
give type.
e.g. Weight
2.2 lb =
1 kg
16 oz =
1 lb
1000 g =
1 kg...etc

Much
more to come...So please come back soon...
If
you have any comments or tips that you wish to share please feel
free to email them.
*Use
of this information is as is and with out warranty of any kind.
Azor Group Inc. takes no responsibility for the use or accuracy
of any information presented here. Reproduction in whole or in
part is strictly prohibited.
Visual Basic is a registered trademark of Microsoft Inc. The names
of actual companies and products mentioned herein may be the trademarks
of their respective owners. Any rights not expressly granted herein
are reserved.
|