Boost logo

Boost :

From: Eric Ford (eford_at_[hidden])
Date: 2001-09-28 20:35:03


I recently thought of another compilcation for the units library. How
to handel quantities which have the same dimensions, but units for
which the conversions are not possible or not desirable. For example,
before radar measurements of distances between various bodies in the
solar system, the distance from the Earth to the Sun was not very well
known. Astronomers would then measure distances in units where were
linearly proportional to the Earth-Sun separation (1 AU). They were
still distances which could be treated as lengths, but it would not
have been a good idea to convert them to meters via some constant
conversion factor. Once radar measurements allowed a more precise
measurement of the AU, then distances measured in AUs became more
precise. If people had converted all their measurements to meters,
then they would have to remember what distance they perviously assumed
for the AU in order to take advantage of the improved measurement of
the AU.

This may seem some what arcane, but actually the problem often arises
when one infers one quantity based on measurements of other
quantities. Frequently, it's not that important since there is one
qunatity which has much more error than the other quantities involved.
In such a case the measurement is interpreted to be a measurement of
the previously poorly known quantity. It becomes a problem when two
(or more) quantities have comparable uncertainties. If people need
convincing, I could easily give many examples which still exist within
my specialty.

What to do about it in a units library is less clear. I think this
would be another argument for either requiring conversions to be made
explicit or at least allowing the user the option of prohibiting
implicit conversions between units. Further it seems this type of
concern may be too much for the current SIunits framework. It can't
distinguish two units of the same dimension as not implicity
convertible. Perhaps the tags idea developed for distinguishing
between things like 1L of soda versus 1L milk could be used to fufill
this need. (e.g. "1 parsec as measured in AUs as defined by the IAU
standard as of 2001", a parsec is a unit of distance and the IAU is
like a standards body for astronomy) Obviously, that's a bit long, but
hopefully it conveys the idea.

Even more impressive would be a library that would recognize when
certain combinations of constants appeared together. For example, if
I used G*M_sol (G being the gravitational constant and M_sol being the
sun's mass), then it would realize that it could use a value for
G*M_sol that is more accurate than the value of G times the value of
M_sol. Of course, that would require a much more intelligent library
than we (or at least I) had been thinking of. It seems like that
would require something like expression templates, but that may be
overkill.

E


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk