Finite Difference method to solve PDEs

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 replies · 4K views
iamkratos
Messages
5
Reaction score
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
 
on Phys.org
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]