Finite differencing on non-uniform grids

  • Thread starter hunt_mat
  • Start date
  • Tags
    Finite
In summary, the conversation discusses the use of a five point stencil and a seven point stencil for finding derivatives on a uniform grid. The five point stencil worked well for first order derivatives but became unstable for higher derivatives. The speaker also tried the seven point stencil but it was even worse. They discuss using Taylor's theorem and a system of linear equations to solve for the derivatives, but have encountered issues with the Vandermonde matrix. They consider looking at a smaller system to troubleshoot the problem.
  • #1
hunt_mat
Homework Helper
1,782
32
Hi,

Recently I had to find a derivative on a uniform grid. Being naive I tried the following scheme:
[tex]f'(x_{n})=Af(x_{n+2})+Bf(x_{n+1})+Cf(x_{n})+Df(x_{n-1})+Ef(x_{n-2})[/tex]

Then write the [itex]f(x_{n\pm i})[/itex] in terms of [itex]f^{(n)}(x_{n})[/itex] by use of Taylor's theorem. This lead to a system of linear equations for the A,B,C,D,E which required inverting a Vandermonde matrix.

I tried it out a couple of times and it worked okay for the first derivative but when I applied it to higher derivatives it became unstable. Does anyone know what is going wrong?

I also tried a seven point stencil in the same way and that bizarrely was even worse.

Mat
 
Physics news on Phys.org
  • #2
It might be helpful to look at the actual matrix you get for a case that causes trouble. It's probably also a good idea to do this for the smallest system possible. If you can see the problem play out on a system you could compute by hand, it might well give you an idea about what's going wrong.
 
  • #3
Possibly, but I have tested the 7 point stencil on simple examples and have not got the answers which I should have. The five point stencil however works relative well for first order derivatives but not on higher derivatives (I think)
 

1. What is finite differencing on non-uniform grids?

Finite differencing on non-uniform grids is a numerical method used to approximate the solutions to differential equations on grids with non-uniform spacing. It involves discretizing the domain into a grid with varying spacing and using finite difference approximations to calculate the derivatives at each grid point.

2. Why is finite differencing on non-uniform grids important?

Finite differencing on non-uniform grids is important because it allows for more accurate solutions to differential equations on non-uniform domains. It also allows for better representation of steep gradients and boundary layers.

3. How is finite differencing on non-uniform grids different from uniform grids?

Finite differencing on non-uniform grids differs from uniform grids in that the grid spacing is not constant. This means that the finite difference approximations used to calculate derivatives must be adjusted to account for the varying grid spacing.

4. What are the benefits of using non-uniform grids for finite differencing?

Using non-uniform grids for finite differencing has several benefits. It allows for more accurate solutions to differential equations, especially in regions with steep gradients. It also reduces the computational cost and can improve efficiency in certain applications.

5. What are some challenges of implementing finite differencing on non-uniform grids?

There are several challenges in implementing finite differencing on non-uniform grids. One challenge is determining the appropriate grid spacing, as it must be small enough to capture the solution accurately but not too small to make the calculations computationally expensive. Another challenge is adapting the finite difference approximations to account for the non-uniform grid spacing. Additionally, non-uniform grids may introduce numerical errors, so careful consideration must be given to ensure accurate solutions.

Similar threads

  • Differential Equations
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
8
Views
1K
Replies
36
Views
6K
  • Differential Equations
Replies
1
Views
1K
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
2
Views
1K
  • Math Proof Training and Practice
3
Replies
71
Views
9K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
Back
Top