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

Non-homogenous ODE, non-homogenous boundaries

  1. Jul 11, 2011 #1
    I've made a lot of simplifications to a Joule-heating problem I'm working on. I'm struggling to solve the following one-dimensional, one variable ODE:

    Txx + aT = -b

    with boundary conditions

    T(x=0) = Ts (Dirichlet)
    Tx(x=L) = 0 (Neumann)

    I've learned that this is a non-homogeneous ODE with non-homogenous boundaries. I've tried using FDM to solve them and then fitting the data to a function, but I didn't get far.

    I would love some help on this. I have much more experience with numerical analysis than analytical. I really need a math-wiz's help.
  2. jcsd
  3. Jul 11, 2011 #2
    I apologize for being to lazy to work out where this really comes from, but here's the solution Mathematica gives:

    T(x)\to \frac{1}{a}\left(-b \cot \left(\sqrt{a} L\right) \sin \left(\sqrt{a} x\right)+b \csc \left(\sqrt{a} L\right) \sin \left(\sqrt{a} x\right)+b \cos \left(\sqrt{a} x\right)-a T_s \cot \left(\sqrt{a} L\right) \sin \left(\sqrt{a} x\right)+a T_s \cos \left(\sqrt{a} x\right)-b\right)
  4. Jul 12, 2011 #3
    pmsrw3, very close!!! Please see the following two plots:

    The equation you gave models the homogenous boundary problem exactly, which is:

    Txx + aT = -b, T(x=0) = Ts, T(x=L) = 0 (first plot)

    What I need is the solution to the NON-homogenous boundary problem:

    Txx + aT = -b, T(x=0) = Ts, Tx(x=L) = 0 (second plot)

    the difference being that the x=L boundary is Neumann, not Dirichlet.

    Can you do what you did again with this Newmann boundary???

    Almost there!

    Attached Files:

  5. Jul 12, 2011 #4
    Oops, sorry. I must have left out a '.

    T(x)\to \frac{(a T_s+b) \sec \left(\sqrt{a} L\right) \cos \left(\sqrt{a} (L-x)\right)-b}{a}[/tex]
  6. Jul 12, 2011 #5
    I simultaneously found the solution. The form is

    T(x) = C1*cos(sqrt(a)*x) + C2*sin(sqrt(a)*x) - b/a

    where C1 = Ts + b/a, C2 = C1*tan(sqrt(a)*L)

    Your solution looks like it takes this form after some trig flexing.


    Attached Files:

  7. Jul 12, 2011 #6
    What do you get when a is negative?
  8. Jul 12, 2011 #7
    The same result will work. [itex]\sqrt{a}[/itex] is imaginary, but it all works out real in the end. [itex]\cos(i\alpha) = \cosh(\alpha), \sec(i\alpha) = \text{sech}(\alpha)[/itex].

    If you want it written in terms of explicitly real functions: Letting alpha = -a, assuming alpha > 0, and solving [itex]T''(x)-\alpha T(x)=-b[/itex], I get

    T(x)\to \frac{e^{\sqrt{\alpha } (-x)} \left(\alpha T_s \left(e^{2 \sqrt{\alpha } L}+e^{2 \sqrt{\alpha } x}\right)-b \left(e^{\sqrt{\alpha } x}-1\right) \left(e^{\sqrt{\alpha } x}-e^{2 \sqrt{\alpha } L}\right)\right)}{\alpha \left(e^{2 \sqrt{\alpha } L}+1\right)}
  9. Jul 12, 2011 #8
    Thanks! Thread closed!
  10. Jul 14, 2011 #9
    pmsrw3: Last one...

    Quickly, can you do:

    y'' = 0
    y'(x=0) = inf
    y(x=L) = a

    I don't know if this is possible.

  11. Jul 14, 2011 #10
    I don't need to run that one -- it obviously doesn't have a solution. y'' = 0 says y' is the same everywhere. y' is infinite at 0, so it's infinite everywhere. Obviously this does not have a finite solution.
  12. Jul 14, 2011 #11
    I FDM'ed this too and I agree. For some reason it wasn't obvious to me at first. Thanks.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook