Mondaic

salvus.material.attenuation.linear_solids

salvus.material.attenuation.linear_solids salvus material attenuation linear_solids

Utilities for Q models defined by standard linear solids.

Functions

get_bandwidth()

def get_bandwidth(
    frequency_in_hertz: float, n_linear_solids: int
) -> tuple[float, float]: ...

Obtain the suggested bandwidth for a given frequency and number of linear solids.

Following van Driel & Nissen-Meyer (2014), the minimum frequency is computed at an error threshold of 1% for the Q factor.

Note that this function,for historical/backward-compatibility reasons, returns an upper frequency bound of f_\\max = 2 \\cdot \texttt{frequency_in_hertz}.

Parameters
  • frequency_in_hertz float — Reference frequency, for instance, the maximum resolved frequency of a mesh.
  • n_linear_solids int — Number of linear solids.
Returns tuple[float, float] — (f_min, f_max) in Hz.

lsqr_fit_q_factor_model()

def lsqr_fit_q_factor_model(
    min_frequency_in_hertz: float,
    max_frequency_in_hertz: float,
    n_linear_solids: int = 5,
    power_law_ref_frequency_in_hertz: float = 1.0,
    power_law_exponent: float = 0.0,
    linearized: bool = True,
    samples: int = 100,
    weighted_least_squares: bool = True,
) -> tuple[npt.NDArray, npt.NDArray]: ...

Invert for the parameters of a linear solid.

Parameters
  • min_frequency_in_hertz float — Lower bound of the frequency band.
  • max_frequency_in_hertz float — Upper bound of the frequency band.
  • n_linear_solids int — Number of standard linear solids (SLS).
  • power_law_ref_frequency_in_hertz float — Reference frequency in the power law approximation.
  • power_law_exponent float — Exponent in the power law approximation.
  • linearized bool — Enable/disable linearization in the SLS approximation, see eq. (21) in van Driel & Nissen-Meyer (2014).
  • samples int — Number of frequency samples used in the least-squares fit.
  • weighted_least_squares bool — Enable/disable frequency-dependent weights in the least-squares fit.
Returns tuple[npt.NDArray, npt.NDArray] — A tuple of two arrays for the sample frequencies w_j and coefficients y_j of the linear solid approximation.

q_factor_from_linear_solid()

def q_factor_from_linear_solid(
    frequency_in_hertz: float | npt.NDArray | np.floating,
    w: npt.NDArray,
    y: npt.NDArray,
    linearized: bool = True,
) -> npt.NDArray: ...

Compute a frequency-dependent Q using standard linear solids (SLS).

The approximation is based on van Driel & Nissen-Meyer (2014).

Parameters
  • frequency_in_hertz float | npt.NDArray | np.floating — Frequencies at which the Q factor is computed from the SLS.
  • w npt.NDArray — SLS collocation frequencies, c.f. w_j in eqs. (6) - (8).
  • y npt.NDArray — SLS collocation coefficients, c.f. y_j in eqs. (6) - (8).
  • linearized bool — Enable/disable linearization in the SLS approximation, see eq. (21).
Returns npt.NDArray — The frequency-dependent Q factor.

q_factor_from_power_law()

def q_factor_from_power_law(
    frequency_in_hertz: T,
    reference_q_factor: float,
    reference_frequency_in_hertz: float,
    exponent: float,
) -> T: ...

Compute a frequency-dependent Q using a power-law approximation.

The frequency-dependence of the Q factor within a certain frequency band is commonly approximated by a power law, cf. eq. (11) in Fichtner & van Driel (2014).

Parameters
  • frequency_in_hertz T — Frequencies at which the Q factor is computed according to the power law.
  • reference_q_factor float — Reference Q factor.
  • reference_frequency_in_hertz float — Reference frequency
  • exponent float — The exponent of the power law. A value of zero corresponds to the case of a constant, i.e., frequency-independent Q factor.
Returns T — The frequency-dependent Q factor.