- #1
sanukisoba
- 2
- 0
Hi,
I am trying to do a simple numerical calculation of diffusion equation.
∂t u(x, t) = ∂x^2 u(x, t).
I could replicate a seemingly appropriate result (
).
However, I found the spectrum of the result is quite strange (
).
Since "∂x^2 u(x, t)" becomes "-k^2 uk" in Fourier space (uk is Fourier coefficient of u), the spectrum of large wave number region must be smaller.
To confirm it, I solved the same equation using spectral method.
d/dt uk = -k^2 uk.
Then I obtained the third figure (
) which seems appropriate.
I interpret such a difference between finite difference and spectral methods in large wave number region as following.
The finite difference equation is,
∂t u = [u(x+Δx) - 2u(x) + u(x-Δx)]/Δx^2.
If we substitute u(x) = uk exp(ikx), the above equation becomes
d/dt uk = uk [exp(ikΔx) + exp(-ikΔx) -2]/Δx^2 ≈ uk [-k^2 + O(k^4 Δx^2)].
Therefore, there remains O(k^4 Δx^2) difference with spectral method.
Even if Δx is small enough, the large k region have big error.
Now, could you tell me whether this interpretation is correct.
And I would like to know the remedy of this problem.
I am trying to do a simple numerical calculation of diffusion equation.
∂t u(x, t) = ∂x^2 u(x, t).
I could replicate a seemingly appropriate result (
However, I found the spectrum of the result is quite strange (
Since "∂x^2 u(x, t)" becomes "-k^2 uk" in Fourier space (uk is Fourier coefficient of u), the spectrum of large wave number region must be smaller.
To confirm it, I solved the same equation using spectral method.
d/dt uk = -k^2 uk.
Then I obtained the third figure (
I interpret such a difference between finite difference and spectral methods in large wave number region as following.
The finite difference equation is,
∂t u = [u(x+Δx) - 2u(x) + u(x-Δx)]/Δx^2.
If we substitute u(x) = uk exp(ikx), the above equation becomes
d/dt uk = uk [exp(ikΔx) + exp(-ikΔx) -2]/Δx^2 ≈ uk [-k^2 + O(k^4 Δx^2)].
Therefore, there remains O(k^4 Δx^2) difference with spectral method.
Even if Δx is small enough, the large k region have big error.
Now, could you tell me whether this interpretation is correct.
And I would like to know the remedy of this problem.
Last edited: