# Diffusion equation in sperical coordinates

1. Jun 21, 2010

### lostidentity

I have the following diffusion equation

$$\frac{\partial^{2}c}{\partial r^{2}} + \frac{2}{r}\frac{\partial c}{\partial r} = \frac{1}{\alpha}\frac{\partial c}{\partial t}$$

where $$\alpha$$ is the diffusivity. The solution progresses in a finite domain where $$0 < r < b$$, with initial condition
$$c(r,0) = g(r)$$

and the boundary conditions

$$c(b,t) = 1$$

$$c(0,t) = 0$$

How will I proceed with this using the separation of variables?
I think the time-dependent part is straight forward after separation of variables. But how will I deal with the spatial part where Bessel functions have to be dealt with?

Thanks.

Last edited: Jun 21, 2010
2. Jun 21, 2010

### Feldoh

$$\frac{\partial^{2}c}{\partial r^{2}} + \frac{2}{r}\frac{\partial c}{\partial r} = \lambda$$

$$\frac{r}{2} \frac{\partial^{2}c}{\partial r^{2}} + \frac{\partial c}{\partial r} = \frac{r \lambda}{2}$$

Let u = r/2 and you should be able to get it into the form of $$x \frac{d^2 y}{dx^2} + \frac{dy}{dx} = \frac{d}{dx} (x \frac{dy}{dx})$$

3. Jun 22, 2010

### lostidentity

Hello thanks for the reply. I've found out that my spatial equation is in the form of the spherical Bessel function equation, where the Bessel functions of the first and second kinds are given by

$$J_0(\lambda{r}) = \frac{\sin(\lambda{r})}{\lambda{r}}$$
$$Y_0(\lambda{r}) = -\frac{\cos(\lambda{r})}{\lambda{r}}$$

I ignore $$Y_0$$ since it goes to infinity when $$r=0$$. The general solution then becomes

$$c(r,t)=De^{-(\alpha\lambda^2t)}J_0(\lambda{r})$$

Now the problem I'm having is finding the constant D and $$\lambda$$ using the initial and boundary conditions.

The initial condition is $$c(r,0)=g(r)$$

I first apply the initial condition to obtain

$$c(r,0)=DJ_0(\lambda{r})=g(r)$$
$$D=\frac{g(r)}{J_0(\lambda{r})}$$

I now apply the boundary condition $$c(b,t)=1$$ to obtain

$$c(b,t)=\frac{g(b)}{J_0(\lambda{b})}e^{-\alpha\lambda^2t}J_0(\lambda{b})}=1$$

$$-\alpha\lambda^2{t}=\ln(\frac{1}{g(b)})$$

Therefore the solution is

$$c(r,t)=g(r)e^{\ln\frac{1}{g(b)}}$$

but my problem is $$g(b)=1$$ for the profile, which means that the solution is actually

$$c(r,t)=g(r)$$

i.e. it doesn't change with time! I don't think this makes sense.
What am I doing wrong here?

EDIT:

I realised that I've forgotten a simple rule of calculus where I should apply both the boundary conditions first before I apply the initial conditions. However, this gives another problem because applying the first boundary condition

$$c(0,t)=0$$ gives me

$$De^{\alpha\lambda^2t}=0$$

and the second boundary condition $$c(b,t)=1$$ gives

$$De^{\alpha\lambda^2t}J_0(\lambda{r})=1$$

I don't know how this could be solved. It could be that my boundary conditions are incorrect.

Last edited: Jun 22, 2010