packageUnits
Extends from Icons.Package (Icon for standard packages (from MSL 3.2.1)).
Information
Below are details about the premise and the implementation of physical units in QCalc. For an overview of how to use QCalc, please see the top-level documentation and the getting started page. This text has been updated and adapted from [Davies2012]. That paper also suggests how the approach might be better integrated in the Modelica language. Please also see the documentation of the Quantities package.
Introduction:
In mathematical models, one uses variables to represent physical quantities. As stated by the Bureau International des Poids et Mesures (BIPM) [BIPM2006, p. 103]:
"The value of a quantity is generally expressed as the product of a number and a unit. The unit is simply a particular example of the quantity concerned which is used as a reference, and the number is the ratio of the value of the quantity to the unit."
In general, a unit may be the product of other units raised to various powers.
In Modelica, a physical
quantity is represented by a Real variable.
Its value attribute is a number
associated with the value of the quantity (not the value of the quantity
itself, as will be shown). Usually the value attribute is
not explicitly referenced because it is automatically returned when the
variable itself is referenced. The unit attribute is a string that
describes the unit by which the value of the quantity has been divided to
arrive at the number. The displayUnit attribute (also a
string) describes the unit by which the value of the quantity should be
divided to arrive at the number as it is entered by or presented to the
user. The Real type contains other attributes as well,
including the quantity string.
The SIunits package of the
Modelica Standard Library contains
types that extend the Real type. The type definitions
modify the unit, displayUnit, and
quantity attributes (among others) to represent various
physical quantities. The unit and displayUnit
attributes are based on the
International System of Units (Système
international d'unités, SI). The quantity string is
the name of the physical quantity. For example, the
Velocity type has a
unit of "m/s" and a quantity of "Velocity".
If an instance of Velocity
has a value of one (v = 1), then it is
meant that "the value of velocity is one metre per second." Again, the
value attribute represents the number, or the value of the
quantity divided by the unit, not the value of the quantity itself.
This conflict is solved in QCalc
by establishing units as mathematical entities and writing
v = 1 m/s (in code, v = 1*U.m/U.s or simply
v = U.m/U.s, where U is an abbreviation for this
package). Here, the variable v directly represents the quantity.
Its value attribute is truly the value of the quantity in the
context of the statement by BIPM (above). One advantage is that unit
conversion is built in. The essence of unit conversion is that the
phrase "value of quantity in unit" typically means "value of
quantity divided by unit." Continuing with the previous example,
v is divided by m/s in order to display v in metres per
second (as a number). If another unit of length like the foot is
established by the appropriate relation (ft ≈ 0.3048 m) and
v is divided by ft/s, the result is velocity in feet per second
(∼3.2894). Some units such as °C, Pag, and dB involve offsets or
nonaffine transformations between the value of the quantity and the
number; these are described by functions besides simple division.
Method:
In QCalc, each scalar unit is a constant quantity. The value of a unit, like other quantities, is the product of a number and a unit. Therefore, units may be derived from other units (e.g., Pa = N/m2). This recursive definition leaves several units (in SI, 7) that are locally independent and must be established universally. These base units are established by the "particular example of the quantity concerned which is used as a reference" quoted previously [BIPM2006]. The choice of the base units is somewhat arbitrary [Fritzson2004, p. 375], but regardless, there are a number of units that must be defined by example.
If only SI will be used, then it is easiest to set each of the base units of SI equal to one—the metre (m), kilogram (kg), second (s), ampere (A), kelvin (K), mole (mol), and candela (cd). This is implicitly the case in the SIunits package, but again, it hardly captures the idea that the value of a quantity is the product of a number and a unit.
Instead, in QCalc, the values of the base units are established from physical constants. This approach reflects the way that standards organizations (e.g., NIST) define modern units. The "particular example of the quantity" [BIPM2006] is an experiment that yields precise and universally repeatable results rather than a prototype (e.g., the international prototype kilogram) which is carefully controlled and distributed via replicas. This approach also makes it easy to normalize certain constants as in natural unit systems.
In addition, the values of the constants can be chosen to scale the values of variables. There are physical systems where typical quantities are many orders of magnitude larger or smaller than the related product of powers of base SI units (e.g., the domains of astrophysics and atomic physics). In modeling those systems, it may help to choose appropriately small or large values (respectively) for the corresponding base units so that the product of the number (large or small in magnitude) and the unit (small or large, respectively) is well-scaled. This scaling is usually unnecessary due to the wide range and appropriate distribution of the real numbers that are representable in floating point.1 However, in some cases it may improve computational performance to scale the units and use lower precision. There are fields of research where, even today, simulations are sometimes performed in single precision [Brown2011, Hess2008] and where scaling is a concern [Rapaport2004, p. 29]. The number and the unit are usually multiplied before the dynamic simulation or even during translation because the product is often involved in initial conditions or parameter expressions. During the simulation, only the value is important, so there is no computational overhead. The value is divided by the display unit after the simulation.
The method is neutral with regards to not only the values of the base units, but also the choice of the base units and even the number of base units. This is an advantage because many systems of units besides SI are used in science and engineering. As mentioned previously, the choice of base units is somewhat arbitrary, and different systems of units are based on different choices. Some systems of units have fewer base units (lower rank) than SI, since additional constraints are added that exchange base units for derived units. For example, the Planck, Stoney, Hartree, and Rydberg systems of units set the Boltzmann constant equal to one (kB = 1) [http://en.wikipedia.org/wiki/Natural_units]. The kelvin is eliminated [Greiner1995, p. 386] or, more precisely, considered a derived unit instead of a base unit. In SI, the kelvin would be derived from the kilogram, metre, and second, (K ≈ 1.381×10-23 kg m2/s2). In this case, temperature is not an independent dimension.
There are seven base constants in the Units package (R∞, c, kJ, RK, kF, R, and kA'; see Units.Bases) and seven SI base units (m, s, kg, A, K, mol, and cd). The candela (cd) is decoupled from these constants by the luminosity function, but the radian (rad) is derived from them.
Implementation:
The units and constants are defined as variables in this
Units package. Each is a
constant of the appropriate type from the
Quantities package. The first
section of this package establishes mathematical constants. The next section
establishes the independent base constants, which are grouped in a
replaceable record. The third section derives
other physical constants from the base constants.
The fourth section establishes units from the base constants
using transcendental and empirical relations. The rest of the
code derives additional units and constants from those units.
All of the units from [BIPM2006] are
defined, which includes the
SI units and
some non-SI units. Other units are included for convenience.
Some prefixed units are defined as well, but most
must be expressed using separate factors (e.g.,
U.Prefixes.k*U.m).
Some units such as Celsius and
decibel involve functions other than multiplication.
These units are called lambda units and are defined via
operator records. The * and / operators are overloaded
to call the unit's transformation and its inverse, respectively.
This package (QCalc.Units) is
abbreviated as U for convenience throughout the rest of
QCalc, and
QCalc.Quantities is
abbreviated as Q.
The Units.setup function establishes unit conversions using the values of the units, constants, and prefixes. These conversions may include offsets. The function also sets the default display units. It is automatically called when QCalc is loaded from the load.mos script. It can also be called manually from the "Re-initialize the units" command available in the Modelica development environment from the Units package and its subpackages. A spreadsheet (Resources/quantities.xlsx) is available to help maintain the quantities, default units, and the setup function.
The values of the units, constants, and prefixes can be evaluated by translating the Units.Examples.Evaluate model. This defines the values in the workspace of the development environment. For convenience, the load.mos script automatically translates that model and saves the result as "units.mos" in the working directory.
In order to interpret the simulation results stored in a file, it is necessary to know the values of the base constants. Since these may be changed, it is a good idea to drop QCalc.Units.UnitSystem into your model to record the values of the base constants in the results.
Although it is not necessary since Modelica is acausal, the declarations in this package are sorted so that they can be easily ported to imperative/causal languages (e.g., Python and C).
Some notes on angle:
As mentioned on the getting started page and in the Quantities package, angle is a dimension. This is different from SI, where angle is considered dimensionless (rad = 1) [BIPM2006].2 Units of angle such as the cycle (cyc), radian (rad), and degree (deg) must be explicitly included in the expression of quantities, but they often cancel in equations relating quantities. The following differences are noted from the traditional SI representation:
- The radian is defined as the cycle divided by two pi (rad = cyc/2π), which is not necessarily one because angle is derived from the independent base constants (as mentioned above).
- Solid angle has the dimensionality of squared angle. The streradian (sr) is defined as the squared radian (rad2), not one.
- Frequency and rotational velocity have the dimensionality of angle per time. The hertz (Hz) is defined as cyc/s (not s-1).
- The cross product (×) introduces a
factor of rad-1. This means that:
- Torque, defined as r×F, has the dimensionality of energy per angle. Where J or N m is traditionally used to express torque, J/rad (or N m/rad) should be used.
- A factor of 2π appears in the the Maxwell-Faraday equation and Ampère's circuital law of
Maxwell's equations:
- ∇×E = -2π ∂B/∂t
- ∇×B = 2π μ0(J + ε0 ∂E/∂t) (This formation is also based on other points below.)
- Rotational momentum has a factor of angle in the denominator.
- The Planck constant (h)
can be expressed in J/Hz or
J s/rad (but not J s):
- h cyc ≈ 6.626×10-34 J s (the traditional expression of the Planck constant [NIST2010])
- h rad ≈ 1.055×10-34 J s (the traditional expression of the reduced Planck constant [NIST2010])
- The quantum of circulation (rotational momentum per mass) is expressed as:
- kappa ≈ 3.637×10-4 m2/(cyc s)
- The Planck constant (h)
can be expressed in J/Hz or
J s/rad (but not J s):
- Rotational inertia has a factor of squared angle in the denominator. It can be expressed in kg m2/rad2.
- Wavenumber has the dimensionality of angle per
length. Where m-1 (or cm-1, etc.) is traditionally used to express wavenumber,
cyc/m (or cyc/cm, etc.) should be used instead. Reciprocally, wavelength has the dimensionality of length per angle
and is expressed using m/cyc (or cm/cyc, etc.). This implies that:
- R∞ ≈ 10973732 cyc/m
- c2 = 1.439×10-2 m K/cyc
- c3 λ ≈ 2.898×10-3 m K/cyc
- λe cyc ≈ 2.426×10-12 m (The right side is the traditional expression of the electron's Compton wavelength [NIST2010].)
- λe rad ≈ 386.2×10-15 m (The right side is the traditional expression of the electron's Compton wavelength over 2 π [NIST2010].)
- Magnetic flux and related quantities have a factor of angle in the denominator.
- The weber (Wb) is defined as V/Hz or V s/cyc (not V s).
- The von Klitzing constant
and the characteristic impedance of vacuum
are expressed as:
- RK ≈ 25813 Ω/cyc
- Z0 ≈ 376.7 Ω/cyc
- G0 ≈ 7.748×10-5 S cyc
- The fine-structure constant (kA c/RK) is therefore an angle:
- α/rad ≈ 7.297×10-3 (The right side is the traditional expression [NIST2010].)
- A factor of cyc must be added to the denominator of the traditional symbolic expression of the atomic unit of magnetic flux density.
- The
magnetic constant
has a factor of squared angle in the denominator:
- μ0 = 4π×10-7 H/(m cyc2) = 2kA/(cyc rad), where 2kA is the factor in Ampère's force law.
- L = μ0 θ2 A/ℓ.
- The auxiliary magnetic field (H), magnetic moment, and related quantities have a factor of angle in the
numerator.
- The oersted is expressed as:
- Oe = (103/4π) AT/m, where AT is the ampere-turn (AT = A cyc)
- A factor of cyc must be added to the traditional symbolic expression of the atomic unit of magnetic dipole moment.
- The oersted is expressed as:
- It follows that magnetizability, the ratio between magnetic moment and magnetic flux density, has squared angle in the numerator. A factor of cyc2 must be added to the traditional symbolic expression of the atomic unit of magnetizability.
- The henry (H) is defined as V s/A (not Wb/A). Although it related to magnetics, the henry is applied to electrical circuits, so it does not include any factors of angle.
- Traditional trigonometric functions accept angles in radians. Angles should be divided by
the radian (
U.rad) before passing to these functions (e.g.,sin(theta/U.rad)) and the result of their inverses should be multiplied by the radian (e.g.,asin(x)*U.rad). - The first radiation constant has a factor of angle to the fourth power in the denominator:
- c1 cyc4 ≈ 3.742×10-16 W m2 (The right side is the traditional expression [NIST2010].)
The explicit inclusion of angle has several advantages. First, it avoids a conflict in the definition of SI units. BIPM defines the hertz as the reciprocal second (Hz = s-1), but states that "The SI unit of frequency is given as the hertz, implying the unit cycles per second" [BIPM2006]. Due to trigonometry (cyc = 2π rad), BIPM's definition of the radian as one (rad = 1) implies that the cycle is two pi (cyc = 2π) and the hertz is not cycles per second but rather cycles per second divided by two pi (Hz = cyc/(2π s)).
The second advantage is that the use of explicit angles avoids the potential confusion between energy and torque in SI [BIPM2006]. Torque is expressed as the cross product of force and radius. The cross product introduces a factor of rad-1, so the result is energy per angle, which is clearly distinct from energy. The angle cancels in the expression of rotational power—the product of torque and rotational velocity (angle per time).
Also, the inclusion of angle avoids the need to use different variables depending on the chosen unit of angle. For example, frequency is sometimes represented by a variable in hertz (e.g., ν) and other times by a variable in radians per second (e.g., ω). If angle is explicit, then one variable will suffice (f = ν cyc/s = ω rad/s). As alluded to earlier, there is no need for the reduced Planck constant (i.e., h ≈ 6.6261×10-34 J/Hz ≈ 1.0546×10-34 J s/rad).
Fourth, if angle is counted as a dimension, the fine-structure constant is not dimensionless. This addresses the conundrum of a dimensionless constant that cannot be mathematically derived.
Another possible advantage appears if we define the size of a circle (S) as length per angle—radius per radian (r/rad) or, equivalently, circumference per cycle. This simplifies the representation of some common equations because explicit factors of 2π are eliminated. The circumference of one circle is S cyc. The surface area of one sphere is S2 sp, where sp = 4π sr is the spat, a unit of solid angle.3 Coulomb's force law can be expressed using the electric constant (ε0) without a explicit factor of 1/4π:
F = (1/ε0) q1q2/(S2 sp)where S2 sp is the surface area of the sphere centered at one charge and touching the other. Since S = r/rad, sp = 4π sr, and sr = rad2, this is
F = kC q1q2/r2where kC is the electric constant, which is 1/(4π ε0) as expected. Thus, there may not be a need to maintain the electric force constant as a separate variable from the electric constant.
1. The Modelica specification recommends that floating point numbers be represented in at least IEEE double precision, which covers magnitudes from ∼2.225×10-308 to ∼1.798×10308 [Modelica2010, p. 13].↵
2. The common argument that angle is dimensionless ("angle is a ratio of lengths") is flawed. Angle is the not the ratio of arclength to radius. Rather, angle in radians is the ratio of arclength to radius (θ/rad = L/r). It is not necessary that angle (θ) is dimensionless, only that angle and radian (rad) have the same dimension. In QCalc, that dimension is called angle. The common (and correct) understanding is that the radian (rad) is a unit of angle, just as the metre (m) is a unit of length. The dimensionality of the radian is angle, just as the dimensionality of the metre is length.↵
3. The spat (sp) is the solid angle of one sphere, just as the cycle (cyc) is the angle of one circle. For mnemonic purposes, sp can be considered as the abbreviation for sphere as well as spat.↵
Licensed by the Hawaii Natural Energy Institute under the Modelica License 2
Copyright © 2009–2014,
Hawaii Natural Energy Institute and
Georgia Tech Research Corporation.
This Modelica package is free software and the use is completely at your own risk; it can be redistributed and/or modified under the terms of the Modelica License 2. For license conditions (including the disclaimer of warranty) see QCalc.UsersGuide.License or visit http://www.modelica.org/licenses/ModelicaLicense2.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Q.Number | pi | 2*acos(0) | <html><a href="https://en.wikipedia.org/wiki/Pi">pi</a> (<i>π</i>)</html> |
| Bases.SIKmol | base | ||
| Q.Wavenumber | R_inf | base.R_inf | <html><a href="http://en.wikipedia.org/wiki/Rydberg_constant">Rydberg constant</a> (<i>R</i><sub>∞</sub>)</html> |
| Q.Velocity | c | base.c | <html><a href="http://en.wikipedia.org/wiki/Speed_of_light">speed of light</a></html> |
| Q.MagneticFluxReciprocal | k_J | base.k_J | <html><a href="http://en.wikipedia.org/wiki/Josephson_constant">Josephson constant</a> (<i>k</i><sub>J</sub>)</html> |
| Q.MagneticFluxSpecific | R_K | base.R_K | <html><a href="http://en.wikipedia.org/wiki/Von_Klitzing_constant">von Klitzing constant</a> (<i>R</i><sub>K</sub>)</html> |
| Q.Number | k_F | base.k_F | <html><a href="http://en.wikipedia.org/wiki/Faraday_constant">Faraday constant</a> (<i>k</i><sub>F</sub>)</html> |
| Q.Number | R | base.R | <html><a href="http://en.wikipedia.org/wiki/Gas_constant">gas constant</a></html> |
| Q.LengthSpecificMassSpecific | k_Aprime | base.k_Aprime | <html>modified Ampere constant (<i>k</i><sub>A</sub> cyc/α)</html> |
| Q.MagneticFlux | Phi_0 | 1/k_J | <html><a href="http://en.wikipedia.org/wiki/Magnetic_flux_quantum">magnetic flux quantum</a> (Φ<sub>0</sub>)</html> |
| Q.Conductance | G_0 | 2/R_K | <html><a href="http://en.wikipedia.org/wiki/Conductance_quantum">conductance quantum</a> (<i>G</i><sub>0</sub>)</html> |
| Q.Amount | e | G_0*Phi_0 | <html><a href="http://en.wikipedia.org/wiki/Elementary_charge">elementary charge</a></html> |
| Q.MomentumRotational | h | 2*e*Phi_0 | <html><a href="http://en.wikipedia.org/wiki/Planck_constant">Planck constant</a></html> |
| Q.AmountReciprocal | N_A | k_F/e | <html><a href="http://en.wikipedia.org/wiki/Avogadro_number">Avogadro constant</a> (<i>N</i><sub>A</sub>)</html> |
| Q.Amount | k_B | R/N_A | <html><a href="http://en.wikipedia.org/wiki/Boltzmann_constant">Boltzmann constant</a> (<i>k</i><sub>B</sub>)</html> |
| Q.Angle | cyc | k_Aprime*c/R_K | cycle |
| Q.PowerArea | c_1 | 2*pi*h*c^2/cyc^3 | <html><a href="http://physics.nist.gov/cgi-bin/cuu/Value?c11strc">first radiation constant</a> (<i>c</i><sub>1</sub>)</html> |
| Q.PotentialPerWavenumber | c_2 | h*c/k_B | <html><a href="http://physics.nist.gov/cgi-bin/cuu/Value?c22ndrc">second radiation constant</a> (<i>c</i><sub>2</sub>)</html> |
| Q.MagneticFluxReciprocal | c_3_f | 2.821439372122079*c/c_2 | <html><a href="http://en.wikipedia.org/wiki/Wien's_displacement_law">Wien frequency displacement constant</a> (<i>c</i><sub>3 <i>f</i></sub>)</html> |
| Q.PotentialPerWavenumber | c_3_lambda | c_2/4.965114231744276 | <html><a href="http://en.wikipedia.org/wiki/Wien's_displacement_law">Wien wavelength displacement constant</a> (<i>c</i><sub>3 λ</sub>)</html> |
| Q.PowerAreicPerPotential4 | sigma | c_1/15*(pi/c_2)^4 | <html><a href="http://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_constant">Stefan-Boltzmann constant</a> (σ)</html> |
| Q.Energy | Ry | h*c*R_inf | <html><a href="http://en.wikipedia.org/wiki/Rydberg_constant#Value_of_the_Rydberg_constant_and_Rydberg_unit_of_energy">Rydberg energy</a></html> |
| Q.Energy | Ha | 2*Ry | <html><a href="http://en.wikipedia.org/wiki/Hartree">Hartree energy</a></html> |
| Q.Temperature | T_H | Ha/k_B | <html>Hartree temperature (<i>T</i><sub>H</sub>)</html> |
| Q.Angle | rad | cyc/(2*pi) | <html><a href="http://en.wikipedia.org/wiki/Rad_(unit)">radian</a></html> |
| Q.Length | m | 10973731.568539*cyc/R_inf | <html><a href="http://en.wikipedia.org/wiki/Metre">metre</a></html> |
| Q.Time | s | 299792458*m/c | <html><a href="http://en.wikipedia.org/wiki/Second">second</a></html> |
| Q.MagneticFlux | Wb | 483597.870e9/k_J | <html><a href="http://en.wikipedia.org/wiki/Weber_(unit)">weber</a></html> |
| Q.Conductance | S | 25812.8074434/(R_K*cyc) | <html><a href="http://en.wikipedia.org/wiki/Siemens_(unit)">siemens</a></html> |
| Q.Amount | mol | 96485.3365*Wb*cyc*S/k_F | <html><a href="http://en.wikipedia.org/wiki/Mole_(unit)">mole</a></html> |
| Q.Temperature | K | 8.3144621*(Wb*cyc)^2*S/(s*mol*R) | <html><a href="http://en.wikipedia.org/wiki/Kelvin">kelvin</a></html> |
| Q.LuminousIntensity | cd | 1 | <html><a href="http://en.wikipedia.org/wiki/Candela">candela</a></html> |
| Q.Frequency | Hz | cyc/s | <html><a href="http://en.wikipedia.org/wiki/Hertz">hertz</a></html> |
| Q.Potential | V | Wb*Hz | <html><a href="http://en.wikipedia.org/wiki/Volt">volt</a></html> |
| Q.Current | A | V*S | <html><a href="http://en.wikipedia.org/wiki/Ampere">ampere</a></html> |
| Q.Amount | C | A*s | <html><a href="http://en.wikipedia.org/wiki/Coulomb">coulomb</a></html> |
| Q.Energy | J | V*C | <html><a href="http://en.wikipedia.org/wiki/Joule">joule</a></html> |
| Q.Velocity2 | Gy | (m/s)^2 | <html><a href="http://en.wikipedia.org/wiki/Gray_unit">gray</a></html> |
| Q.Mass | kg | J/Gy | <html><a href="http://en.wikipedia.org/wiki/Kilogram">kilogram</a></html> |
| Q.Mass | g | kg/Prefixes.k | <html><a href="http://en.wikipedia.org/wiki/Gram">gram</a></html> |
| Q.Angle2 | sr | rad^2 | <html><a href="http://en.wikipedia.org/wiki/Steradian">steradian</a></html> |
| Q.Illuminance | lm | cd*sr | <html><a href="http://en.wikipedia.org/wiki/Lumen_(unit)">lumen</a></html> |
| Q.Power | W | J/s | <html><a href="http://en.wikipedia.org/wiki/Watt">watt</a></html> |
| Q.Force | N | J/m | <html><a href="http://en.wikipedia.org/wiki/Newton_unit">newton</a></html> |
| Q.Pressure | Pa | N/m^2 | <html><a href="http://en.wikipedia.org/wiki/Pascal_(unit)">pascal</a></html> |
| Q.MagneticFluxAreic | T | Wb/m^2 | <html><a href="http://en.wikipedia.org/wiki/Tesla_(unit)">tesla</a></html> |
| Q.LuminousEmittance | lx | lm/m^2 | <html><a href="http://en.wikipedia.org/wiki/Lux">lux</a></html> |
| Q.Capacitance | F | s*S | <html><a href="http://en.wikipedia.org/wiki/Farad">farad</a></html> |
| Q.Resistance | ohm | 1/S | <html><html><a href="http://en.wikipedia.org/wiki/Ohm">ohm</a> (Ω)</html> |
| Q.Inductance | H | s/S | <html><a href="http://en.wikipedia.org/wiki/Henry_(unit)">henry</a></html> |
| Q.Current | kat | mol/s | <html><a href="http://en.wikipedia.org/wiki/Katal">katal</a></html> |
| Q.Velocity2 | Sv | Gy | <html><a href="http://en.wikipedia.org/wiki/Sievert">sievert</a></html> |
| Q.TimeReciprocal | Bq | 1/s | <html><a href="http://en.wikipedia.org/wiki/Becquerel">becquerel</a></html> |
| Interfaces.degC | degC | <html><a href="http://en.wikipedia.org/wiki/Celsius">degree Celsius</a> (°C)</html> | |
| Q.Time | min | 60*s | <html><a href="http://en.wikipedia.org/wiki/Minute">minute</a></html> |
| Q.Time | hr | 60*min | <html><a href="http://en.wikipedia.org/wiki/Hour">hour</a></html> |
| Q.Time | d | 24*hr | <html><a href="http://en.wikipedia.org/wiki/Day">day</a></html> |
| Q.Angle | deg | cyc/360 | <html><a href="http://en.wikipedia.org/wiki/Degree_(angle)">degree</a> (°)</html> |
| Q.Angle | arcmin | deg/60 | <html><a href="http://en.wikipedia.org/wiki/Arcminute">arcminute</a> (′)</html> |
| Q.Angle | arcsec | arcmin/60 | <html><a href="http://en.wikipedia.org/wiki/Arcsecond">arcsecond</a> (′′)</html> |
| Q.Area | ha | (Prefixes.h*m)^2 | <html><a href="http://en.wikipedia.org/wiki/Hectare">hectare</a></html> |
| Q.Volume | L | (Prefixes.d*m)^3 | <html><a href="http://en.wikipedia.org/wiki/Litre">litre</a> (L or l)</html> |
| Q.Mass | t | Prefixes.M*g | <html><a href="http://en.wikipedia.org/wiki/Tonne">tonne</a></html> |
| Q.Acceleration | g_0 | 9.80665*m/s^2 | <html><a href="http://en.wikipedia.org/wiki/Standard_gravity">standard gravity</a></html> |
| Q.Length | cm | Prefixes.c*m | <html><a href="http://en.wikipedia.org/wiki/Centimetre">centimetre</a></html> |
| Q.Volume | cc | cm^3 | <html><a href="http://en.wikipedia.org/wiki/Cubic_centimetre">cubic centimetre</a></html> |
| Q.PressureLineic | Hg | 13.5951*g*g_0/cc | <html>force per volume of <a href="http://en.wikipedia.org/wiki/Mercury_(element)">mercury</a> under <a href="http://en.wikipedia.org/wiki/Standard_gravity">standard gravity</a></html> |
| Q.Length | mm | Prefixes.m*m | <html><a href="https://en.wikipedia.org/wiki/Millimetre">millimetre</a></html> |
| Q.Pressure | mmHg | mm*Hg | <html><a href="http://en.wikipedia.org/wiki/Millimeter_of_mercury">millimetre of mercury</a></html> |
| Q.Pressure | kPa | Prefixes.k*Pa | kilopascal |
| Q.Pressure | bar | 100*kPa | <html><a href="http://en.wikipedia.org/wiki/Bar_(unit)">bar</a></html> |
| Q.Area | b | 100*(Prefixes.f*m)^2 | <html><a href="http://en.wikipedia.org/wiki/Barn_(unit)">barn</a></html> |
| Q.Length | angstrom | 1e-10*m | <html><html><a href="http://en.wikipedia.org/wiki/Angstrom">angstrom</a> (Å)</html> |
| Q.Length | nmi | 1852*m | <html><a href="http://en.wikipedia.org/wiki/Nautical_mile">nautical mile</a></html> |
| Q.Velocity | kn | nmi/hr | <html><a href="http://en.wikipedia.org/wiki/Knot_(unit)">knot</a></html> |
| Interfaces.Np | Np | <html><a href="http://en.wikipedia.org/wiki/Neper">neper</a> (in terms of amplitude ratio, not power ratio)</a></html> | |
| Interfaces.B | B | bel (in terms of power ratio, not amplitude ratio) | |
| Interfaces.dB | dB | <html><a href="http://en.wikipedia.org/wiki/Decibel">decibel</a> (in terms of power ratio, not amplitude ratio)</html> | |
| Q.Acceleration | Gal | cm/s^2 | <html><a href="http://en.wikipedia.org/wiki/Gal_(unit)">gal</a></html> |
| Q.Force | dyn | g*Gal | <html><a href="http://en.wikipedia.org/wiki/Dyne">dyne</a></html> |
| Q.Energy | erg | dyn*cm | <html><a href="http://en.wikipedia.org/wiki/Erg">erg</a></html> |
| Q.Pressure | Ba | dyn/cm^2 | <html><a href="http://en.wikipedia.org/wiki/Barye">barye</a></html> |
| Q.Viscosity | P | Ba*s | <html><a href="http://en.wikipedia.org/wiki/Poise">poise</a></html> |
| Q.Diffusivity | St | cm^2/s | <html><a href="http://en.wikipedia.org/wiki/Stokes_(unit)">stokes</a></html> |
| Q.Luminance | sb | cd/cm^2 | <html><a href="http://en.wikipedia.org/wiki/Stilb_(unit)">stilb</a></html> |
| Q.Illuminance | ph | sb*sr | <html><a href="http://en.wikipedia.org/wiki/Phot">phot</a></html> |
| Q.Current | abA | Prefixes.da*A | <html><a href="https://en.wikipedia.org/wiki/Abampere">abampere</a></html> |
| Q.Amount | abC | abA*s | <html><a href="https://en.wikipedia.org/wiki/Abcoulomb">abcoloumb</a></html> |
| Q.Potential | abV | erg/abC | <html><a href="https://en.wikipedia.org/wiki/Abvolt">abvolt</a></html> |
| Q.MagneticFlux | Mx | erg/(abA*cyc) | <html><a href="http://en.wikipedia.org/wiki/Maxwell_(unit)">maxwell</a></html> |
| Q.MagneticFluxAreic | Gs | Mx/cm^2 | <html><a href="http://en.wikipedia.org/wiki/Gauss_(unit)">gauss</a></html> |
| Q.MagneticFlux | pole | 4*pi*Mx | unit magnetic pole |
| Q.MagneticFieldAux | Oe | dyn/pole | <html><a href="http://en.wikipedia.org/wiki/Oersted">oersted</a></html> |
| Q.Capacitance | abF | abC/abV | <html><a href="https://en.wikipedia.org/wiki/Abfarad#CGS_units">abfarad</a></html> |
| Q.Resistance | abohm | s/abF | <html><a href="https://en.wikipedia.org/wiki/Abohm">abohm</a></html> |
| Q.Inductance | abH | abohm*s | <html><a href="http://en.wikipedia.org/wiki/Abhenry">abhenry</a></html> |
| Q.LengthSpecificMassSpecific | k_A | dyn/abA^2 | <html>Ampere constant (<i>k</i><sub>A</sub>)</html> |
| Q.PermittivityReciprocal | k_C | k_A*c^2 | <html><a href="https://en.wikipedia.org/wiki/Coulomb_constant">Coulomb constant</a> (<i>k</i><sub>C</sub>)</html> |
| Q.Permittivity | epsilon_0 | 1/(k_C*(if base.rational then 4*pi else 1)) | <html><a href="http://en.wikipedia.org/wiki/Vacuum_permittivity">electric constant</a> (ε<sub>0</sub>)</html> |
| Q.Permeability | mu_0 | 1/(epsilon_0*cyc^2*c^2) | <html><a href="http://en.wikipedia.org/wiki/Vacuum_permeability">magnetic constant</a> (μ<sub>0</sub>)</html> |
| Q.Resistance | Z_0 | 2*k_A*c/rad | <html><a href="http://en.wikipedia.org/wiki/Impedance_of_free_space">characteristic impedance of vacuum</a> (<i>Z</i><sub>0</sub>)</html> |
| Q.Angle | alpha | k_A*c/R_K | <html><a href="http://en.wikipedia.org/wiki/Fine_structure_constant">fine-structure constant</a> (α)</html> |
| Q.Length | a_0 | alpha/(2*R_inf) | <html><a href = https://en.wikipedia.org/wiki/Bohr_radius>Bohr radius</a> (<i>a</i><sub>0</sub>)</html> |
| Q.Wavelength | lambda_e | alpha*a_0/sr | <html>electron <a href="https://en.wikipedia.org/wiki/Compton_wavelength">Compton wavelength</a> (λ<sub>e</sub>)</html> |
| Q.WavelengthVelocity | kappa | lambda_e*c/2 | <html>quantum of circulation (κ)</html> |
| Q.MassSpecific | m_e | Phi_0/kappa | <html><a href="http://en.wikipedia.org/wiki/Electron_mass">specific electron rest mass</a> (<i>m</i><sub>e</sub>)</html> |
| Q.LengthSpecific | r_e | k_A/m_e | <html><a href="http://en.wikipedia.org/wiki/Classical_electron_radius">specific classical electron radius</a> (<i>r</i><sub>e</sub>)</html> |
| Q.MagneticDipoleMoment | mu_B | kappa*e*sp/2 | <html><a href="https://en.wikipedia.org/wiki/Bohr_magneton">Bohr magneton</a></html> |
| Q.Mass | M_e | m_e*e | <html>mass of an electron (<i>M</i><sub>e</sub>)</html> |
| Q.Time | t_H | a_0*sqrt(M_e/Ha) | <html>Hartree time (<i>t</i><sub>H</sub>)</html> |
| Q.Length | l_n | h*rad/(M_e*c) | <html>natural unit of length (<i>l</i><sub>n</sub>)</html> |
| Q.Time | t_n | l_n/c | <html>natural unit of time (<i>t</i><sub>n</sub>)</html> |
| Q.Time | y | 365.25*d | <html><a href="http://en.wikipedia.org/wiki/Julian_year_(astronomy)">Julian year</a></html> |
| Q.Length | ly | c*y | <html><a href="http://en.wikipedia.org/wiki/Light_year">light year</a></html> |
| Q.Length | au | 149597870700*m | <html><a href="http://en.wikipedia.org/wiki/Astronomical_unit">astronomical unit</a></html> |
| Q.Length | pc | au*648e3/pi | <html><a href="http://en.wikipedia.org/wiki/Parsec">parsec</a></html> |
| Q.Pressure | atm | 101325*Pa | <html><a href="http://en.wikipedia.org/wiki/Atmosphere_(unit)">atmosphere</a></html> |
| Q.Pressure | Torr | atm/760 | <html><a href="http://en.wikipedia.org/wiki/Torr">torr</a></html> |
| Q.Energy | Wh | W*h | <html><a href="http://en.wikipedia.org/wiki/Watt_hour">watt hour</a></html> |
| Q.Energy | eV | e*V | <html><a href="http://en.wikipedia.org/wiki/Electron_volt">electron volt</a></html> |
| Q.Angle2 | sp | 4*pi*sr | <html><a href="http://en.wikipedia.org/wiki/Spat_(unit)">spat</a></html> |
| Q.Frequency | rpm | cyc/min | <html><a href="http://en.wikipedia.org/wiki/Revolutions_per_minute">revolution per minute</a></html> |
| Q.Number | '%' | Prefixes.c | <html><a href="http://en.wikipedia.org/wiki/Percent">percent</a> (%)</html> |
| Q.MagnetomotiveForce | AT | A*cyc | <html><a href="http://en.wikipedia.org/wiki/Ampere-turn">ampere-turn</a></html> |
| Q.Area | D | Prefixes.c*dyn/atm | <html><a href="http://en.wikipedia.org/wiki/Darcy_(unit)">darcy</a></html> |
| Q.Mass | u | g/(N_A*mol) | <html><a href="https://en.wikipedia.org/wiki/Atomic_mass_unit">unified atomic mass unit</a></html> |
| Q.Concentration | M | mol/L | <html><a href="http://en.wikipedia.org/wiki/Molar_concentration#Units">molar</a></html> |
| Interfaces.kPag | kPag | kilopascal, gauge |
Contents
| Name | Description |
|---|---|
| Set up the units in Dymola | |
| Base constants for the unit system | |
| Examples | |
| Sets of base constants and units | |
| SI prefixes | |
| Partial classes |