From aa27034da8a97134eb6ae80631bc4fb48a10432d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Sat, 5 Apr 2025 22:23:56 -0300 Subject: Made τ₀ = 0 possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fourier_integrator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fourier_integrator.cpp') 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]; } -- cgit v1.2.3-70-g09d2