2

Tomorrow I have an exam about Numerical Methods, and I came up with the following question. Let $$-\frac{d}{dr} \left ( \frac{1}{r} \frac{dy}{dr} \right ) = 1 $$with $r\in [1,2], y(1) = 1 \mbox{ and }y(2)=10$. Take $h = \frac{1}{n+1}$ and $r_i = ih + 1$. (We have made a grid of n+1 points). Now I need to give the equation for the $i^{th}$ point on the grid, which is (according to my book) $$-\frac{1}{h^2}(\frac{1}{r_{i+0.5}}(u_{i+1}-u_i) - \frac{1}{r_{i-0.5}}(u_i - u_{i-1}) = 1$$

Sorry if my terms are not correct, I don't follow this course in English, so I don't know all the correct English terms.

user54297
  • 1,036

1 Answers1

1

This looks quite correct. If you denote $u_i$ the approximation of $y$ in $r_i$, you approximate the outer derivative using centered finite difference with step $h/2$ :$$\frac{d}{dr} \left( \frac{1}{r} \frac{dy}{dr} \right) \approx \frac{1}{h} \left( (\frac{1}{r}\frac{dy}{dr})(r_{i+0.5}) - (\frac{1}{r}\frac{dy}{dr})(r_{i-0.5})\right)$$

where $r_{i+0.5} = (i+0.5)h+1$ (and the same for $r_{i-0.5}$). Now, if you reuse the centered finite difference for the two derivatives appearing in the previous equation (with step $h/2$ again) $$\frac{dy}{dr}(r_{i+0.5}) \approx \frac{1}{h}(y(r_{i+1}) - y(r_{i}))$$ and $$\frac{dy}{dr}(r_{i-0.5}) \approx \frac{1}{h}(y(r_{i}) - y(r_{i-1}))$$

Collecting all the terms and replacing the $y(r_{i})$ by their approximations $u_i$, you obtain the approximation from your book.

Dr_Sam
  • 417