Finite Difference method to solve PDEs

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') - \partialu/\partialx will be (u_{n+1}-u_{n})/\Deltax. 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
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:
<br /> \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}<br />
But the derivative at the point n-1/2 is just the average of the derivatives at n and n-1, so we write:
<br /> \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)<br />
So it is a simple matter of substitution to find that:
<br /> \frac{\partial u}{\partial x}\Bigg|_{n}=\frac{4u_{n-1}-u_{n-2}-3u_{n}}{2\delta x}<br />
 
Thread 'Direction Fields and Isoclines'
I sketched the isoclines for $$ m=-1,0,1,2 $$. Since both $$ \frac{dy}{dx} $$ and $$ D_{y} \frac{dy}{dx} $$ are continuous on the square region R defined by $$ -4\leq x \leq 4, -4 \leq y \leq 4 $$ the existence and uniqueness theorem guarantees that if we pick a point in the interior that lies on an isocline there will be a unique differentiable function (solution) passing through that point. I understand that a solution exists but I unsure how to actually sketch it. For example, consider a...

Similar threads

Back
Top