Mathematical functions#

The SBQuantity module also provides a set of mathematical functions that can be used with quantities:

SBQuantity.exp(SBQuantity.dimensionless(2.2))
SBQuantity.sin(SBQuantity.radian(3.14))

SBQuantity.fabs(SBQuantity.position(-1.2))
SBQuantity.ceil(SBQuantity.energy(12.25))

Below is the list of all mathematical functions applicable to quantities.

Mathematical functions for dimensionless SI units#

The mathematical operations listed below are only for dimensionless SI units.

samson.SBQuantity.exp(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the exponential of physical quantity q (for dimensionless physical quantities only)

samson.SBQuantity.log(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the logarithm of physical quantity q (for dimensionless physical quantities only)

samson.SBQuantity.sin(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the sin of physical quantity q (for dimensionless physical quantities only)

samson.SBQuantity.asin(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the asin of physical quantity q (for dimensionless physical quantities only)

samson.SBQuantity.cos(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the cos of physical quantity q (for dimensionless physical quantities only)

samson.SBQuantity.acos(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the acos of physical quantity q (for dimensionless physical quantities only)

samson.SBQuantity.tan(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the tan of physical quantity q (for dimensionless physical quantities only)

samson.SBQuantity.atan(q: samson.SBQuantity.unitsSI) samson.SBQuantity.unitsSI#

Returns the atan of physical quantity q (for dimensionless physical quantities only)

Mathematical functions for all unit systems#

The mathematical operations listed below are available for all units, including SI units.

samson.SBQuantity.fabs(*args, **kwargs)#

Overloaded function.

  1. fabs(q: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the absolute value of physical quantity q

  1. fabs(q: samson.SBQuantity.unitsAU) -> samson.SBQuantity.unitsAU

Returns the absolute value of physical quantity q

  1. fabs(q: samson.SBQuantity.unitsDalton) -> samson.SBQuantity.unitsDalton

Returns the absolute value of physical quantity q

  1. fabs(q: samson.SBQuantity.unitsElectronvolt) -> samson.SBQuantity.unitsElectronvolt

Returns the absolute value of physical quantity q

  1. fabs(q: samson.SBQuantity.unitsKilocaloriePerMole) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the absolute value of physical quantity q

samson.SBQuantity.floor(*args, **kwargs)#

Overloaded function.

  1. floor(q: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the floor value of physical quantity q

  1. floor(q: samson.SBQuantity.unitsAU) -> samson.SBQuantity.unitsAU

Returns the floor value of physical quantity q

  1. floor(q: samson.SBQuantity.unitsDalton) -> samson.SBQuantity.unitsDalton

Returns the floor value of physical quantity q

  1. floor(q: samson.SBQuantity.unitsElectronvolt) -> samson.SBQuantity.unitsElectronvolt

Returns the floor value of physical quantity q

  1. floor(q: samson.SBQuantity.unitsKilocaloriePerMole) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the floor value of physical quantity q

samson.SBQuantity.ceil(*args, **kwargs)#

Overloaded function.

  1. ceil(q: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the ceil value of physical quantity q

  1. ceil(q: samson.SBQuantity.unitsAU) -> samson.SBQuantity.unitsAU

Returns the ceil value of physical quantity q

  1. ceil(q: samson.SBQuantity.unitsDalton) -> samson.SBQuantity.unitsDalton

Returns the ceil value of physical quantity q

  1. ceil(q: samson.SBQuantity.unitsElectronvolt) -> samson.SBQuantity.unitsElectronvolt

Returns the ceil value of physical quantity q

  1. ceil(q: samson.SBQuantity.unitsKilocaloriePerMole) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the ceil value of physical quantity q

samson.SBQuantity.round(*args, **kwargs)#

Overloaded function.

  1. round(q: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the round value of physical quantity q

  1. round(q: samson.SBQuantity.unitsAU) -> samson.SBQuantity.unitsAU

Returns the round value of physical quantity q

  1. round(q: samson.SBQuantity.unitsDalton) -> samson.SBQuantity.unitsDalton

Returns the round value of physical quantity q

  1. round(q: samson.SBQuantity.unitsElectronvolt) -> samson.SBQuantity.unitsElectronvolt

Returns the round value of physical quantity q

  1. round(q: samson.SBQuantity.unitsKilocaloriePerMole) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the round value of physical quantity q

samson.SBQuantity.trunc(*args, **kwargs)#

Overloaded function.

  1. trunc(q: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the trunc value of physical quantity q

  1. trunc(q: samson.SBQuantity.unitsAU) -> samson.SBQuantity.unitsAU

Returns the trunc value of physical quantity q

  1. trunc(q: samson.SBQuantity.unitsDalton) -> samson.SBQuantity.unitsDalton

Returns the trunc value of physical quantity q

  1. trunc(q: samson.SBQuantity.unitsElectronvolt) -> samson.SBQuantity.unitsElectronvolt

Returns the trunc value of physical quantity q

  1. trunc(q: samson.SBQuantity.unitsKilocaloriePerMole) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the trunc value of physical quantity q

samson.SBQuantity.sqrt(*args, **kwargs)#

Overloaded function.

  1. sqrt(q: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the square root of physical quantity q

  1. sqrt(q: samson.SBQuantity.unitsAU) -> samson.SBQuantity.unitsAU

Returns the square root of physical quantity q

  1. sqrt(q: samson.SBQuantity.unitsDalton) -> samson.SBQuantity.unitsDalton

Returns the square root of physical quantity q

  1. sqrt(q: samson.SBQuantity.unitsElectronvolt) -> samson.SBQuantity.unitsElectronvolt

Returns the square root of physical quantity q

  1. sqrt(q: samson.SBQuantity.unitsKilocaloriePerMole) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the square root of physical quantity q

samson.SBQuantity.pow(*args, **kwargs)#

Overloaded function.

  1. pow(q: samson.SBQuantity.unitsSI, p: int) -> samson.SBQuantity.unitsSI

Returns the p-th power of physical quantity q

  1. pow(q: samson.SBQuantity.unitsAU, p: int) -> samson.SBQuantity.unitsAU

Returns the p-th power of physical quantity q

  1. pow(q: samson.SBQuantity.unitsDalton, p: int) -> samson.SBQuantity.unitsDalton

Returns the p-th power of physical quantity q

  1. pow(q: samson.SBQuantity.unitsElectronvolt, p: int) -> samson.SBQuantity.unitsElectronvolt

Returns the p-th power of physical quantity q

  1. pow(q: samson.SBQuantity.unitsKilocaloriePerMole, p: int) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the p-th power of physical quantity q

samson.SBQuantity.root(*args, **kwargs)#

Overloaded function.

  1. root(q: samson.SBQuantity.unitsSI, p: int) -> samson.SBQuantity.unitsSI

Returns the p-th root of physical quantity q

  1. root(q: samson.SBQuantity.unitsAU, p: int) -> samson.SBQuantity.unitsAU

Returns the p-th root of physical quantity q

  1. root(q: samson.SBQuantity.unitsDalton, p: int) -> samson.SBQuantity.unitsDalton

Returns the p-th root of physical quantity q

  1. root(q: samson.SBQuantity.unitsElectronvolt, p: int) -> samson.SBQuantity.unitsElectronvolt

Returns the p-th root of physical quantity q

  1. root(q: samson.SBQuantity.unitsKilocaloriePerMole, p: int) -> samson.SBQuantity.unitsKilocaloriePerMole

Returns the p-th root of physical quantity q

samson.SBQuantity.atan2(*args, **kwargs)#

Overloaded function.

  1. atan2(a: samson.SBQuantity.unitsSI, b: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the atan2 of physical quantities a and b

  1. atan2(a: samson.SBQuantity.unitsSI, b: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the atan2 of physical quantities a and b

  1. atan2(a: samson.SBQuantity.unitsSI, b: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the atan2 of physical quantities a and b

  1. atan2(a: samson.SBQuantity.unitsSI, b: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the atan2 of physical quantities a and b

  1. atan2(a: samson.SBQuantity.unitsSI, b: samson.SBQuantity.unitsSI) -> samson.SBQuantity.unitsSI

Returns the atan2 of physical quantities a and b