Mathematical functions¶
The Quantity module also provides a set of mathematical functions that can be used with quantities:
Quantity.exp(Quantity.dimensionless(2.2))
Quantity.sin(Quantity.radian(3.14))
Quantity.fabs(Quantity.position(-1.2))
Quantity.ceil(Quantity.energy(12.25))
Below is the list of all mathematical functions applicable to quantities.
Mathematical functions for dimensionless SI units¶
- samson.DataModel.Quantity.exp(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the exponential of physical quantity q (for dimensionless physical quantities only)
- samson.DataModel.Quantity.log(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the logarithm of physical quantity q (for dimensionless physical quantities only)
- samson.DataModel.Quantity.sin(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the sin of physical quantity q (for dimensionless physical quantities only)
- samson.DataModel.Quantity.asin(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the asin of physical quantity q (for dimensionless physical quantities only)
- samson.DataModel.Quantity.cos(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the cos of physical quantity q (for dimensionless physical quantities only)
- samson.DataModel.Quantity.acos(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the acos of physical quantity q (for dimensionless physical quantities only)
- samson.DataModel.Quantity.tan(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the tan of physical quantity q (for dimensionless physical quantities only)
- samson.DataModel.Quantity.atan(q: samson.DataModel.Quantity.unitsSI) samson.DataModel.Quantity.unitsSI ¶
Returns the atan of physical quantity q (for dimensionless physical quantities only)
Mathematical functions for all unit systems¶
- samson.DataModel.Quantity.fabs(*args, **kwargs)¶
Overloaded function.
fabs(q: samson.DataModel.Quantity.unitsSI) -> samson.DataModel.Quantity.unitsSI
Returns the absolute value of physical quantity q
fabs(q: samson.DataModel.Quantity.unitsAU) -> samson.DataModel.Quantity.unitsAU
Returns the absolute value of physical quantity q
fabs(q: samson.DataModel.Quantity.unitsDalton) -> samson.DataModel.Quantity.unitsDalton
Returns the absolute value of physical quantity q
fabs(q: samson.DataModel.Quantity.unitsElectronvolt) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the absolute value of physical quantity q
fabs(q: samson.DataModel.Quantity.unitsKilocaloriePerMole) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the absolute value of physical quantity q
- samson.DataModel.Quantity.floor(*args, **kwargs)¶
Overloaded function.
floor(q: samson.DataModel.Quantity.unitsSI) -> samson.DataModel.Quantity.unitsSI
Returns the floor value of physical quantity q
floor(q: samson.DataModel.Quantity.unitsAU) -> samson.DataModel.Quantity.unitsAU
Returns the floor value of physical quantity q
floor(q: samson.DataModel.Quantity.unitsDalton) -> samson.DataModel.Quantity.unitsDalton
Returns the floor value of physical quantity q
floor(q: samson.DataModel.Quantity.unitsElectronvolt) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the floor value of physical quantity q
floor(q: samson.DataModel.Quantity.unitsKilocaloriePerMole) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the floor value of physical quantity q
- samson.DataModel.Quantity.ceil(*args, **kwargs)¶
Overloaded function.
ceil(q: samson.DataModel.Quantity.unitsSI) -> samson.DataModel.Quantity.unitsSI
Returns the ceil value of physical quantity q
ceil(q: samson.DataModel.Quantity.unitsAU) -> samson.DataModel.Quantity.unitsAU
Returns the ceil value of physical quantity q
ceil(q: samson.DataModel.Quantity.unitsDalton) -> samson.DataModel.Quantity.unitsDalton
Returns the ceil value of physical quantity q
ceil(q: samson.DataModel.Quantity.unitsElectronvolt) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the ceil value of physical quantity q
ceil(q: samson.DataModel.Quantity.unitsKilocaloriePerMole) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the ceil value of physical quantity q
- samson.DataModel.Quantity.round(*args, **kwargs)¶
Overloaded function.
round(q: samson.DataModel.Quantity.unitsSI) -> samson.DataModel.Quantity.unitsSI
Returns the round value of physical quantity q
round(q: samson.DataModel.Quantity.unitsAU) -> samson.DataModel.Quantity.unitsAU
Returns the round value of physical quantity q
round(q: samson.DataModel.Quantity.unitsDalton) -> samson.DataModel.Quantity.unitsDalton
Returns the round value of physical quantity q
round(q: samson.DataModel.Quantity.unitsElectronvolt) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the round value of physical quantity q
round(q: samson.DataModel.Quantity.unitsKilocaloriePerMole) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the round value of physical quantity q
- samson.DataModel.Quantity.trunc(*args, **kwargs)¶
Overloaded function.
trunc(q: samson.DataModel.Quantity.unitsSI) -> samson.DataModel.Quantity.unitsSI
Returns the trunc value of physical quantity q
trunc(q: samson.DataModel.Quantity.unitsAU) -> samson.DataModel.Quantity.unitsAU
Returns the trunc value of physical quantity q
trunc(q: samson.DataModel.Quantity.unitsDalton) -> samson.DataModel.Quantity.unitsDalton
Returns the trunc value of physical quantity q
trunc(q: samson.DataModel.Quantity.unitsElectronvolt) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the trunc value of physical quantity q
trunc(q: samson.DataModel.Quantity.unitsKilocaloriePerMole) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the trunc value of physical quantity q
- samson.DataModel.Quantity.sqrt(*args, **kwargs)¶
Overloaded function.
sqrt(q: samson.DataModel.Quantity.unitsSI) -> samson.DataModel.Quantity.unitsSI
Returns the square root of physical quantity q
sqrt(q: samson.DataModel.Quantity.unitsAU) -> samson.DataModel.Quantity.unitsAU
Returns the square root of physical quantity q
sqrt(q: samson.DataModel.Quantity.unitsDalton) -> samson.DataModel.Quantity.unitsDalton
Returns the square root of physical quantity q
sqrt(q: samson.DataModel.Quantity.unitsElectronvolt) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the square root of physical quantity q
sqrt(q: samson.DataModel.Quantity.unitsKilocaloriePerMole) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the square root of physical quantity q
- samson.DataModel.Quantity.pow(*args, **kwargs)¶
Overloaded function.
pow(q: samson.DataModel.Quantity.unitsSI, p: int) -> samson.DataModel.Quantity.unitsSI
Returns the p-th power of physical quantity q
pow(q: samson.DataModel.Quantity.unitsAU, p: int) -> samson.DataModel.Quantity.unitsAU
Returns the p-th power of physical quantity q
pow(q: samson.DataModel.Quantity.unitsDalton, p: int) -> samson.DataModel.Quantity.unitsDalton
Returns the p-th power of physical quantity q
pow(q: samson.DataModel.Quantity.unitsElectronvolt, p: int) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the p-th power of physical quantity q
pow(q: samson.DataModel.Quantity.unitsKilocaloriePerMole, p: int) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the p-th power of physical quantity q
- samson.DataModel.Quantity.root(*args, **kwargs)¶
Overloaded function.
root(q: samson.DataModel.Quantity.unitsSI, p: int) -> samson.DataModel.Quantity.unitsSI
Returns the p-th root of physical quantity q
root(q: samson.DataModel.Quantity.unitsAU, p: int) -> samson.DataModel.Quantity.unitsAU
Returns the p-th root of physical quantity q
root(q: samson.DataModel.Quantity.unitsDalton, p: int) -> samson.DataModel.Quantity.unitsDalton
Returns the p-th root of physical quantity q
root(q: samson.DataModel.Quantity.unitsElectronvolt, p: int) -> samson.DataModel.Quantity.unitsElectronvolt
Returns the p-th root of physical quantity q
root(q: samson.DataModel.Quantity.unitsKilocaloriePerMole, p: int) -> samson.DataModel.Quantity.unitsKilocaloriePerMole
Returns the p-th root of physical quantity q