Finite Difference method to solve PDEs

In summary, there are different ways to handle the issue of the last node being outside of the domain when using a finite difference method to solve 1D PDEs. One approach is to use the derivative at the point (n-1/2) as the average of the derivatives at n and n-1. Another option is to use the derivative at the nth and (n-1)th points as the same as the derivative at the (n-2)th and (n-1)th points. It is not necessary to stick to one discretization scheme for a system.
  • #1
iamkratos
7
0
Hello:

I am looking to solve a set of 1D PDEs. I thought the finite difference method would be a good way to go about it. So I decided to pick a simple first order forward difference scheme to obtain preliminary results.

I just have 1 question: According to my scheme, at the last node (node 'n') - [itex]\partial[/itex]u/[itex]\partial[/itex]x will be (u[itex]_{n+1}[/itex]-u[itex]_{n}[/itex])/[itex]\Delta[/itex]x. But node 'n+1' is outside my domain. How would 1 traditionally go about this problem?
Also: Is it generally required to stick to 1 discretization scheme for a system?

Thanks in advance,

-Shankar
 
Physics news on Phys.org
  • #2
There are a variety of ways that you can go about this.
1) You can use the derivative the same between the nth and (n-1)th as the (n-2)th and (n-1)th points.
2) The derivative at the point (n-1/2) is given by:
[tex]
\frac{\partial u}{\partial x}\Bigg|_{n-\frac{1}{2}}=\frac{u_{n}-u_{n-1}}{\delta x}\quad \frac{\partial u}{\partial x}\Bigg|_{n-1}=\frac{u_{n}-u_{n-2}}{2\delta x}
[/tex]
But the derivative at the point n-1/2 is just the average of the derivatives at n and n-1, so we write:
[tex]
\frac{\partial u}{\partial x}\Bigg|_{n-\frac{1}{2}}=\frac{1}{2}\left(\frac{\partial u}{\partial x}\Bigg|_{n}+\frac{\partial u}{\partial x}\Bigg|_{n-1}\right)
[/tex]
So it is a simple matter of substitution to find that:
[tex]
\frac{\partial u}{\partial x}\Bigg|_{n}=\frac{4u_{n-1}-u_{n-2}-3u_{n}}{2\delta x}
[/tex]
 

1. What is the Finite Difference method and how does it work?

The Finite Difference method is a numerical technique used to solve partial differential equations (PDEs). It works by discretizing the domain of the PDE into a grid of points, and then approximating the derivatives in the PDE using the differences between neighboring grid points. This allows the PDE to be transformed into a system of algebraic equations that can be solved using standard numerical methods.

2. What are the advantages of using the Finite Difference method?

One advantage of the Finite Difference method is that it is relatively easy to implement and requires minimal computational resources. It is also a versatile method that can be applied to a wide range of PDEs, including both linear and non-linear equations. Additionally, the Finite Difference method provides a visual representation of the solution through the grid points, making it easy to interpret and analyze the results.

3. What are the limitations of the Finite Difference method?

The Finite Difference method is limited by the accuracy of the numerical approximations used to discretize the PDE. If the grid is not fine enough, the solution may be inaccurate. Additionally, the method is most effective for problems with simple geometries and boundary conditions, as more complex problems may require a large number of grid points and become computationally expensive.

4. How do you choose the appropriate grid size for the Finite Difference method?

The appropriate grid size for the Finite Difference method depends on the problem at hand. In general, a finer grid will provide a more accurate solution, but at the cost of increased computational resources. A common approach is to start with a coarse grid and gradually refine it until the solution converges to a desired level of accuracy.

5. Are there any alternative methods to solve PDEs besides Finite Differences?

Yes, there are several other numerical methods for solving PDEs, including Finite Element Method, Finite Volume Method, and Spectral Methods. Each method has its own advantages and limitations, and the most appropriate method to use depends on the specific problem being solved.

Similar threads

  • Differential Equations
Replies
3
Views
2K
  • Other Physics Topics
Replies
1
Views
2K
  • Differential Equations
Replies
7
Views
4K
  • Differential Equations
Replies
12
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
990
  • Differential Equations
Replies
7
Views
2K
  • Differential Equations
Replies
5
Views
1K
  • Differential Equations
Replies
1
Views
2K
  • Differential Equations
Replies
1
Views
1K
Replies
1
Views
1K
Back
Top