Solving the Diffusion Equation with Boundary Conditions

In summary, the conversation discusses how to apply boundary conditions to the diffusion equation in one dimension. The initial condition is u(x,0)=0 and the boundary conditions are given by \frac{\partial u(0,t)}{\partial x}=\frac{\partial u(L,t)}{\partial x}=0. The conversation also explores solving the equation using separation of variables and finding constants to satisfy the boundary conditions. Ultimately, it is determined that with the given boundary and initial conditions, the solution is always 0.
  • #1
strangequark
38
0
Hey all,
I'm wondering if someone can help me understand how to apply the boundary conditions to the diffusion equation in one dimension. Diffusion equation is:

[tex]\frac{\partial u}{\partial t}[/tex]=D*[tex]\frac{(\partial)^{2}u}{\partial x^{2}}[/tex]

The initial condition is:
[tex]u(x,0)=0[/tex]

And the boundary conditions are:
[tex]\frac{\partial u(0,t)}{\partial x}[/tex]=[tex]\frac{\partial u(L,t)}{\partial x}[/tex]=0

I've been trying to solve this by separation of variables, and letting [tex]u(x,t)=T(t)X(x)[/tex]I get the two equations:

[tex]\frac{dT}{dt}+DT=a^{2}[/tex]
and
[tex]\frac{d^{2}X}{dx^{2}}+X=a^{2}[/tex]

Then for my solutions I get:
[tex]T(t)=C_{1}e^{-a^{2}Dt}[/tex]
and
[tex]X(x)=C_{2}sin(ax)+C_{3}cos(ax)[/tex]

so then,
[tex]u(x,t)=T(t)X(x)=C_{1}e^{-a^{2}Dt}(C_{2}sin(ax)+C_{3}cos(ax))[/tex]

To apply my boundary/initial conditions, I then differentiate wrt x, and obtain the three simultaneous equations:

[tex]C_{1}(C_{2}sin(ax)+C_{3}cos(ax))=0[/tex]
[tex]C_{2}C_{1}e^{-a^{2}Dt}=0[/tex]
[tex]C_{1}e^{-a^{2}Dt}(C_{2}cos(aL)-C_{3}sin(aL))=0[/tex]

When I try to solve this, I find that the only possible solutions are [tex]C_{1}=C_{2}=C_{3}=0[/tex] but that can't be right.

What am I missing?
 
Physics news on Phys.org
  • #2
Overall, everything looks pretty good.
I don't think the initial condition works however, if at t = 0, U = 0 for all x... then there is nothing to diffuse.
Also, C1 shouldn't be there, if you distribute C1 to the sin and cos term, its absorbed into C2 and C3 (so there should only be 2 constants of integration), in addition to the constant a (which should be Pi*n/L for some integer n) --> and the solutions should actually be a sum over all n (in general)
 
  • #3
First, note that you don't actually need [itex]C_1[/itex]. It can be absorbed into [itex]C_3[/itex] and [itex]C_2[/itex]. That said, the boundary conditions are not going to place constraints on the C's, but on your constant [itex]a[/itex]. i.e., what values of [itex]a[/itex] are permitted such that your boundary conditions are satisfied?

You don't want to be looking for conditions on the [itex]C_i[/itex], since you should find that there will be an infinite number of possible values of [itex]a \equiv a_n[/itex] that satisfy your boundary conditions, and the general solution to the problem will in fact be an infinite sum:

[tex]\sum_{n=0}^{\infty}e^{-a_n^2Dt}\left\{A_n \cos a_n x + B_n \sin a_n x \right\}[/tex]
 
  • #4
All right, everything you guys said makes sense, especially getting rid of one of the constants. But, I'm trying to apply this to a physical situation, so I need to find a way to get rid of the constants. There is nothing in the region of interest [0,L] at t=0, but at t>0, material diffuses thru the boundary regions into the region of interest. If [tex]a_{n}=\frac{n/pi}{L}[/tex], how do I go about finding the other constants?

The paper I'm looking at gives,
[tex]\lambda_{0}=0[/tex]
[tex]\lambda_{j}=(\frac{\pi j}{L})^{\frac{1}{2}}[/tex]
[tex]\psi_{0}(x)=(\frac{1}{L})^{\frac{1}{2}}[/tex]
[tex]\psi_{j}(x)=(\frac{2}{L})^{\frac{1}{2}})cos(\frac{\pi j x}{L})[/tex]

as eigenvalues and eigenfunctions. I thought these were obtained from the boundary and initial conditions, but apparently that isn't the case. I'm not seeing the eigenvalue equation that they derived these from...Where do these come from?
 
  • #5
strangequark said:
Hey all,
I'm wondering if someone can help me understand how to apply the boundary conditions to the diffusion equation in one dimension. Diffusion equation is:

[tex]\frac{\partial u}{\partial t}[/tex]=D*[tex]\frac{(\partial)^{2}u}{\partial x^{2}}[/tex]

The initial condition is:
[tex]u(x,0)=0[/tex]

And the boundary conditions are:
[tex]\frac{\partial u(0,t)}{\partial x}[/tex]=[tex]\frac{\partial u(L,t)}{\partial x}[/tex]=0

I've been trying to solve this by separation of variables, and letting [tex]u(x,t)=T(t)X(x)[/tex]I get the two equations:

[tex]\frac{dT}{dt}+DT=a^{2}[/tex]
and
[tex]\frac{d^{2}X}{dx^{2}}+X=a^{2}[/tex]

Then for my solutions I get:
[tex]T(t)=C_{1}e^{-a^{2}Dt}[/tex]
and
[tex]X(x)=C_{2}sin(ax)+C_{3}cos(ax)[/tex]

so then,
[tex]u(x,t)=T(t)X(x)=C_{1}e^{-a^{2}Dt}(C_{2}sin(ax)+C_{3}cos(ax))[/tex]

To apply my boundary/initial conditions, I then differentiate wrt x, and obtain the three simultaneous equations:

[tex]C_{1}(C_{2}sin(ax)+C_{3}cos(ax))=0[/tex]
[tex]C_{2}C_{1}e^{-a^{2}Dt}=0[/tex]
[tex]C_{1}e^{-a^{2}Dt}(C_{2}cos(aL)-C_{3}sin(aL))=0[/tex]

When I try to solve this, I find that the only possible solutions are [tex]C_{1}=C_{2}=C_{3}=0[/tex] but that can't be right.

What am I missing?
The first thing you should do is combine that "C1" into C2 and C3. What you really have is
[tex]u(x,t)=T(t)X(x)=e^{-a^{2}Dt}(C_{2}sin(ax)+C_{3}cos(ax))[/tex]
with two unknown constants, not 3. Now, since the derivatives are to be 0 and x=0, and the derivative of sin(ax) is cos(ax) which is NOT 0 and x= 0, yes, yes C2= 0. That leaves you with
[tex]u_x(L, t)= e^{-a^2Dt}(-aC_3 sin(aL))= 0[/itex]
which requires that C3 be 0 unless sin(aL)= 0. If aL is a multiple of [itex]\pi[/itex]: that is if [itex]a= n\pi/L[/itex], you have non-trivial solutions. THEN pick C3 to satisfy "initial condition".

Because that initial condition is u(x,0)= 0 for all x, you do, in fact, get u(x,t)= 0 as the solution. If the initial temperature is 0 and no heat can diffuse in or out, the temperature stays 0!
 
  • #6
lzkelley is right: with the boundary conditions you have specified, the answer is 0 at all times. Think of it this way: if u=0 at t=0, then du/dx = d^2u/dx^2 = 0. But then, by the diffusion equation, du/dt = 0, and so the solution cannot change with time.
 
  • #7
damn, I see what you're saying. Thanks for your help! I emailed the author of the paper in hopes that he can shed some light on how he obtained his solution.
 

1. What is the diffusion equation and why is it important in science?

The diffusion equation is a mathematical model used to describe the spread or dispersion of a substance over time. It is important in science because it can be applied to various fields such as physics, chemistry, biology, and engineering to understand and predict the behavior of diffusion processes in different systems.

2. What are boundary conditions in the context of the diffusion equation?

Boundary conditions refer to the limitations or constraints placed on the diffusion process, such as the initial concentration of the substance and the physical boundaries of the system. These conditions are necessary to accurately solve the diffusion equation and obtain a solution that represents the real-world scenario.

3. How do you solve the diffusion equation with boundary conditions?

Solving the diffusion equation with boundary conditions involves using mathematical techniques, such as separation of variables or Fourier transforms, to obtain a solution that satisfies the given boundary conditions. This solution can then be used to predict the behavior of the diffusion process in the system.

4. Can boundary conditions affect the solution of the diffusion equation?

Yes, boundary conditions can significantly affect the solution of the diffusion equation. For example, different boundary conditions can result in different concentration profiles over time, as well as different diffusion rates. It is crucial to accurately define and consider the boundary conditions when solving the diffusion equation.

5. Are there any real-world applications of solving the diffusion equation with boundary conditions?

Yes, the diffusion equation with boundary conditions has many practical applications, including drug delivery systems, air and water pollution modeling, and heat transfer in materials. By understanding and solving the diffusion equation with appropriate boundary conditions, scientists and engineers can make informed decisions and design efficient systems in various fields.

Similar threads

Replies
4
Views
1K
Replies
13
Views
2K
Replies
8
Views
2K
Replies
4
Views
1K
Replies
2
Views
1K
  • Differential Equations
Replies
22
Views
2K
  • Differential Equations
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
18
Views
1K
  • Differential Equations
Replies
3
Views
2K
  • Differential Equations
Replies
3
Views
2K
Back
Top