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, lengthLand timeT.Quantities: height
z, massm, velocityv, gravitational accelerationg, timet, initial heightz0and initial velocityv0Considering the scaling groups that can be formed with
g,z0andv0, themodelforzis 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()