Finite Difference method - An example

229 Views Asked by At

I am trying to solve $$\frac{d^2T}{dr^2}+\frac{1}{r}\frac{dT}{dr}+1=0$$ for $0<r<1$ with the following boundary conditions $$\frac{dT}{dr}\Bigr|_{r=0}=0, \hskip10pt T(1)=1$$ by using finite difference method - central difference. I want to find $T_1,\cdots, T_{11}$. What I have done so far is below :

$\Delta r=0.1 \Rightarrow r_1=0.0, r_2=0.1, r_3=0.2, \cdots, r_{11}=1.0$

$\frac{d^2T}{dr^2}+\frac{1}{r}\frac{dT}{dr}+S=0\Rightarrow \frac{T_{i+1}-2T_{i}+T_{i-1}}{\Delta r^2}+\frac{1}{r_{i}}\frac{T_{i+1}-T_{i-1}}{2\Delta r}+1=0;\hskip5pt i=2,3, \cdots, 10$

$\frac{dT}{dr}\Bigr|_{r=0}=0\Rightarrow \frac{T_{i+1}-T_{i-1}}{2\Delta r}=0 \text{ and $i=1$. Then we have } T_{2}-T_{0}=0.$

$ T(1)=1 \Rightarrow i=11 \text{ and }T_{11}=1.$

Now, I have $11$ equations for $12$ unknowns, due to $T_0$. What should I do?

1

There are 1 best solutions below

5
On BEST ANSWER

In order to avoid the extra unknown $T_0$, we could write the boudary condition for $r=0$ by second order forward $$T'(0)\frac{-\frac32T_1+2T_2-\frac12T_3}{\Delta r}$$