Coding of units¶
Units are coded with one byte indicating the unit type, and one byte indicating the display type of the unit. The SI unit or standard unit always has display type 0. The display types for each unit type are provided on the following page. The unit types as defined currently are:
code | unit name | unit description | default (SI) unit | Display types |
---|---|---|---|---|
0 | Dimensionless | Unit without a dimension | Display types | |
1 | Acceleration | Acceleration | m/s2 | Display types |
2 | SolidAngle | Solid angle (steradian) | sr | Display types |
3 | Angle | Angle (relative) | rad | Display types |
4 | Direction | Angle (absolute) | rad | Display types |
5 | Area | Area | m2 | Display types |
6 | Density | Density based on mass and length | kg/m3 | Display types |
7 | ElectricalCharge | Electrical charge (Coulomb) | s.A | Display types |
8 | ElectricalCurrent | Electrical current (Ampere) | A | Display types |
9 | ElectricalPotential | Electrical potential (Volt) | kg.m2/s3.A | Display types |
10 | ElectricalResistance | Electrical resistance (Ohm) | kg.m2/s3.A2 | Display types |
11 | Energy | Energy (Joule) | kg.m2/s2 | Display types |
12 | FlowMass | Mass flow rate | kg/s | Display types |
13 | FlowVolume | Volume flow rate | m3/s | Display types |
14 | Force | Force (Newton) | kg.m/s2 | Display types |
15 | Frequency | Frequency (Hz) | 1/s | Display types |
16 | Length | Length (relative) | m | Display types |
17 | Position | Length (absolute) | m | Display types |
18 | LinearDensity | Linear density | 1/m | Display types |
19 | Mass | Mass | kg | Display types |
20 | Power | Power (Watt) | kg.m2/s3 | Display types |
21 | Pressure | Pressure (Pascal) | kg/m.s2 | Display types |
22 | Speed | Speed | m/s | Display types |
23 | Temperature | Temperature (relative) | K | Display types |
24 | AbsoluteTemperature | Temperature (absolute) | K | Display types |
25 | Duration | Time (relative) | s | Display types |
26 | Time | Time (absolute) | s | Display types |
27 | Torque | Torque (Newton-meter) | kg.m2/s2 | Display types |
28 | Volume | Volume | m3 | Display types |
29 | Absorbed dose | Absorbed dose (gray) | m2/s2 | Display types |
30 | Amount of substance | Amount of substance (mole) | mol | Display types |
31 | Catalytic activity | Catalytic activity (mole/s) | mol/s | Display types |
32 | Electrical capacitance | Electrical capacitance (farad) | s4.A2/kg.m2 | Display types |
33 | Electrical conductance | Electrical conductance (siemens) | s3.A2/kg.m2 | Display types |
34 | Electrical inductance | Electrical inductance (henry) | kg.m2/s2.A2 | Display types |
35 | Equivalent dose | Equivalent dose (sievert) | m2/s2 | Display types |
36 | Illuminance | Illuminance (lux) | sr.cd/m2 | Display types |
37 | Luminous flux | Luminous flux (lumen) | sr.cd | Display types |
38 | Luminous intensity | Luminous intensity (candela) | cd | Display types |
39 | Magnetic flux density | Magnetic flux density (tesla) | kg/s2.A | Display types |
40 | Magnetic flux | Magnetic flux (weber) | kg.m2/s2.A | Display types |
41 | Radioactivity | Radioactivity (becquerel) | 1/s | Display types |
42 | Angular acceleration | Change in angular velocity per second | rad/s2 | Display types |
43 | Angular velocity | Change in angular velocity per second | rad/s | Display types |
44 | Momentum | Linear momentum, translational momentum | kg.m/s | Display types |
Some of the unit types have a relative and an absolute variant. Relative scalars can be added to or subtracted from relative and absolute scalars; absolute scalars cannot be added, but can be subtracted, resulting in a relative scalar. As an example, one cannot add two times (3-1-2017, 5 o'clock + 3-1-2017, 3 o'clock = ??), but these values can be subtracted (3-1-2017, 5 o'clock – 3-1-2017, 3 o'clock = 2 hours). Absolute plus relative yields e.g., 3-1-2017, 17:00 + 2 hours = 3-1-2017, 19:00. Relative values can of course be added/subtracted: 2 hours + 30 minutes = 2.5 hours. See https://djunits.org for more information.