Differential equation (can't get BC and IC from solution)

87 Views Asked by At

I want to compare my numerical solution with analytical one. $$\frac{\partial c}{\partial \theta}=D\left(\frac{\partial^2 c}{\partial \rho^2}+\frac2{\rho}\frac{\partial c}{\partial \rho}\right)$$

BC and IC: $$c=c_{\infty} \text{ at } \theta=0, \rho>r;\quad c=c_0 \text{ at } \theta>0, \rho=r$$ Solution: $$c-c_\infty=\frac{(c_0-c_\infty)r}{\rho}\operatorname{erf}\left(\frac{\rho-r}{2\sqrt{D\theta}}\right)$$

I put $\theta = 0$ and I've got $\operatorname{erf} = \text{NaN}$ for $r=\rho$ and $1/\rho$ for other distances $(c_{\infty} = 0, c_0 = 1)$. Looking at BC and IC I expect to get: $\text{NaN}\ 0\ 0\ 0\ 0$... Am I wrong?

Same problem with $r = \rho: t>0, r = \rho \implies \operatorname{erf} = 0$ and $c=c_{\infty}$ but not a $c_{rad}$.

I think that I do not understand something but what? Thank you!

1

There are 1 best solutions below

2
On

Note that

$$ \lim_{x\to \infty}\operatorname{erf}(x) = 1 $$

Thus

$$ c(\rho,\theta=0) = c_\infty + (c_0-c_\infty)\frac{r}{\rho} $$

and

$$ c(\rho=\infty,\theta=0) = c_\infty $$ $$ c(\rho=r,\theta=0) = c_0 $$

Edit: The function seems to have a discontinuity at $\theta=0$, since $$ c(\rho=r,\theta\ne 0) = c_\infty $$

Either way, the solution form does not match the given B.C, so one of them must be incorrect.