# Time evolution of a diffusion equation

Hallo everyone,

I have a 1-D diffusion equation with decay as
dA/dt = d2A/dx2-L*A

with initial condition C(x,0)=C0=exp(-ax)
and boundary condition= -Ddc/dx = I0

where L= decay constant
A = certain concentration

the concentration A is not in equilibrium. We can solve the above equation for equilibrium putting dA/dt=0.

The equilibrium concentration can be reached in time t.

How can I determine the time that it takes to reach equilibrium concentration?

Thank you

help would be greatly appriciated

Related Other Physics Topics News on Phys.org
Rap
Hallo everyone,

I have a 1-D diffusion equation with decay as
dA/dt = d2A/dx2-L*A

with initial condition C(x,0)=C0=exp(-ax)
and boundary condition= -Ddc/dx = I0

where L= decay constant
A = certain concentration

the concentration A is not in equilibrium. We can solve the above equation for equilibrium putting dA/dt=0.

The equilibrium concentration can be reached in time t.

How can I determine the time that it takes to reach equilibrium concentration?

Thank you

help would be greatly appriciated
Strictly speaking, it will take an infinite amount of time to reach equilibrium. A more finite question would be "How can I determine the time that it takes to reach 99% of the equilibrium concentration." Or 95%, or 99.99%, pick a good number.

Strictly speaking, it will take an infinite amount of time to reach equilibrium. A more finite question would be "How can I determine the time that it takes to reach 99% of the equilibrium concentration." Or 95%, or 99.99%, pick a good number.

Yes that is true as t = inf you will get the original equilibrium concentration back...
Yes more finitely speaking 95-99% is a good approximation.. But analytically speaking t= inf still does hold.

Do you have any clue how to do that?

Thanks

Rap
Yes that is true as t = inf you will get the original equilibrium concentration back...
Yes more finitely speaking 95-99% is a good approximation.. But analytically speaking t= inf still does hold.

Do you have any clue how to do that?

Thanks
I have a little experience in these, but probably not enough. Diffusion equations are generally solved numerically, or by a series expansion. The first guy to do this was Fourier, and thats why he invented the Fourier series. I will play around with it, maybe the boundary conditions will make things easy. I don't understand the boundary conditions, what are C, c, and D?

I have a little experience in these, but probably not enough. Diffusion equations are generally solved numerically, or by a series expansion. The first guy to do this was Fourier, and thats why he invented the Fourier series. I will play around with it, maybe the boundary conditions will make things easy. I don't understand the boundary conditions, what are C, c, and D?
Actually I am searching for an analytical solution rather than a practical one...
the boundary condition is fick's law -DdA/dx=constant
the initial condition is A(z,t=0)= A0*exp(-mx)

thanks

Rap
Actually I am searching for an analytical solution rather than a practical one...
the boundary condition is fick's law -DdC/dx=constant
the initial condition is C(z,t=0)= Aexp(-mx)

thanks
You have to express boundary conditions in terms of the concentration A. What is the relationship between C and A? Is d and D another typo? If you cannot express the problem clearly, then it cannot be solved.

You have to express boundary conditions in terms of the concentration A. What is the relationship between C and A? Is d and D another typo? If you cannot express the problem clearly, then it cannot be solved.
it is actually d/dt (A) = D * d^2A/dx^2(partial double derivative of A w.r.t.x)- L*A

with initial condition A(x,0)=A0=exp(-ax)
and boundary condition= -DdA/dx = I0

where L= decay constant
A = certain concentration
D = Diffusion coefficient

Sorry if it was not clear

Rap
it is actually d/dt (A) = D * d^2A/dx^2(partial double derivative of A w.r.t.x)- L*A

with initial condition A(x,0)=A0=exp(-ax)
and boundary condition= -DdA/dx = I0

where L= decay constant
A = certain concentration
D = Diffusion coefficient

Sorry if it was not clear
Where is the boundary located? At x=0? Is the boundary condition that -D dA/dx=I0 at x=0 for all t?

Where is the boundary located? At x=0? Is the boundary condition that -D dA/dx=I0 at x=0 for all t?
Yes boundary is located at x=0 (this is all happening in semi infinite slab x=0 to inf)
-D dC/dx = I0 is at x=0 for all t

Rap
The initial conditions and boundary conditions are in conflict unless a=I0/D. If A(x,0)=exp(-ax) then at t=0, dA/dx=-a exp(-ax) so that dA/dx=-a at x=0, t=0. Since dA/dx=-I0/D for all t, including t=0, that means that a=I0/D.

The initial conditions and boundary conditions are in conflict unless a=I0/D. If A(x,0)=exp(-ax) then at t=0, dA/dx=-a exp(-ax) so that dA/dx=-a at x=0, t=0. Since dA/dx=-I0/D for all t, including t=0, that means that a=I0/D.

Yes you are right..Actually it is like this at t=0 that means where initial condition apply A(x,0)=exp(-kx) and for t>0 the Boundary condition comes in the picture -DdA/dx = I0.

I guess now its no more in conflict

Rap
I don't know how to solve this equation with these boundary conditions. Try submitting it to http://www.mymathforum.com/ under the "Real analysis and topology section". You will have no luck unless you state the problem clearly. Don't change A to C to c, don't make typos. Do it like this:

--------

I am trying to solve a type of heat equation for A(x,t) (all variables are real). The differential equation to be solved is:

dA/dt = D d^2A/dx^2 - A/to where D>0, to>0 (d's are partials)

The IC is that at t=0, x>=0, A(x,0)=exp(-a x) where a is some constant > 0.

The BC is that at x=0, t>0, dA/dx=-k where k is some constant >0

----------

I changed a few variables around to make it simpler (e.g. L=1/to).

Last edited:
I don't know how to solve this equation with these boundary conditions. Try submitting it to http://www.mymathforum.com/ under the "Real analysis and topology section". You will have no luck unless you state the problem clearly. Do it like this:

I am trying to solve a type of heat equation for A(x,t) (all variables are real). The differential equation to be solved is:

dA/dt = D d^2A/dx^2 - A/to where D>0, to>0

The IC is that at t=0, x>=0, A(x,0)=exp(-a x) where a is some constant > 0.

The BC is that at x=0, t>0, dA/dx=-k where k is some constant >0

Okey i will do that
thanks for the help anyways

There are two ways: apply finite differences to solve this problem OR apply laplace equation, finite fourier series, etc. If you still need help, please contact me or reply back.

Rap
There are two ways: apply finite differences to solve this problem OR apply laplace equation, finite fourier series, etc. If you still need help, please contact me or reply back.
Will finite fourier series work? I mean its for 0<=x<=infinity.

you can use any of these three. again.. it is alot of work.. you need to be careful.. best case scenario is finite difference.. way easier.. attached is my program for a similar equation by no L^2-A, so
n=29;
dx=5/(n-1);
Y=0:dx:5;
alpha=0.5;
stab=(0.5*dx*dx)/(alpha);
dt=0.03;
g=0:dt:250;
[o,d]=size(g);
th=zeros(d,n);
tau=(0.5*dt)/(dx*dx);
for k=1
for i=1:1:n
th(k,i)=1;
end
end

for k=2:1:d
th(k,1)=0;
th(k,n)=2;
end

for t=1:1:d-1
for i=2:1:n-1
th(t+1,i)=((th(t,i+1)+th(t,i-1)-(2*th(t,i)))*(tau))+th(t,i);
end
end
tc=10; %Choose t for Viewing, Steady at tc=1E5 or 5 s
for i=1:1:n
thetha(i)=th(tc,i);
end
hold on
figure (1)
plot(Y,thetha)
xlabel ('x (cm)')
ylabel('thetha(t,x)')

way easier to finite differences

a) set up mesh
b) define bc's and initial conditons (knowns)
c) set up a time marching loop.. set inner node equations, etc, and other things and set up everything
d) solve for C(x,t)

Rap
you can use any of these three. again.. it is alot of work.. you need to be careful.. best case scenario is finite difference.. way easier.. attached is my program for a similar equation by no L^2-A, so
LOL - I am not the original poster, but being a programmer, I copied the program for future reference.

I cannot figure out how to use Fourier series to solve an equation where x<=0<=infinity. Fourier transform, yes, Laplace transform, yes, but fourier series needs a finite interval, right?

Just use lapace or fourier transform.. fourier transform is related to fourier series... equally you can use finite fourier if need be

Thanks for the help. Actually I have solved the problem with the help of Laplace transformation...and the solution works..:)...but thanks anyways!