diff options
-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]; } |