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

Homework Help: Differential equation

  1. Feb 14, 2009 #1
    1. The problem statement, all variables and given/known data

    I'm pretty rusty at these. But given the following:


    3. The attempt at a solution

    The first one, naturally, is easy [tex]N_a(t)=N_a(0)e^\frac{-t}{\tau_a}[/tex]

    The second one is giving me a little trouble.

    I tried it as such:

    [tex]\frac{dN_b}{dt}=\frac{N_a\tau_b-N_b\tau_a}{\tau_a \tau_b}[/tex]

    [tex]\frac{dN_b}{N_a\tau_b-N_b\tau_a}=\frac{dt}{\tau_a \tau_b}[/tex]

    Let [tex]x=N_a\tau_b-N_b\tau_a[/tex]


    [tex]\frac{dx}{x\tau_a}=\frac{dt}{\tau_a \tau_b}[/tex]






    Now, at [tex]t=0[/tex], [tex]N_b(t=0)=N_{b0}[/tex]

    So [tex]x_0=N_a\tau_b-N_{b0}\tau_a[/tex]


    But I don't think that's right because it blows up. It's supposed to be a decay problem.

    Did I solve it correctly?
  2. jcsd
  3. Feb 14, 2009 #2
    I believe that is right.

    Now I'm trying to solve it using the Euler method...


    I get: [tex]N_b(t+\Delta{t})=N_b(t)-\Delta{t}*(\frac{N_a}{\tau_a}-\frac{N_b}{\tau_b})[/tex]

    And THAT blows up.
  4. Feb 14, 2009 #3


    User Avatar
    Science Advisor

    Instead use the solution to the first equation to write the equation as
    [tex]\frac{dN_b}{dt}+ \frac{N_b}{\tau_b}= \frac{N_a(0)}{\tau_a}e^\frac{-t}{\tau_a}[/tex]

    That's a linear non-homogeneous differential equation with constant coefficients. Its characteristic equation is [tex]r+ \frac{r}{\tau_b}= 0[/tex] and you can look for a specific solution of the entire equation of the form [tex]Ae^\frac{-t}{\tau_a}[/tex].

    You will find that has solutions with decreasing exponentials.

    Last edited by a moderator: Feb 14, 2009
  5. Feb 14, 2009 #4
    Finally got it right. I was right with my analytical solution, except for some sign errors. And it checks out with the Euler method solution. Here's a perl script that I wrote to test and illustrate:

    Code (Text):



        if($i > 0)
        printf("%f %f %f %f %f\n",$t,$Na,$Nae,$Nb,$Nbe);
    Thanks for your input.
  6. Feb 18, 2009 #5
    I guess it wasn't right. If I use different values for the decay constants my analytic solutions differs from the Euler solution.

    I don't know how to solve that.
  7. Feb 18, 2009 #6


    User Avatar
    Gold Member

    The solution to the characteristic equation posted is the argument of an exponential [tex]e^{\frac{1}{\tau_{b}}}[/tex]. This added with the particular solution of the form [tex]Ae^{\frac{-t}{\tau_{a}}}[/tex] will give you your general solution.

    Solving for the particular. Simply take the solution of the form [tex]Ae^{\frac{-t}{\tau_{a}}}[/tex], differentiate it, add them together and solve for the coefficients.

    I'll get you started:

    [tex]N = Ae^{\frac{-t}{\tau_a}}[/tex]
    [tex]N'= \frac{-1}{\tau_{a}}Ae^{\frac{-t}{\tau_{a}}}[/tex]

    Sum them [tex]N'+\frac{N}{\tau_{b}} = \frac{-1}{\tau_{a}}Ae^{\frac{-t}{\tau_{a}}}+\frac{1}{\tau_{b}}Ae^{\frac{-t}{\tau_{a}}}[/tex]

    Solve for coefficients [tex]A(\frac{-1}{\tau_{a}}+\frac{1}{\tau_{b}})= \frac{N_{a}(0)}{\tau_{b}}[/tex] and
    Last edited: Feb 18, 2009
  8. Feb 18, 2009 #7


    User Avatar
    Science Advisor

    What course is this for then? It is now a single non-homogeneous linear equation with constant coefficients. Much simpler than the original problem and much simpler than what you were trying to do.
  9. Feb 18, 2009 #8
    Computational Physics.

    The problem is to approximate the original system of differential equations using the Euler method, which I can do.

    I am now trying to solve it analytically so I can compare it with the Euler solution.
  10. Feb 18, 2009 #9


    User Avatar
    Gold Member

    Take a look at how I solved it...
  11. Feb 23, 2009 #10
    Shouldn't it be : [tex]N = Ae^{\frac{-t}{\tau_b}} [/tex]?
  12. Feb 23, 2009 #11


    User Avatar
    Gold Member

    No. Halls of Ivy showed you this result,


    Which in turn becomes

    \frac{dN_b}{dt}+ \frac{N_b}{\tau_b}= \frac{N_a(0)}{\tau_a}e^\frac{-t}{\tau_a}

    using this result, we get a non-homogeneous [tex]2^{nd}[/tex] order differentual equation with a particular solution [tex] Ae^{\frac{-t}{\tau_{a}}}[/tex]

    So we get a particular solution [tex]N_{p} = Ae^{\frac{-t}{\tau_{a}}}[/tex]

    then, [tex]N'=\frac{-1}{\tau_{a}}Ae^{\frac{-t}{\tau_{a}}} [/tex]

    We sum the 2 with your coefficient: [tex]N'+\frac{N}{\tau_{b}} = \frac{-1}{\tau_{a}}Ae^{\frac{-t}{\tau_{a}}}+\frac{1}{\tau_{b}}Ae^{\frac{-t}{\tau_{a}}} [/tex]

    Of course we solve for the coefficient A: [tex] A(\frac{-1}{\tau_{a}}+\frac{1}{\tau_{b}})= \frac{N_{a}(0)}{\tau_{b}} [/tex]

    Lets get a decent looking fraction first [tex] A(\frac{\tau_{a} - \tau_{b}}{\tau_{a} \tau_{b}})= \frac{N_{a}(0)}{\tau_{b}} [/tex]

    [tex] A = \frac{N_{a}(0)\tau_{a} \tau_{b}}{\tau_{b} (\tau_{a} - \tau_{b})} [/tex]

    [tex]N_{p}=\frac{N_{a}(0) \tau_{a} \tau_{b} e^{\frac{-t}{\tau_{a}}}}{\tau_{b} (\tau_{a} - \tau_{b})}[/tex]
    We have only solved the particular equation. Now we have to add it to the homogeneous equation.

    The characteristic is as Ivy showed is [tex] r+ \frac{1}{\tau_b}= 0 [/tex] Thus your [tex]N_{h} [/tex] homogeneous is [tex] N_{h}= C_{1}e^{\frac{-t}{\tau_{b}}[/tex]

    Now summing them to get a general solution...[tex]N_{g}=N_{h}+N_{p}[/tex] gives

    [tex]N_{g}= C_{1} e^{\frac{-t}{\tau_{b}}} + \frac{N_{a}(0) \tau_{a} \tau_{b} }{\tau_{b} (\tau_{a} - \tau_{b})}e^{\frac{-t}{\tau_{a}}}[/tex]

    Now use your initial conditions to find [tex]C_1[/tex]
    Last edited: Feb 23, 2009
  13. Feb 25, 2009 #12
    Well, that's quite a bit different than what I just got:


  14. Feb 25, 2009 #13
    There's a problem with this. If [tex]\tau_a = \tau_b[/tex], it blows up.
  15. Feb 25, 2009 #14


    User Avatar
    Gold Member

    Yea cus division by 0 doesn't usually go well in math =\
  16. Feb 25, 2009 #15


    User Avatar
    Gold Member

    Oh man I got mixed up with all these tau sub a's and tau sub b's the final answer is
    [tex]N_{g}= C_{1} e^{\frac{-t}{\tau_{b}}} + \frac{N_{a}(0) \tau_{a} \tau_{b} }{\tau_{a} (\tau_{a} - \tau_{b})}e^{\frac{-t}{\tau_{a}}}[/tex]

    (its the little [tex]\tau_{b}[/tex] before the bracket in the denominator that's wrong)
  17. Feb 26, 2009 #16
    Final solution that matches the Euler solution:


    But what can I do about that condition when [tex]\tau_a=\tau_b[/tex]?

    The function should not blow up.
  18. Feb 26, 2009 #17


    User Avatar
    Gold Member

    Check that condition on your original DE, then compare that result with the actual answers. Basically check to see if any other solutions were lost.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook