specfem::program::qplots¶
-
bool specfem::program::qplots(const type_real Q, const type_real minfreq, const type_real maxfreq, const type_real min_plot_freq, const type_real max_plot_freq, const std::string &output_dir)¶
Generate Q plot data for given Q and frequency range.
This function computes the Maxwell solid parameters (tau_sigma and tau_eps) for a specified quality factor Q and frequency range, then generates data for plotting the achieved Q^-1 vs frequency. The output is saved to a text file in the specified output directory, which can be used with external plotting tools.
It is important to note that this executable is intended to reproduce what specfem++ is internally computing in the attenuation assembly, that is the maxwell solid real and imaginary factors \(M_1\) and \(M_2\) and the resulting \(Q^{-1}\), so that users can visualize the frequency dependence of \(Q^{-1}\) for their chosen parameters. The number of standard linear solids (SLS) used in the computation is fixed at 3, which is a common choice for seismic applications to capture the frequency dependence of attenuation without excessive computational cost.
The output file will contain columns for frequency, \(Q^{-1}\), the real modulus \(M_1\), and the contributions from each standard linear solid (SLS) to \(Q^{-1}\) and \(M_1\).
These columns can then be used reproduce the plots of Savage et al. 2010 (relative phase velocity should be flipped along x axis, and \(Q^{-1}\) should be plotted on a log scale) and Dahlen & Tromp 1998, Figure 6.8. Note that for Dahlen & Tromp 1998, Figure 6.8, we need many more SLS than the standard 3 to reproduce the smooth curve.
- Parameters:
Q – Quality factor to compute the Maxwell solid parameters for
minfreq – Minimum frequency for the inversion of tau_sigma and tau_eps
maxfreq – Maximum frequency for the inversion of tau_sigma and tau_eps
min_plot_freq – Minimum frequency for the output plot data
max_plot_freq – Maximum frequency for the output plot data
output_dir – Directory to save the output plot data file
- Returns:
true on successful generation of plot data, false on failure