Physlib.Units.Basic
30 declarations
Scaling factor for a dimension between unit choices and
#dimScaleGiven two sets of unit choices and , this function defines a monoid homomorphism from physical dimensions to the non-negative real numbers . For a dimension , it computes the scaling factor used to convert a quantity of dimension from unit system to . This factor is calculated as the product of the ratios of the fundamental units (length, time, mass, charge, and temperature) in and , each raised to the power of the corresponding component in the dimension : where the exponents are the rational powers associated with each fundamental dimension.
Formula for the Scaling Factor of a Physical Dimension between Unit Systems and
#dimScale_applyGiven two sets of unit choices and and a physical dimension , the scaling factor is calculated as the product of the ratios of the fundamental units in and , each raised to the power of the corresponding component in the dimension : where represents the fundamental unit of a specific type (length, time, mass, charge, or temperature) in unit system , and represents the rational exponent of that fundamental dimension in .
for identical unit systems
#dimScale_selfFor any set of unit choices and any physical dimension , the scaling factor used to convert a quantity of dimension from unit system to itself is equal to .
The scaling factor for the dimensionless dimension is
#dimScale_oneFor any two systems of unit choices and , the scaling factor associated with the identity dimension (dimensionless quantity) is equal to .
For any three sets of unit choices and any physical dimension , the scaling factor used to convert a quantity of dimension from unit system to satisfies the transitivity property:
For any two systems of unit choices and and any physical dimension , the product of the scaling factor (used to convert a quantity of dimension from unit system to ) and the scaling factor (used for the reverse conversion) is equal to :
For any two systems of unit choices and any physical dimension , let be the factor used to convert a quantity of dimension from unit system to . The product of this scaling factor and its reverse counterpart , when converted to real numbers, is equal to :
The dimension scaling factor is non-zero
#dimScale_ne_zeroFor any two systems of unit choices and any physical dimension , the scaling factor is non-zero. This scaling factor represents the product of the ratios of fundamental units in and raised to the powers specified by the dimension , used to convert physical quantities between the two unit systems.
For any two systems of unit choices and any physical dimension , the scaling factor used to convert quantities of dimension from unit system to is the multiplicative inverse of the scaling factor for the reverse conversion. That is,
For any two systems of unit choices and any physical dimension , the scaling factor for the inverse dimension from unit system to is equal to the scaling factor for the original dimension when converting from unit system to . That is,
Scaling by `dimScale` is injective in
#smul_dimScale_injectiveLet be a type equipped with a scalar action of the non-negative real numbers . For any two systems of unit choices and any physical dimension , let be the scaling factor associated with converting quantities of dimension from unit system to . For any two elements , the result of scaling by is equal if and only if the original elements are equal:
For any two systems of unit choices and any physical dimension , the scaling factor used to convert physical quantities of dimension from unit system to is strictly positive:
The International System of Units (SI) choices
#SIThe definition `UnitChoices.SI` represents the choice of base physical units corresponding to the International System of Units (SI). It is a structure of type `UnitChoices` where the fundamental units are assigned as follows: - The unit of length is meters. - The unit of time is seconds. - The unit of mass is kilograms. - The unit of charge is coulombs. - The unit of temperature is kelvin.
In the International System of Units (), the base unit assigned to the length dimension is the meter:
In the International System of Units (), the fundamental unit chosen for the dimension of time is the second ().
The SI unit of mass is the kilogram
#SI_massIn the International System of Units (SI), the designated fundamental unit for the mass dimension is the kilogram.
The SI unit of charge is the coulomb
#SI_chargeIn the International System of Units (SI), the assigned base unit for physical charge is the coulomb.
The SI unit of temperature is Kelvin
#SI_temperatureIn the International System of Units (SI), the base unit for temperature is defined as Kelvin.
Prime-scaled SI unit system
#SIPrimed`UnitChoices.SIPrimed` is a specific set of unit choices derived from the International System of Units (SI) where each base unit is scaled by a distinct prime number. It is defined as follows: - Length: - Time: - Mass: - Charge: - Temperature: This configuration is primarily used to verify the dimensional correctness of physical expressions, as the prime scaling ensures that different combinations of base dimensions result in unique scaling factors.
Scaling factor for dimension from to units
#dimScale_SI_SIPrimedFor any physical dimension , the scaling factor required to convert a quantity from the International System of Units () to the prime-scaled system () is given by the product: where , and are the rational components of the dimension . This factor arises because the base units in (meters, seconds, kilograms, coulombs, and kelvin) are scaled by the factors 2, 3, 5, 7, and 11, respectively, relative to .
Scaling factor for dimension from to units
#dimScale_SIPrimed_SIFor any physical dimension , the scaling factor required to convert a quantity from the prime-scaled system () to the International System of Units () is given by the product: where , and are the rational components (exponents) of the dimension . This factor corresponds to the ratios of the base units in relative to , which are scaled by factors of 2 (length), 3 (time), 5 (mass), 7 (charge), and 11 (temperature).
is consistent with dimension
#HasDimensionLet be a type that carries a physical dimension, denoted as . A function , representing a quantity whose value depends on the chosen system of units, satisfies the property **HasDimension** if it scales correctly under a change of units. Specifically, for any two unit choices , the value of the function at must relate to the value at by: where is the scaling factor associated with dimension for the transition from unit system to , and the multiplication represents the action of non-negative reals on .
`HasDimension f` iff scales by `dimScale` for the dimension of
#hasDimension_iffLet be a type that carries a physical dimension, denoted as . For any function , the property **HasDimension** holds if and only if for all unit choices , the value of the function at is related to the value at by the scaling factor associated with the dimension of : where is the scaling factor for the transition from unit system to , and the multiplication represents the action of non-negative reals on .
The type of dimensionful quantities of type
#DimensionfulLet be a type that carries a physical dimension, denoted as . The type **Dimensionful ** is defined as the set of functions that are consistent with the dimension of . Specifically, a function belongs to this type if, for all pairs of unit choices , it satisfies the scaling relation: where is the scaling factor associated with the dimension of for the transition from the unit system to , and the multiplication denotes the action of non-negative reals on .
Coercion from **Dimensionful ** to functions
#instCoeFunDimensionfulForallUnitChoicesFor any type that carries a physical dimension, an element of the type **Dimensionful ** can be treated as a function from the set of unit choices to . This coercion allows a dimensionful quantity to be evaluated at a specific system of units to return its value in .
for Dimensionful Quantities
#extLet be a type that carries a physical dimension. For any two dimensionful quantities , if their underlying functions are equal, then the dimensionful quantities themselves are equal ().
-action on
#instMulActionNNRealDimensionfulLet be a type that carries a physical dimension. The space of dimensionful quantities of type , denoted as , is equipped with a scalar action by the non-negative real numbers . For any scalar and any dimensionful quantity , the action is defined pointwise for each choice of units as: where the right-hand side is the action of on . This operation satisfies the axioms of a multiplicative action: and .
for dimensionful quantities
#smul_applyLet be a type that carries a physical dimension. For any non-negative real number , any dimensionful quantity (represented as a function from unit choices to ), and any specific choice of units , the value of the scaled dimensionful quantity at is equal to the scalar acting on the value of at : where the multiplication on the right-hand side is the action of on the type .
Equivalence relative to unit choice
#toDimensionfulLet be a type that carries a physical dimension . Given a specific system of units , there exists an equivalence (bijection) between the type and the type of functions that scale correctly under a change of units. An element corresponds to the dimensionful quantity defined by: where is the scaling factor for dimension when transitioning from unit system to . Conversely, a dimensionful quantity is mapped to the value it takes in the unit system , given by .
Evaluating a dimensionful quantity from in equals
#toDimensionful_apply_applyLet be a type that carries a physical dimension . For any two systems of unit choices and any value , let be the dimensionful quantity (an element of the type **Dimensionful **) that corresponds to in the unit system . The value of when evaluated at the unit system is given by: where is the scaling factor associated with dimension for the transition from unit system to , and the multiplication denotes the action of non-negative reals on .
