Using backward vs central finite difference approximation

In summary, the conversation discusses solving the 2nd-order wave equation numerically with boundary and initial conditions given. The expert summarizer explains that using a backward difference approximation of higher orders for the second derivative in time may not work as well as a central difference approximation due to stability issues and the need for a more precise grid. They also mention that it is possible to use finite difference methods with a large Courant number, but it may require modifications such as using a staggered grid or an implicit scheme. Alternatively, spectral methods can be used, but they may be more complex to implement. The best approach will depend on the specific problem and desired level of accuracy.
  • #1
TheCanadian
367
13
I am solving the simple 2nd-order wave equation:

$$ \frac {\partial ^2 E}{\partial t^2} = c^2 \frac {\partial ^2 E}{\partial z^2} $$

Over a domain of (in SI units):

## z = [0,L=10]##m, ##t = [0,t_{max} = 10]##s

and boundary/initial conditions:

$$ E(z=0) = E(z=L) = 0 $$

$$ E(t=0) = -E(t=t_{max}) = sin(\frac{\pi z}{L}) $$

I know the analytic solution, but am trying to solve it numerically. (The numerical and analytic solutions are compared to test accuracy.) I just had a couple questions:

1) When I solve the wave equation by applying a central difference approximation of order 2 on the second derivative of time, the code works perfectly fine. Although when I apply http://(https://en.wikipedia.org/wiki/Finite_difference_coefficient#Forward_and_backward_finite_difference) of higher orders for the second derivative in time, my solution diverges. Is there any particular reason why using a backward difference approximation would be worse than a central difference approximation of the same order? I was under the impression using a higher order backward difference method would give me higher accuracy, but it appears to not work at all. I can supply the code if needed, although it's a fairly basic implementation.

2) I am able to solve the equation above when using a central difference approximation and setting ## c = 1## m/s, but if I use ##c = 3 \times 10^8## m/s, the solution diverges. This makes sense as the Courant number (##C_o = c \frac {\Delta t}{\Delta x}##) is much greater than one. But I am curious: are there any possible finite difference schemes that can be applied to numerically solve the equation if ##C_o >> 1##? I have read a bit about BDF methods to help solve stiff equations, but in this case, the only problem is that a more precise grid is needed, correct? I had also heard about spectral methods, but am still trying to learn how to implement them and if they would be applicable/accurate enough if other (nonlinear) terms were included in the wave equation.
 
Last edited by a moderator:
Technology news on Phys.org
  • #2


1) There are a few reasons why using a backward difference approximation may not work as well as a central difference approximation. First, backward difference approximations are known to be less stable than central difference approximations, meaning that small errors in the initial conditions or boundary conditions can lead to large errors in the solution. This could be one reason why your solution is diverging. Additionally, higher order backward difference approximations may require more points to be accurate, so if your grid is not fine enough, the solution may not be accurate. Another possibility is that there may be an error in your implementation of the backward difference scheme.

2) It is possible to use finite difference methods to solve the wave equation with a large Courant number, but it may require some modifications to the standard scheme. One approach is to use a staggered grid, where the spatial and temporal grid points are offset from each other. This can help improve stability and accuracy for large Courant numbers. Another approach is to use an implicit scheme, where the time derivative is discretized using a backward difference approximation. This can be more stable for large Courant numbers, but it may also require solving a system of equations at each time step. Spectral methods can also be used for the wave equation, but they may require more points and can be more complex to implement. Ultimately, the best approach will depend on the specific problem and the desired level of accuracy.
 

1. What is the difference between backward and central finite difference approximation?

Backward finite difference approximation uses the derivative of a function at a point by taking the difference between the current point and the previous point. Central finite difference approximation uses the derivative of a function at a point by taking the difference between the points on either side of the current point.

2. When should I use backward finite difference approximation?

Backward finite difference approximation is best used when the function is more accurately represented by the points before the current point. This is often the case when the function is steeper in the beginning or has a discontinuity.

3. When should I use central finite difference approximation?

Central finite difference approximation is best used when the function is more accurately represented by the points on either side of the current point. This is often the case when the function is relatively smooth and continuous.

4. How do I determine the accuracy of my finite difference approximation?

The accuracy of a finite difference approximation can be determined by comparing it to the actual value of the derivative at a given point. The closer the approximation is to the actual value, the more accurate it is.

5. Are there any limitations to using finite difference approximation?

Yes, there are limitations to using finite difference approximation. It is not always accurate, especially for highly nonlinear functions. It also requires a sufficiently small step size to accurately approximate the derivative, which can be computationally expensive for large datasets.

Similar threads

  • Programming and Computer Science
Replies
10
Views
1K
  • Differential Equations
Replies
1
Views
1K
  • Programming and Computer Science
Replies
17
Views
2K
  • Differential Equations
Replies
7
Views
4K
  • Differential Equations
Replies
1
Views
664
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
Replies
4
Views
698
  • Atomic and Condensed Matter
Replies
4
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
Back
Top