specfem::attenuation::compute_tau_eps

template<int N_SLS, typename T>
Kokkos::View<type_real[N_SLS], Kokkos::LayoutRight, Kokkos::HostSpace> specfem::attenuation::compute_tau_eps(type_real Q, Kokkos::View<type_real[N_SLS], Kokkos::LayoutRight, Kokkos::HostSpace> tau_sigma, const specfem::utilities::Band<T> band)

Compute strain relaxation times via simplex optimization.

This function finds the strain relaxation times \(\tau_\epsilon\) that achieve a target quality factor \(Q\) for a generalized Maxwell solid with \(N_\text{SLS}\) standard linear solids.

The algorithm:

  1. Sets up \(N_F=100\) evaluation frequencies equally spaced in \(\log_{10}\)

  2. Uses Nelder-Mead simplex to minimize the misfit between achieved and target \(1/Q\) values over the frequency range

The initial guess for \(\tau_\epsilon\) is \(\tau_\sigma\) (no attenuation), and the optimization typically converges within a few hundred iterations.

// Example: compute tau_eps for Q=200 with 3 SLS
constexpr int N_SLS = 3;
type_real Q = 200.0;
type_real min_period = 0.01;
type_real max_period = 10.0;
specfem::utilities::Band<specfem::units::s> period_band(min_period,
max_period); auto tau_sigma = compute_tau_sigma<N_SLS>(period_band); auto
tau_eps = compute_tau_eps<N_SLS>(Q, tau_sigma, period_band);

Note

The returned \(\tau_\epsilon\) values should satisfy \(\tau_\epsilon > \tau_\sigma\) for positive \(Q\) (physical attenuation).

Template Parameters:

N_SLS – Number of standard linear solids (requires \(N_\text{SLS} > 1\))

Parameters:
  • Q – Target quality factor \(Q\) (must be positive)

  • tau_sigma – Pre-computed stress relaxation times \(\tau_\sigma\) from compute_tau_sigma

  • min_frequency – Minimum frequency \(f_\text{min}\) (Hz) for frequency range

  • max_frequency – Maximum frequency \(f_\text{max}\) (Hz) for frequency range

Returns:

View containing \(N_\text{SLS}\) strain relaxation times \(\tau_\epsilon\)

template<int N_SLS>
struct AttenuationObjective

Objective function for \(\tau_\epsilon\) optimization.

This callable struct computes the misfit between the achieved \(Q\) (from the Maxwell solid model) and the target \(Q\) value. It is designed to be used with the Nelder-Mead optimizer.

The objective is computed as the sum of absolute relative errors:

\[ \sum_i \frac{| \tan\delta(f_i) - \frac{1}{Q_\text{target}} |}{\frac{1}{Q_\text{target}}} \]

where \(\tan\delta = B/A\) from the Maxwell solid moduli.

Template Parameters:

N_SLS – Number of standard linear solids