|
Boost Users : |
Subject: Re: [Boost-users] [units] division with absolute temperature
From: João Leal (joaoruileal_at_[hidden])
Date: 2016-04-19 04:35:58
Thank you for the reply!
I was thinking of using the absolute temperature in a modeling framework.
I don't really know which units the user is going to use.
The kelvin units were just used in the example to show my difficulties in
using absolute temperature dimensions.
I am afraid the user can do something like temperature = 20 * celsius while
hoping to get (273.15 + 20) * kelvin.
Unfortunately, if I use absolute temperature to avoid this problem, then
that variable needs to be converted to relative temperature every time it
is used in expressions (e.g. ideal gas law: n = PV/(RT)).
I'll probably use relative temperatures and document it very well.
Best regards,
João Leal
2016-04-18 22:10 GMT+01:00 Steven Watanabe <watanabesj_at_[hidden]>:
> AMDG
>
> On 04/18/2016 03:32 AM, João Leal wrote:
> >
> > I'm trying to use absolute temperature in some expressions.
> > Unfortunately I'm having some issues with the compilation.
> > For instance, if I divide an absolute temperature by itself I would
> expect
> > to get 1 dimensionless, however that will cause a compilation error.
> >
>
> This is forbidden by design. Division of
> absolute temperatures only makes sense
> for kelvin. If you're only using kelvin,
> then you don't really need to use absolute.
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net