scallop dome pyformex logo

Previous topic

44. flavia

Next topic

46. isopar — Isoparametric transformations

[FSF Associate Member]

Valid XHTML 1.0 Transitional

45. inertia — inertia.py

Compute inertia related quantities of a Formex. This comprises: center of gravity, inertia tensor, principal axes

Currently, these functions work on arrays of nodes, not on Formices! Use func(F,f) to operate on a Formex F.

Classes defined in module inertia

Functions defined in module inertia

inertia.centroids(X)

Compute the centroids of the points of a set of elements.

X (nelems,nplex,3)

inertia.center(X, mass=None)

Compute the center of gravity of an array of points.

mass is an optional array of masses to be atributed to the points. The default is to attribute a mass=1 to all points.

If you also need the inertia tensor, it is more efficient to use the inertia() function.

inertia.inertia(X, mass=None)

Compute the inertia tensor of an array of points.

mass is an optional array of masses to be atributed to the points. The default is to attribute a mass=1 to all points.

The result is a tuple of two float arrays:

  • the center of gravity: shape (3,)
  • the inertia tensor: shape (6,) with the following values (in order): Ixx, Iyy, Izz, Ixy, Ixz, Iyz
inertia.principal(inertia, sort=False, right_handed=False)

Returns the principal values and axes of the inertia tensor.

If sort is True, they are sorted (maximum comes first). If right_handed is True, the axes define a right-handed coordinate system.