Skip to content

hertzforge.core.modal_test

modal_test

A modal test's measurements on the analysis side: the fixed-reference form of a roving-excitation test, the damping an exponential window adds, and the frames of a test estimated again.

The fixed-reference form. A modal fit needs every response against every reference (core.modal_fit). A roving hammer test measures the other way round: one or a few fixed responses, each against a force at every point the hammer visits. fixed_reference turns such a set round by reciprocity: the record of the motion at j for a force at k becomes the record of the motion at k for a force at j, the same values, so the fixed DOF is the reference and the hammered points are the responses. That is valid when

  • every record is a translational motion (acceleration, velocity or displacement) per force, so the turned record is the same quantity pair: a motion along the force's line per a force along the motion's line;
  • both DOFs of every record name a direction, since the turned record measures along the force's direction;
  • the structure is linear and reciprocal: its mass, stiffness and damping matrices are symmetric, which a passive structure's are and a spinning, actively controlled or aeroelastically loaded one's need not be. Then the receptance (K - omega^2 M + i omega C)^-1 is the inverse of a symmetric matrix and is symmetric itself, and so are its velocity and acceleration forms. Nothing in the records can show this; it is the test's assumption, and each turned record says it was turned.

Anything else is refused by name (fixed_reference_refusal). Each turned record's comment begins TRANSPOSED and names what it was measured as, so the form travels with the object through a save.

The exponential window's damping. A response windowed by exp(-t / tau) decays faster by 1 / tau: each mode's pole moves left by exactly 1 / tau, so a fit of the windowed FRF reads a decay rate of zeta omega_n + 1 / tau and a damping ratio high by 1 / (tau omega_n) to first order (window_damping). The first-order correction holds for light damping, and is badly off when the damping is very small and poorly estimated; capturing more of the decay is better than correcting. less_window_damping takes the shift back out exactly, keeping the damped frequency, and note_window_damping writes it beside each mode of a published fit whose FRF carries the window (frf_tau), leaving the fitted values as the fit made them.

Estimating again. reprocess estimates a measurement's FRFs and coherence again from its frames, with the windows, block and frames chosen, by the analysis core's own estimators (TimeHistory.compute_frfs, TimeHistory.compute_multiple_coherence): the windows (core.impact_windows) are applied to each frame first, the force window to the references only from the frame's trigger, and each frame is then one average.

References
  1. Trethewey, M. W., & Cafeo, J. A. (1992). "Tutorial: Signal Processing Aspects of Structural Impact Testing." International Journal of Analytical and Experimental Modal Analysis 7(2), 129-149. The exponential window (equation 22) and the correction of the damping it adds, zeta_corrected = zeta - 1 / (tau omega_n) (equation 27), with its caution for very light damping.
  2. Fladung, W. A. (1997). "Windows Used for Impact Testing." Proceedings of IMAC XV. The force window, and the exponential window applied to the force and the response alike.

Functions:

Name Description
fixed_reference_refusal

Why fixed_reference cannot turn these records round, or '' when it

fixed_reference

A roving-excitation set turned round by reciprocity, so its fixed

is_transposed

Whether every record of obj was turned by reciprocity

roving_excitation

Whether a set was measured with the excitation roving: more

window_damping

The damping ratio an exponential window of time constant tau

less_window_damping

The natural frequency and damping ratio of a mode before an

tau_words

How a record's comment says the exponential window it was estimated

frf_tau

The exponential window's time constant, in seconds, an FRF was

window_note

The note a fitted mode carries for an exponential window: its time

window_corrected

Each mode's (frequency in Hz, damping ratio) less the exponential

note_window_damping

Note on each mode of a published fit the damping the FRF's

reprocess

A measurement's FRFs and coherence estimated again from its frames.

Classes

Functions:

fixed_reference_refusal

fixed_reference_refusal(obj: Any, records: Sequence[int] | None = None) -> str

Why fixed_reference cannot turn these records round, or '' when it can.

Parameters:

Name Type Description Default
obj Frf or Coherence

The measured set.

required
records sequence of int

The records to turn; every record when omitted.

None

Returns:

Type Description
str

The reason in words, or ''.

fixed_reference

fixed_reference(obj: Any, records: Sequence[int] | None = None) -> Any

A roving-excitation set turned round by reciprocity, so its fixed DOFs are the references and every response is against every reference.

Each record of the motion at j for a force at k becomes the record of the motion at k for a force at j, with the same values, quantity and units; its comment begins TRANSPOSED and names what it was measured as. The module's docstring says when this is valid; anything else is refused (fixed_reference_refusal).

Parameters:

Name Type Description Default
obj Frf or Coherence

The measured set, as the test measured it.

required
records sequence of int

The records to turn; every record when omitted.

None

Returns:

Type Description
Frf or Coherence

A new object of the same class; obj is not changed.

Raises:

Type Description
ValueError

With fixed_reference_refusal's reason.

is_transposed

is_transposed(obj: Any) -> bool

Whether every record of obj was turned by reciprocity (fixed_reference).

Parameters:

Name Type Description Default
obj DataArray

Any data object.

required

Returns:

Type Description
bool

roving_excitation

roving_excitation(frf: Frf) -> bool

Whether a set was measured with the excitation roving: more reference DOFs than response DOFs, the shape of a roving hammer test.

Parameters:

Name Type Description Default
frf Frf

The measured set.

required

Returns:

Type Description
bool

window_damping

window_damping(frequency: Any, tau: float) -> ndarray

The damping ratio an exponential window of time constant tau seconds adds to a mode at frequency hertz, to first order: 1 / (2 pi f_n tau).

Parameters:

Name Type Description Default
frequency float or array - like

Natural frequencies, Hz, above zero.

required
tau float

The window's time constant, s.

required

Returns:

Type Description
ndarray

Fractions of critical.

less_window_damping

less_window_damping(frequency: Any, damping: Any, tau: float) -> tuple[ndarray, ndarray]

The natural frequency and damping ratio of a mode before an exponential window of time constant tau seconds was applied, from those fitted to the windowed FRF.

The window moves each pole left by exactly 1 / tau and leaves its damped frequency where it was, so the decay rate is the fitted zeta' w_n' less 1 / tau and the natural frequency is that rate and the damped frequency together. To first order the damping is the fitted less window_damping. A mode whose fitted decay is no more than the window's own reads NaN: the window accounts for all of it, so its own damping is not known.

Parameters:

Name Type Description Default
frequency float or array - like

Fitted natural frequencies, Hz.

required
damping float or array - like

Fitted damping ratios, fractions of critical.

required
tau float

The window's time constant, s, above zero.

required

Returns:

Type Description
(ndarray, ndarray)

Natural frequencies (Hz) and damping ratios.

Raises:

Type Description
ValueError

For a time constant not above zero.

tau_words

tau_words(tau: float) -> str

How a record's comment says the exponential window it was estimated with, which frf_tau reads back: 'exponential window on every channel, tau 0.5 s'.

Parameters:

Name Type Description Default
tau float

The time constant, s.

required

Returns:

Type Description
str

frf_tau

frf_tau(frf: Any) -> float | None

The exponential window's time constant, in seconds, an FRF was estimated with, or None when it was not: from its records' comments (tau_words), which survive a save, when every record names the same time constant.

Parameters:

Name Type Description Default
frf DataArray

An FRF, or any object with comments.

required

Returns:

Type Description
float or None

window_note

window_note(frequency: float, damping: float, tau: float) -> str

The note a fitted mode carries for an exponential window: its time constant, the damping it added, and the mode less it.

Parameters:

Name Type Description Default
frequency float

The fitted natural frequency, Hz.

required
damping float

The fitted damping ratio.

required
tau float

The window's time constant, s.

required

Returns:

Type Description
str

window_corrected

window_corrected(shapes: Any) -> list[tuple[float, float] | None]

Each mode's (frequency in Hz, damping ratio) less the exponential window, read from the note note_window_damping wrote, or None for a mode with no such note.

Parameters:

Name Type Description Default
shapes ShapeSet

A published fit.

required

Returns:

Type Description
list of (float, float) or None

note_window_damping

note_window_damping(shapes: Any, frf: Any) -> Any

Note on each mode of a published fit the damping the FRF's exponential window added, and the mode less it (window_note), in the mode's comment; the fitted frequency and damping are left as the fit made them, so the set still synthesizes the FRF it was fitted to and Edit Fit restores the same fit. A comment's other text is kept; a note from an earlier publish is replaced. A set fitted to an FRF with no exponential window is returned unchanged.

Parameters:

Name Type Description Default
shapes ShapeSet

The fit's shape set, changed in place.

required
frf Frf

The FRF it was fitted to.

required

Returns:

Type Description
ShapeSet

shapes.

reprocess

reprocess(history: TimeHistory, *, method: str = 'H1', force: float | None = None, exponential: float | None = None, block: int | None = None, captures: Sequence[int] | None = None, shaker_window: str | None = None) -> tuple[Frf, Any]

A measurement's FRFs and coherence estimated again from its frames.

history holds the measurement's frames, a record per channel per frame (a converted Modal Test run's measurement frames), timed from the trigger: the samples at negative times are the pre-trigger. Each frame is cut to its first block samples, windowed (the force window on the references from the trigger, the exponential window on every channel, or the shaker window on every channel; core.impact_windows), and is then one average of the core's own estimate (TimeHistory.compute_frfs and TimeHistory.compute_multiple_coherence, on the channels' roles). With one reference the coherence is the ordinary coherence (the multiple coherence of one reference is that) as a Coherence of each response against it; with several, a MultipleCoherence.

Parameters:

Name Type Description Default
history TimeHistory

The frames.

required
method str

'H1', 'H2' or 'Hv'.

'H1'
force float

The force window's width as a fraction of the block, counted after the trigger, on the references (impact_windows.force_width); none when omitted.

None
exponential float

The exponential window's value at the block's end, T = block / rate, on every channel (impact_windows.exponential_tau); none when omitted.

None
block int

Samples of each frame to use, from its first; the whole frame when omitted.

None
captures sequence of int

Which frames, by capture number from 0 (capture_indices); every frame when omitted.

None
shaker_window str

A window for every channel instead of the transient ones ('hann' for a random source); refused beside force or exponential.

None

Returns:

Type Description
(Frf, Coherence or MultipleCoherence)

Raises:

Type Description
ValueError

For a block longer than the frames or under two samples, or that ends before the trigger; no frames picked, a capture the history does not hold; a shaker window beside a transient one; a force window that is not one (impact_windows.force_window); a reference that holds one value through a frame once windowed (a dead channel, or a window that removed the pulse, named so); or anything the estimators refuse (too few frames for the references, a frame that is not finite).