▲ | jonjojojon 5 days ago | |||||||||||||||||||||||||||||||||||||
The modeling of unit systems with types is fraught with all sorts of inconsistencies and design tradeoffs. There are quantities that have the same dimensions, but shouldn't be compared or allow arithmetic between them. Many issues with Temperature scales and how to interpret differences in these spaces. I think a pretty well thought out approach to this is the mp-units library in c++ that uses the ISQ(International System of Quantities) [1]. There are some great blog posts on their site about modeling units systems and dimensions. Fingers crossed it may even be added to the standard library in C++29. | ||||||||||||||||||||||||||||||||||||||
▲ | adrian_b 4 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||
Many quantities that in the current official version of SI appear to have the same dimensions, in fact do not have the same dimensions. The illusion of having the same dimensions has been caused by a vote of the General Conference on Weights and Measures, which has been exactly as stupid as deciding by vote that 2 + 2 = 5. It is really a shame that something like this has happened. According to that vote, some quantities have been declared as adimensional, even if arbitrary units of measurements must be chosen for them, exactly like for any other physical quantity and their units enter in the definitions of many other units, so changing any such choice of a unit changes the values of many other SI units, which implies that any version of SI that does not explicitly include the fundamental units chosen for "adimensional" quantities is incomplete. The system of units of measurement required for the physical quantities includes fundamental units a.k.a. base units, which are chosen arbitrarily, without any constraints, and also derived units, whose values are determined in such a way as to eliminate all constants from the formulae that relate the physical quantity for which the derived unit is determined to other physical quantities for which units have already been determined. The fundamental units are of 3 kinds, which I shall call arithmetic units, geometric units and dynamic units. The arithmetic units are for discrete quantities, i.e. quantities that are expressed in integer numbers, so they have natural units. There are a huge number of such fundamental units for quantities that can be obtained by counting, e.g. the number of atoms of a certain kind, the number of ions of certain kind, the number of molecules of a certain kind, the number of objects of a certain kind, the number of apples, the number of oranges, the number of humans and so on. While "1" is the natural unit for all such quantities, in physics and chemistry there are many such quantities for which the conventional SI unit is not "1", but the number of Avogadro, a.k.a. one mole of substance. Besides numbers of various entities, if we neglect nuclear/"elementary" particle physics, there is one more discrete physical quantity, which is the electric charge a.k.a. the quantity of electricity. The natural unit for the electric charge is the elementary electric charge and the conventional SI unit, the coulomb, is defined as an exact multiple of the elementary electric charge. Besides the units for discrete quantities, there are 6 fundamental units for continuous quantities, 3 geometric units & 3 dynamic units. The 3 geometric units are the units of logarithmic ratio, plane angle and solid angle (which are respectively associated with 1-dimensional, 2-dimensional and 3-dimensional spaces). The 3 fundamental geometric units are chosen by a mathematical convention, but they are exactly as arbitrary as the fundamental dynamic units. This is proven by the fact that in practice many different choices are used for these 3 fundamental units. Like length can be measured in meters or in feet, logarithmic ratios can be measured in nepers or in decibels, plane angles can be measured in degrees or in right angles or in cycles or in radians, while solid angles can be measured in orthogonal trihedral angles, in whole spheres or in steradians. Changing the choice for any of these fundamental units requires value conversions for all physical quantities that have units derived from them, in the same way like when replacing Imperial units with metric units. There are many physical quantities in SI that appear to have the same dimensional formulae, but this happens only because the units of logarithmic ratio or plane angle or solid angle are omitted from the formulae. This omission is especially frequent for the unit of plane angle, which enters in a much greater number of dimensional formulae than it is obvious. For instance, the magnetic flux also includes in its dimensional formula the unit of plane angle, though you will almost never see this taken into account. The SI includes a greater number of conventional fundamental dynamic units than necessary, for historical reasons, which results in a greater number of "universal constants" than for an optimal system of units, which requires only 3 fundamental dynamic units. While at the end of the 18th century, when the metric system has been designed, it was convenient to choose as fundamental dynamic units the units of length, time and mass, for which distinct physical devices were chosen to materialize the units, the current SI system is equivalent with choosing a single physical device to materialize all 3 fundamental dynamic units, which are the units of length, time and electric voltage (yes, now the unit of mass is derived from the unit of electric voltage, not vice-versa, despite confusing definitions that can be encountered in many texts). The single physical device that can materialize all 3 fundamental dynamic units is an atomic clock. The electromagnetic wave corresponding to its output signal provides the unit of length in its wavelength, the unit of time in its wave period, while the Josephson voltage corresponding to its frequency provides the unit of electric voltage. The conventional units of SI are obtained from the 3 units provided by an atomic clock by multiplication with conventional exact constants, in order to ensure continuity with the older units of measurement. A few of the so-called base units of SI are no longer true base units, but they are derived from the true base units by inserting exact conventional constants in the formulae relating physical quantities, e.g. the units of temperature and luminous intensity. | ||||||||||||||||||||||||||||||||||||||
|