Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

1-d diffusion

  1. Apr 24, 2008 #1
    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:

    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 seperation of variables, and letting [tex]u(x,t)=T(t)X(x)[/tex]I get the two equations:


    Then for my solutions I get:

    so then,

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


    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?
  2. jcsd
  3. Apr 24, 2008 #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)
  4. Apr 24, 2008 #3


    User Avatar
    Homework Helper

    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]
  5. Apr 24, 2008 #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_{j}=(\frac{\pi j}{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?
  6. Apr 25, 2008 #5


    User Avatar
    Science Advisor

    The first thing you should do is combine that "C1" into C2 and C3. What you really have is
    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!
  7. Apr 25, 2008 #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.
  8. Apr 26, 2008 #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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook