Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Units documentation
From: Matthias Schabel (boost_at_[hidden])
Date: 2011-09-26 19:07:31

> I am afraid I have yet another question for you. I am trying to define a
> polynomial in what boost.units calls 'absolute temperature', something along
> the lines of
> (0.015/kelvin_squared)*T_abs*T_abs + (0.014/kelvin)*T_abs
> The temperature involved is simply the temperature of the atmosphere, which
> seems best represented by an absolute temperature. As I understand things
> now this is not possible and I would need to user 'relative temperatures' to
> be able to use multiplications etcetera. In the case at hand, that would
> mean that I should use T_rel = T_abs - 0.0*kelvin which just doesn't feel
> right I am afraid and does not allow conversion to a Celsius scale (which
> needs to be based on the 'absolute temperature'). It seems to me that
> 'scaling by a factor 0.015' is just as meaningful for absolute temperatures
> as it is for relative temperatures...
> I understand that the relation between (absolute) temperature scales is
> affine instead of linear and that this has triggered the need to make the
> distinction (as for the relation between linear scales it does not really
> matter whether measurements are relative or absolute (which is just
> 'relative to zero' as indicated above)).


In general, equations like these have an implicit offset, so what you really want is T_rel = T_abs - T_offs, as you have written. Especially if it is empirically-derived, polynomial expansions are often used implicitly - that is, the model equations are essentially intended to represent a Taylor (or some other) series expansion. As Steven pointed out, Kelvin is a special case because the offset is defined as zero. These expansions are always done around a specific point and, if you look at the equations for the expansions themselves you will see that they are dimensionally consistent :

f(T-T_offs) ~ f(T_offs) + f'(T_offs) (T-T_offs)/1! + f''(T_offs)(T-T_offs)/2! + …


Unit ~ Unit + Unit/Kelvin (Kelvin) + Unit/Kelvin^2 (Kelvin)^2 + …

should also make sense if you change the unit of temperature to something else, which is what you would be doing if you wanted to scale by 0.015...this is only possible if you use relative temperatures. One way to think about it is to try to rewrite the equation so it works correctly if temperatures are specified in Celsius - clearly, you will have to introduce both an offset and a scale factor to get the correct behavior...


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at