1

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?

noname
  • 25
  • 4

1 Answers1

0

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}$$

user
  • 154,566
  • But $r_1=0.0$.. If i multiply by $r_i$ then i get the same equation obtained from the boundary condition for $r=0$. – noname Apr 05 '18 at 08:33
  • @noname Oh yes I see, there a problem for $r=0$. Then we could try keeping $r_1$ to $r_{11}$ with 9 equations for $r_2$ to $r_{10}$ and 2 boundary equation. To avoid $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}$. – user Apr 05 '18 at 09:02
  • @noname did you solve the problem by the given hint? – user Apr 05 '18 at 09:53
  • Yes, I solved the problem using your hint, thank you :) – noname Apr 05 '18 at 10:03
  • @noname Well done! I'm very happy for that. Bye – user Apr 05 '18 at 10:04