Parabolic pde using central finite difference method

450 Views Asked by At

I am trying to solve parabolic pde

$$ \frac{\partial U}{\partial t} = \frac{\partial^2 U}{\partial x^2}$$

$U=x^2$ is the initial condition distribution, $0 \leq x \leq 1 $ ($U$ is in dimensionless form.)

Discretizing the pde using central difference method and assuming $u$ as the exact solution,

$$\frac{u_{i,j+1}-u_{i,j-1}}{2k} = \frac{u_{i+1,j}-2u_{i,j}+u_{i-1,j}}{h^2}$$ $t=ik, x=jh$, where $i,j=0,1,2,3,...n$ Simplifying,

$$u_{i,j+1}=ru_{i-1,j}-2ru_{i,j}+ru_{i+1,j}+u_{i,j-1}$$ Where, $r=2k/h^2$

I have question in terms $u_{i,j-1}$ and $u_{i+1,j}$

  • When $t=0$, what should be value of $u_{i,j-1}$? How valid is it to assume it as zero?
  • What happens at $x=1$? What should be value of $u_{i+1,j}$ as this quantity will lie outside the domain.

Can someone comment on these questions?

1

There are 1 best solutions below

2
On BEST ANSWER
  1. You cannot make assumptions for $u_{i,j-1}$ at t=0. Use a forward difference in time not a central difference. i.e., represent the time derivative by $$\frac{u_{i,j+1}-u_{i,j}}{k}$$. It has the added benefit that the scheme will be stable (for small enough values of $\frac{k}{h^2}$). If you want to take largest steps in time without losing stability, use an implicit scheme like the Crank Nicholson that parsiad mentions.

  2. If you have boundary conditions (either $U$ or $U_x$ specified at x=0 and x=1 for all 0 < t < T ), then you only solve the function values at $j=1,...,n-1$. Since $j=0$ and $j=n$ are not evaluated, no problem with the central spatial difference.

  3. But you don't have the boundary conditions. You need to specify them.