diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-05 22:23:56 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-05 22:23:56 -0300 |
commit | aa27034da8a97134eb6ae80631bc4fb48a10432d (patch) | |
tree | 938a2bf65bd8eb9ae2ed4b026266188dea22dd91 | |
parent | c244e44630e611e038d1f18992bea400f7d7b6cb (diff) | |
download | code-aa27034da8a97134eb6ae80631bc4fb48a10432d.tar.gz code-aa27034da8a97134eb6ae80631bc4fb48a10432d.tar.bz2 code-aa27034da8a97134eb6ae80631bc4fb48a10432d.zip |
Made τ₀ = 0 possible
-rw-r--r-- | fourier_integrator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fourier_integrator.cpp b/fourier_integrator.cpp index 69c8b03..4f4eff5 100644 --- a/fourier_integrator.cpp +++ b/fourier_integrator.cpp @@ -84,7 +84,11 @@ int main(int argc, char* argv[]) { // start from the exact solution for τ₀ = 0 for (unsigned i = 0; i < n; i++) { Real τ = i * Δτ * M_PI; - C[i] = Γ₀ / 2 * (exp(-z * τ) - z * τ₀ * exp(-τ / τ₀)) / (z - pow(z, 3) * pow(τ₀, 2)); + if (τ₀ > 0) { + C[i] = Γ₀ / 2 * (exp(-z * τ) - z * τ₀ * exp(-τ / τ₀)) / (z - pow(z, 3) * pow(τ₀, 2)); + } else { + C[i] = Γ₀ / 2 * exp(-z * τ) / z; + } if (i > 0) { C[2 * n - i] = C[i]; } |