Use Advanced Search to search the entire archive.
[jsr363-experts] Re: Request for clarification on Unit commensurability
- From: Martin Desruisseaux <
>
- To:
- Subject: [jsr363-experts] Re: Request for clarification on Unit commensurability
- Date: Wed, 17 Dec 2014 01:43:23 +0900
- Organization: Geomatys
Le 16/12/14 23:00, Werner Keil a écrit :
>
It explains, the only constant (3600) is the factor to calculate
>
seconds to hours.
I guess they have an other constant, namely 1 J/K/m3, which they omitted
because the numerical value is 1. But when dealing with Quantity
objects, we must keep such constant because the units are not
dimensionless. With such constant, the following line become consistent:
Quantity<Energy> energy =
volume.multiply(temperature).multiply(C).asType(Energy.class);
I have no idea where such C constant come out - we would need to read
carefully the text for that. Note that the units of the Boltzmann
constant is J/K, which (added to my feeling that the formulas was about
gas) make me suspect a relationship between the Boltzmann constant and
the C constant.
Proposed text for the specification(maybe other persons could have
the same confusion)
Formulas with Quantity objects are not necessarily the same than
formulas with double primitive types. For example consider the following
operations:
A * B * C
If A, B and C are double primitive types and if C == 1, then the
operations can by simplified as A * B. However if A, B and C are rather
Quantity objects, then the same simplification can be applied only if C
== 1 _*and*_ is dimensionless. Be aware that the last condition is not
always true. For example we could have C = 1 (J/K)/m³. In such case the
C constant can be dropped when performing calculations using the double
primitive types, but not when performing calculation using Quantity
objects. When converting a formula designed for the double primitive
types to a formula using Quantity objects, the developer should keep in
mind that the later formula may need more terms than the former one.
Martin