DimensionalMatrix

class nodimo.matrix.DimensionalMatrix(*quantities: Quantity)[source]

Dimensional matrix of a group of quantities.

A DimensionalMatrix is a matrix with one column for each quantity, one row for each dimension’s name, and every element represents the dimension’s exponent of a particular quantity. Labels at the top and at the right side are added to identify the quantities and the dimensions’ names, respectively.

Parameters:
*quantitiesQuantity

Quantities that constitute the dimensional matrix.

Attributes:
quantitieslist[Quantity]

List with the quantities used to build the dimensional matrix.

matrixImmutableDenseMatrix

Matrix containing only the dimensions’ exponents.

rankint

The rank of the dimensional matrix.

independent_rowstuple[int]

Indexes of the dimensional matrix independent rows.

Methods

set_dimensions_order(*dimensions_names)

Sets the dimensions’ names order.

show(use_custom_css=True, use_unicode=True)

Displays the dimensional matrix.

Warns:
NodimoWarning

Dimensions that are treated as independent.

Examples

>>> from nodimo import Quantity, DimensionalMatrix
>>> F = Quantity('F', M=1, L=1, T=-2)
>>> k = Quantity('k', M=1, T=-2)
>>> x = Quantity('x', L=1)
>>> dmatrix = DimensionalMatrix(F, k, x, k*x)
>>> dmatrix.show()
set_dimensions_order(*dimensions_names: str)[source]

Sets the dimensions column order.

Parameters:
*dimensions_namesstr

Dimensions’ names in the requested order.