I am trying to implement the Crank-Nicolson scheme directly for the second order wave equation by replacing $E^n$ terms in spatial derivative with $(E^(n-1)+2E^(n)+E^(n+1))/4$. I am sure I have obtained the coefficients correctly as I have checked my answer with the scheme given in the book "The finite Difference Method in Partial differential equations" by A.R. Mitchell and D.F. Griffiths. but the code produces extra wave tails as the wave travels in the cavity. as the time passes some small wave peaks appear at the end of the gaussian waveform which propagates in the cavity and these small waveforms get bigger and bigger gradually. specially after the wave reflects from the walls. Please help me to understand what the problem is.
Asked
Active
Viewed 381 times
2
-
CN differentiation of the space component of the equation is effectively evaluated at the timestep $t+dt/2$, not $t$ or $t+dt$. How would you evaluate the second order time derivative around $t+dt/2$? Possibly the problem is that you are matching the time derivative approximated at $t$ to the space derivative at $t+dt/2$. – kevinkayaks Oct 23 '21 at 18:59