hertzforge.core.correlate¶
correlate
¶
Test-analysis correlation: FEM shapes sampled at the test's DOFs.
A finite element model has a dense mesh with three or more DOFs per
node; the test measured a smaller set of directions at its own nodes.
Comparing the two starts by projecting the model onto the test: each
test node is matched to its nearest FEM node, the FEM displacement
there (already in global coordinates, from deform) is taken, and its
dot product with the test DOF's global direction is the projected
value. That handles uniaxial measurements and local coordinate systems
in one step. The result is an ordinary ShapeSet at the test's DOFs, so
cross-MAC, overlay animation and reports work on it unchanged.
Both geometries must already be in the same frame; this module does not align them.
References
The projection here is ordinary; these are where the comparison it feeds is set out.
- Allemang, R. J., & Brown, D. L. (1982). "A Correlation Coefficient for Modal Vector Analysis." Proceedings of the 1st International Modal Analysis Conference (IMAC). The Modal Assurance Criterion.
- Allemang, R. J. (2003). "The Modal Assurance Criterion - Twenty Years of Use and Abuse." Sound and Vibration. What the number does and does not say, including why a high MAC between a model and a test is not by itself agreement.
- Ewins, D. J. (2000). Modal Testing: Theory, Practice and Application, 2nd ed. Research Studies Press. Comparing a model with a test, and reducing one to the other's degrees of freedom.
Classes:
| Name | Description |
|---|---|
NoNodeMatched |
No test node has a model node within the match tolerance. |
Functions:
| Name | Description |
|---|---|
partial_nodes |
How many of a shape set's nodes it holds in fewer than three |
projection_order |
Which of two shape sets on two geometries is projected onto the |
si_points |
Each node's place in the global frame, [N, 3] in the geometry's node order: in |
match_distance |
How far a test node's nearest FEM node may be when |
project_shapes |
|
expand_shapes |
|
Classes¶
NoNodeMatched
¶
Bases: ValueError
No test node has a model node within the match tolerance. report says how far
off they are: matched (0), total, worst (the nearest pair's distance),
limit, dropped (none named), pairs (none) and unmatched (every test node's
id), as project_shapes reports a projection that did match.
Functions:¶
partial_nodes
¶
partial_nodes(shapes: ShapeSet) -> int
How many of a shape set's nodes it holds in fewer than three translation directions: the nodes a uni-axial or a bi-axial sensor measured. A rotation, and a DOF at no node (a modal coordinate), is not counted.
projection_order
¶
Which of two shape sets on two geometries is projected onto the other's DOFs before they are compared: (whether it is the first that is projected, why).
A projection samples one set's whole motion at the other's DOFs, so the set projected has to have that whole motion to give. A node measured along one axis does not: projected onto three directions, what it did not measure is taken as no motion at all, and the other set's motion there counts against the match. On a plate with twelve uni-axial nodes of twenty-eight, two modes that match at 1.000 and 0.983 the right way read 0.448 and 0.264 the wrong way (Brandon, 2026-11-16).
So the set with nodes measured in fewer than three directions
(partial_nodes) is the one projected onto. When neither has any,
or both have, the set with more DOFs is projected onto the one with
fewer (the second onto the first when they have as many); with
partial nodes in both, neither way is exact, and the reason says so.
si_points
¶
si_points(geometry: Geometry) -> ndarray
Each node's place in the global frame, [N, 3] in the geometry's node order: in
meters when its units are defined, in its own units otherwise. Where project_shapes
measures how far apart two geometries' nodes are.
match_distance
¶
How far a test node's nearest FEM node may be when project_shapes is given no
distance: tolerance of the test geometry's extent (the largest distance of a test
node from the nodes' mean position), plus half the FEM geometry's thickest plate,
because sensors are on surfaces and plate nodes are on mid-surfaces. In meters when
the geometries' units are defined, in the model's own units otherwise.
project_shapes
¶
project_shapes(fem_shapes: ShapeSet, fem_geometry: Geometry, test_shapes: ShapeSet, test_geometry: Geometry, tolerance: float = 0.02, *, distance: float | None = None) -> tuple[ShapeSet, dict[str, Any]]
fem_shapes reduced to the DOFs of test_shapes.
A test node whose nearest FEM node is further than distance away
is not matched, and its DOFs are dropped from the result rather
than estimated. distance is in meters when the geometries' units
are defined, in the model's own units otherwise. Without one, the
limit is match_distance's: tolerance of the test geometry's
extent, plus half the FEM geometry's thickest plate.
Returns (shape_set, report): the projected ShapeSet and a dict with 'matched' and 'total' test node counts, the 'worst' matched distance and the 'limit' (both in meters when the units are defined), 'dropped', the test DOFs that could not be projected (those that are not translations on the test geometry, and those at unmatched nodes), 'pairs', each matched test node with the FEM node it was matched to as (test node id, FEM node id) in the test geometry's node order, and 'unmatched', the ids of the test nodes with no FEM node within the limit.
Raises ValueError when only one geometry has units defined, when
distance is not above zero, when either has no nodes, when none
of the test DOFs are translations on the test geometry, or when no
test node is matched.
expand_shapes
¶
expand_shapes(test_shapes: ShapeSet, test_geometry: Geometry, fem_shapes: ShapeSet, fem_geometry: Geometry, *, basis: Any = None, tolerance: float = 0.02, distance: float | None = None) -> tuple[ShapeSet, dict[str, Any]]
test_shapes expanded to every DOF of fem_shapes through the model's modes
(SEREP). The model's modes are reduced to the test DOFs (project_shapes, nearest
node within the distance and each sensor's direction), each test mode is fitted at
those DOFs as a combination of them by least squares, psi_a = Q phi_a, and the
combination is taken at every model DOF, psi = Q phi. A test mode that lies in the
span of the modes used is recovered exactly; one that does not is the nearest
combination, and its residual says how far off the fit is at the test DOFs.
basis are the model modes the fit is built on, indices into its modes; left out,
every one. There may be no more of them than test DOFs matched: with more, the fit
is not unique.
Returns (shape_set, report): the expanded set, the test's frequencies and damping
at the model's DOFs, and project_shapes' report with 'modes' (the model modes used),
'condition' (of their reduced shapes, the larger the less the test DOFs tell them
apart) and 'residual' (each test mode's misfit at the test DOFs over its size).
Raises ValueError as project_shapes, when a mode named is not the model's, when no
mode is named, or when more modes are named than test DOFs matched.