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()
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}.
frequency_in_hertzfloat — Reference frequency, for instance, the maximum resolved frequency of a mesh.n_linear_solidsint — Number of linear solids.
lsqr_fit_q_factor_model()
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.
min_frequency_in_hertzfloat — Lower bound of the frequency band.max_frequency_in_hertzfloat — Upper bound of the frequency band.n_linear_solidsint — Number of standard linear solids (SLS).power_law_ref_frequency_in_hertzfloat — Reference frequency in the power law approximation.power_law_exponentfloat — Exponent in the power law approximation.linearizedbool — Enable/disable linearization in the SLS approximation, see eq. (21) in van Driel & Nissen-Meyer (2014).samplesint — Number of frequency samples used in the least-squares fit.weighted_least_squaresbool — Enable/disable frequency-dependent weights in the least-squares fit.
q_factor_from_linear_solid()
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).
frequency_in_hertzfloat | npt.NDArray | np.floating — Frequencies at which the Q factor is computed from the SLS.wnpt.NDArray — SLS collocation frequencies, c.f. w_j in eqs. (6) - (8).ynpt.NDArray — SLS collocation coefficients, c.f. y_j in eqs. (6) - (8).linearizedbool — Enable/disable linearization in the SLS approximation, see eq. (21).
q_factor_from_power_law()
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).
frequency_in_hertzT — Frequencies at which the Q factor is computed according to the power law.reference_q_factorfloat — Reference Q factor.reference_frequency_in_hertzfloat — Reference frequencyexponentfloat — The exponent of the power law. A value of zero corresponds to the case of a constant, i.e., frequency-independent Q factor.