Groups

class nodimo.groups.Group(*quantities: Quantity)[source]

Group of quantities.

Equivalent to a Collection, but without duplicate quantities.

Warns:
NodimoWarning

Removed duplicate quantities.

class nodimo.groups.HomogeneousGroup(*quantities: Quantity)[source]

Dimensionally homogeneous group of quantities.

Warns:
NodimoWarning

Removed dimensionally irrelevant quantities.

class nodimo.groups.ScalingGroup(*quantities: Quantity, id_number: int = 0)[source]

A Group of scaling quantities.

Raises:
ValueError

If the quantities are not dimensionally independent.

class nodimo.groups.IndependentGroup(*quantities: Quantity)[source]

Independent group of quantities.

A group is independent if any quantity in it cannot be obtained as the product of powers of the other quantities of the group.

In the context of this class, all quantities are considered derived, that is, all quantities are expressed as products of powers of the base quantities of the group. This allow us to remove derived quantities that are dependent on other derived quantities.

To find dependent derived quantities, they are defined in such a way that their dimensions use the names of the base quantities as the dimensions’ names and the exponents of the base quantities as the dimensions’ exponents. The resulting dimensional matrix and its rank will determine the independency status of the group.

Warns:
NodimoWarning

Removed dependent derived quantities.

Notes

  1. The terms ‘dependent’ and ‘independent’ employed here have nothing to do with the quantity attribute is_dependent used to build relations.

  2. The base quantities are not necessarily the quantities of the group.

class nodimo.groups.DimensionalGroup(*quantities: Quantity, **dimensions: Number)[source]

Dimensional group of derived quantities.

This class creates a group of derived quantities from a homogeneous and independent group of provided quantities. The derived quantities are built as products of powers of the original quantities in a way that all derived quantities contain the same requested dimension.

To achieve this, one must provide quantities with scaling property, in a number that matches the rank of the original group. The scaling quantities work as tranformation parameters that, combined with the nonscaling quantities, produce derived quantities with the demanded dimension. The ensuing number of derived quantities is always lower or equal to the number of original quantities.

Parameters:
*quantitiesQuantity

Quantities to be transformed.

**dimensionsNumber

Aimed dimensions for the group given as keyword arguments. Dimensions that are not given are considered null.

Raises:
ValueError

If the group does not have the necessary number of dimensionally independent scaling quantities.

Warns:
NodimoWarning

Dimensions that are treated as independent.

References

[1]

Thomas Szirtes, Applied Dimensional Analysis and Modeling (Butterworth-Heinemann, 2007), p. 133.