SI - International System of Units¶
The domain ``SI`` (abbrev. also ``SI``) implements SI Units. The standard reference for this topic is: Bureau International des Poids et Mesures BIPM
The recommended practical system of units of measurement is the International System of Units (Système International d’Unités, with the international abbreviation SI). The SI is defined by the SI Brochure, which is published by the BIPM.
[De] Constructors¶
Base units¶
%m : Integer -> %
%kg : Integer -> %
%s : Integer -> %
%A : Integer -> %
%K : Integer -> %
%mol : Integer -> %
%cd : Integer -> %
Compound construction/deconstructor
mksi: List(Integer) -> %
si2l: % -> List(Integer)
Derived units¶
SI_derived : String -> %
To each function there is an example below.
In order to use the library we have to load it:
)lib SI
SIunit is now explicitly exposed in frame initial
SIunit will be automatically loaded when needed from
/home/kfp/Development/physqty/Untitled Folder/SI.NRLIB/SI
Seven Base Units¶
Length (meter)¶
The metre is the length of the path travelled by light in vacuum during
a time interval of 1/299 792 458
of a second.
Symbol: m
%m(1)
Warning: HyperTeX macro table not found
1
m
Type: SIunit
Mass (kilogram)¶
The kilogram is the unit of mass; it is equal to the mass of the international prototype of the kilogram.
Symbol: kg
%kg(1)
1
kg
Type: SIunit
Time (second)¶
The second is the duration of 9 192 631 770
periods of the radiation
corresponding to the transition between the two hyperfine levels of the
ground state of the caesium 133
atom.
Symbol: s
%s(1)
1
s
Type: SIunit
Electric current (ampere)¶
The ampere is that constant current which, if maintained in two straight parallel conductors of infinite length, of negligible circular cross-section, and placed 1 m apart in vacuum, would produce between these conductors a force equal to 2 x 10–7 newton per metre of length.
Symbol: A
%A(1)
1
A
Type: SIunit
Thermodynamic temperature (kelvin)¶
The kelvin, unit of thermodynamic temperature, is the fraction 1/273.16 of the thermodynamic temperature of the triple point of water.
Symbol: K
%K(1)
1
K
Type: SIunit
Amount of substance (mol)¶
The mole is the amount of substance of a system which contains as many elementary entities as there are atoms in 0.012 kilogram of carbon 12.
When the mole is used, the elementary entities must be specified and may be atoms, molecules, ions, electrons, other particles, or specified groups of such particles.
Symbol: mol
%mol(1)
1
mol
Type: SIunit
Luminous intensity (candela)¶
The candela is the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540 x \(10^{12}\) hertz and that has a radiant intensity in that direction of 1/683 watt per steradian.
Symbol: cd
%cd(1)
1
cd
Type: SIunit
Examples¶
-- Volume (cubic meter)
%m(3)
3
m
Type: SIunit
-- Force (newton)
F:=%kg(1)*%m(1)*%s(-2)
1 1 - 2
m kg s
Type: SIunit
-- Force again, i.e. input order does not matter
-- and %s(-2) is equivalent to divide by %s(2).
%kg(1)/%s(2)*%m(1)
1 1 - 2
m kg s
Type: SIunit
Note
the output ordering is fixed: m kg s A K mol cd. This is also the order of arguments for the compound constructor **`mksi`**.
mksi¶
The mksi
(make SI) constructor creates a SI unit from a list of
exponents:
mksi [1,1,-2,0,0,0,0]
1 1 - 2
m kg s
Type: SIunit
-- Lets make the unit for pressure = force/area
p:=mksi [-1,1,-2,0,0,0,0]
- 1 1 - 2
m kg s
Type: SIunit
-- Let's check:
F/%m(2)
- 1 1 - 2
m kg s
Type: SIunit
mksi [1,1,1,1,1,1,1]
1 1 1 1 1 1 1
m kg s A K mol cd
Type: SIunit
-- the "one" unit
mksi [0,0,0,0,0,0,0]
Type: SIunit
si2l¶
The si2l
function converts a SI unit to a list of its exponents,
i.e. it is the reverse function of mksi
:
si2l F
[1,1,- 2,0,0,0,0]
Type: List(Integer)
si2l p
[- 1,1,- 2,0,0,0,0]
Type: List(Integer)
si2l %cd(6)
[0,0,0,0,0,0,6]
Type: List(Integer)
%A(3) * %K(8)
3 8
A K
Type: SIunit
si2l %
[0,0,0,3,8,0,0]
Type: List(Integer)
Derived Units¶
The derived SI units are built in for convenience. The lookup function
is SI_derived
and expects as argument the name of the derived
unit. Note that those and their nomenclature are clearly defined by
BIPM:
SIderived(s:String):% ==
s = "hertz" => %s(-1)
s = "newton" => %kg(1)*%m(1)*%s(-2)
s = "pascal" => %kg(1)*%m(-1)*%s(-2)
s = "joule" => %kg(1)*%m(2)*%s(-2)
s = "watt" => %kg(1)*%m(2)*%s(-3)
s = "coulomb" => %s(1)*%A(1)
s = "volt" => %kg(1)*%m(2)*%s(-3)*%A(-1)
s = "farad" => %kg(-1)*%m(-2)*%s(4)*%A(2)
s = "ohm" => %kg(1)*%m(2)*%s(-3)*%A(2)
s = "siemens" => %kg(-1)*%m(-2)*%s(3)*%A(2)
s = "weber" => %kg(1)*%m(2)*%s(-2)*%A(-1)
s = "tesla" => %kg(1)*%s(-2)*%A(-1)
s = "henry" => %kg(1)*%m(2)*%s(-2)*%A(-2)
s = "lumen" => %cd(1)
s = "lux" => %m(-2)*%cd(1)
s = "becquerel" => %s(-1)
s = "gray" => %m(2)*%s(-2)
s = "sievert" => %m(2)*%s(-2)
s = "katal" => %s(-1)*%mol(1)
error "Expected string name of a derived SI unit."
SIderived "pascal"
- 1 1 - 2
m kg s
Type: SIunit
SIderived "tesla"
1 - 2 - 1
kg s A
Type: SIunit
(SIderived "gray") * (SIderived "becquerel")
2 - 3
m s
Type: SIunit
Energy := SIderived "joule"
Force := SIderived "newton"
2 1 - 2
m kg s
Type: SIunit
1 1 - 2
m kg s
Type: SIunit
(Energy/Force)$SI
1
m
Type: SIunit
-- indeed Energy = Force * %m(1)
Force*%m(1)
2 1 - 2
m kg s
Type: SIunit
Test for equality¶
Use $
if necessary:
(Energy = (Force * %m(1)))$SI
true
Type: Boolean
(p=Force/%m(2))$SI
true
Type: Boolean
-- Error (actually 'meter' is a base unit and not derived)
SIderived("meter")
>> Error detected within library code:
Expected string name of a derived SI unit.
error
Next see Buckingham :math:`Pi` Theorem