# What is a reasonable manufactured solution to test finite difference method? [duplicate]

What is a reasonable manufactured solution to test the following equation against its finite difference approximation? I want it to look like a Cosine function about $0$, rotated about $Z$ axis (basically not varying about $\theta$) such that $f$ turns out to be a not so bad function in terms of $r,\theta$

$$u_{rr} \;+\; \frac{1}{r} u_r \;+\; \frac{1}{r^2} u_{\theta\theta}\;+\; Cu \;=\; f(r,\theta)$$

Also, it should avoid the discontinuity at $r = 0$

• Hi @mod0 and welcome to scicomp! Your question appears to be virtually identical to one posted eariler: scicomp.stackexchange.com/questions/12902/… – Paul Dec 9 '14 at 3:40
• Hi Paul, I have seen that question and even gone over the document attached in the answer. The document does not deal with a source term. And hence I asked anyway. I meant, I went to the MASA site, downloaded their document and went over it. – mod0 Dec 9 '14 at 3:42
• Nothing magic happens. You just plug your chosen $u$ into the PDE and see what $f$ it generates. Implement that and the BCs, and you're set. – Bill Barth Dec 9 '14 at 3:48
• Also, you should choose a more complex manufactured solution than a simple cosine function about the origin. If your manufactured solution has no $\theta$ variation, you will not test the $u_{\theta\theta}$ term's implementation at all. You should include a product of transcendental functions at the very least. – Bill Barth Dec 9 '14 at 3:51
• You should not use a polynomial in $r$. Use trancendentals in both directions at the very least. – Bill Barth Dec 9 '14 at 21:59