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

Solving one dimension steady state heat equation with finite differences

  1. Aug 1, 2012 #1
    I have a project where I need to solve

    T''(x) = bT^4 ; 0<=x<=1
    T(0) = 1
    T'(1) = 0

    using finite differences to generate a system of equations in Matlab and solve the system to find the solution

    So far I have:
    (using centred 2nd degree finite difference)
    T''(x) = (T(x+h) - 2T(x) + T(x-h)) / h^2 = bT(x)^4
    (using 2 order backward difference)
    T'(x) = (3T(x) - 4T(x-h) + T(x-2h)) / 2h

    I just don't know how to write the code that will make the system of n non-linear equations to solve. I have a function that will solve them if I can get there...

    any help or nudge in the right direction is appreciated
  2. jcsd
  3. Aug 1, 2012 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Are you sure the equation is right? Doesn't look like any heat equation I know. It looks like a diffusion equation on the left and a radiation equation on the right.
  4. Aug 10, 2012 #3
    This is a steady state heat conduction/radiation problem. The non-linearity is a difficulty. You might try to solve it as a transient heat conduction/radiation problem by addition a time derivative to the equation in the appropriate place, and solving for how the temperature varies with time as x. Here, you would use the so-called Method of Lines. You might try an explicit finite differencing approach, and, with small enough time steps should get convergence. Alternately, you could try an implicit method (temperatures at forward time step), and use an automatic package ODE solver to do the integration. For this problem, the non-stiff option should be adequate. Try as the initial condition T = (1-x)^2
  5. Aug 12, 2012 #4


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Does this help?
    T'' T' = b T' T4
    (T')2 = 2b T5/5 + c
    x = ∫(2b T5/5 + c)-1/2dT
  6. Aug 12, 2012 #5
    Yeah me neither but I got an idea before I try to find it in a book. How about you solve for both the values of [itex]t_i[/itex] and [itex]t_i^'[/itex] all the way down the line and for starters, just break it up into 10 intervals.

    So you have:


    as well as compute the derivative at each point:

    [tex]d_i=\frac{3t_i-4 t_{i-1}+t_{i-2}}{0.2}[/tex]

    and then solve for the set [itex](t_i, d_i)[/itex]

    Not sure though ok but it's a start and in math, starts are important. :)
  7. Aug 13, 2012 #6


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Assuming you just want to solve the equation numerically, whether using Matlab or otherwise....
    x = ∫(2b t5/5 + c)-1/2dt
    Writing B2 = 2b/5, T'(1) = 0 implies c = -B2α5, where α = T(1). T(0) = 1 gives:
    [tex]x = B^{-1}∫^1_{t=T}(t^5 - α^5)^{-1/2}dt[/tex]
    It remains to find [itex]\hat{α}[/itex] s.t.
    [tex]B = ∫^1_{t=\hat{α}}(t^5 - \hat{α}^5)^{-1/2}dt[/tex]
    [tex]I(α) = ∫^1_{t=α}(t^5 - α^5)^{-1/2}dt[/tex]
    [tex]I(α/k) = ∫^1_{t=α/k}(t^5 - (α/k)^5)^{-1/2}dt = ∫^k_{t=α}((t/k)^5 - (α/k)^5)^{-1/2}d(t/k)[/tex]
    [tex] = k^{3/2}∫^k_{t=α}(t^5 - α^5)^{-1/2}dt[/tex]
    So we can proceed as follows:
    Choose an arbitrary [itex]α, \check{α}[/itex] = 0.1 say.
    Perform the integral [tex]F(k) = ∫^k_{t=\check{α}}(t^5 - \check{α}^5)^{-1/2}dt[/tex] stepwise on k. At each step, check whether F(k)k3/2 exceeds B. When it does, backtrack one step and binary chop the last step size to refine the value of k. Then [itex]\hat{α} = \check{α}/k[/itex]
    Note that starting the calculation of the integral is interesting because the integrand is infinite initially. This can be managed by approximating
    [tex]((α+δt)^5 - α^5)^{-1/2} = (5α^4δt)^{-1/2}[/tex]
    and integrating to produce
    [tex]F(\check{α}+δt) = 2(5\check{α}^4δt)^{1/2}[/tex]
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook