Boost logo

Boost :

From: Anatoli Tubman (anatoli_at_[hidden])
Date: 2001-09-05 02:06:11


On Tuesday 04 September 2001 23:51, Michael Kenniston wrote:

[...]
> TOPIC: Why not make plane_angle and solid_angle be their own
> dimensions?
Will arbitrary user-defined dimensions solve the problem?

[...]
> As an aside, other examples of confusible quantities which have
> the same dimensions are:
>
> energy-density / pressure
> absorbed-dose / dose-equivalent / specific-energy
> activity-of-a-nuclide / angular-velocity / frequency
> heat-density / surface-tension
> kinematic-viscosity / thermal-diffusivity
> heat-flux-density / irradiance
> energy / moment-of-force / torque
> heat-flow-rate / power / radiant-intensity
>
> I'm no physicist so some of these may just be synonyms, but some
> are clearly different kinds of animals that should not be mixed up.

I'm no physicist either, but isn't energy a scalar and moment-of-force/torque
a vector? Those shouldn't really be mixed up!

[...]
> TOPIC: Dynamic range problems.
The problem with calibration is that one cannot use femtometers
and megaparsecs together. (A moot point: why will anyone want to mix
such quantities?) But without calibration one may
be able to use *neither* megaparsecs *nor* femtometers *alone*.
So, while we're waiting for a better floating-point type, shouldn't
we cater for users of ordinary floats and doubles?

[...]
> TOPIC: I still think the "meter()" syntax is ugly. My users
> want to say "meter".
I think I know how to handle this. Have a "meter" variable/constant,
not of the type "meter_t" but of a special type "meter_t_unit".
This type is empty. Multiplication by any quantity just adds "* meter"
to the dimension of that quantity.

[...]
> TOPIC: The representation should be parameterized to match
> the units that my users customarily use.
The real problem, as it was shown, is with the physicists, not
with the users of Imperial or whatever "human" units. But if
this main problem is solved, the Imperial system will become
essentially free, so there's no reason not to provide it.

[...]
> TOPIC: I don't need joules and farads and newtons, I want to define
> my own units.
If you agree that user-defined *dimensions* should be provided,
then consider this. Suppose the library provides length_t,
time_t and mass_t, all in SI units, and also allows me to define my own
dimensions that SI doesn't talk about. So it cannot impose any
particular units on these dimensions. Now I define my_length_t,
my_mass_t amd my_time_t, and use Planck units for them. I also
define conversion constants of types length_t/my_length_t etc.
So it turns out that SI dimensions and units might as well be
defined on the same basis with my own dimensions and units.
Do you agree?

[...]
> TOPIC: Some "constants" are experimental numbers with finite precision,
>
> rather than defined values; they may have to be updated when experiments
>
> get better.
>
> There seem to be two choices: the values are either compiled-in or
> read in at run-time.
There's also a third choice: assume them to have value of 1,
devise your unit system accordingly, and avoid the whole mess.

-- 
anatoli at ptc dot com -- opinions are mine

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