Model

class nodimo.model.Model(*quantities: Quantity, **dimensions: Number)[source]

(Non)dimensional model built from a given set of quantities.

This class builds relations from the resulting quantities of a group transformation (DimensionalGroup). Every relation is associated with a scaling group, which are built using the given scaling quantities.

Parameters:
*quantitiesQuantity

Quantities that constitute the model.

**dimensionsint

Aimed dimensions for the model given as keyword arguments.

Attributes:
quantitieslist[Quantity]

List with the quantities that constitute the model.

relationsdict[ScalingGroup, Relation]

Dictionary containing pairs of scaling groups and relations.

Methods

show(use_custom_css=True, use_unicode=True)

Prints scaling groups and respective (non)dimensional relations.

Raises:
ValueError

If the number of scaling quantities is lower than necessary.

Warns:
NodimoWarning

Dimensions that are treated as independent.

Examples

  • Free fall

Dimensions: mass M, length L and time T.

Quantities: height z, mass m, velocity v, gravitational acceleration g, time t, initial height z0 and initial velocity v0

Considering the scaling groups that can be formed with g, z0 and v0, the model for z is built and displayed as:

>>> from nodimo import Quantity, Model
>>> z = Quantity('z', L=1, dependent=True)
>>> m = Quantity('m', M=1)
>>> v = Quantity('v', L=1, T=-1)
>>> g = Quantity('g', L=1, T=-2, scaling=True)
>>> t = Quantity('t', T=1)
>>> z0 = Quantity('z0', L=1, scaling=True)
>>> v0 = Quantity('v0', L=1, T=-1, scaling=True)
>>> model = Model(z, m, v, g, t, z0, v0)
>>> model.show()