# Solving one dimension steady state heat equation with finite differences

1. Aug 1, 2012

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
and
(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. Aug 1, 2012

### haruspex

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.

3. Aug 10, 2012

### Staff: Mentor

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

4. Aug 12, 2012

### haruspex

Does this help?
T'' T' = b T' T4
(T')2 = 2b T5/5 + c
x = ∫(2b T5/5 + c)-1/2dT

5. Aug 12, 2012

### jackmell

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 $t_i$ and $t_i^'$ all the way down the line and for starters, just break it up into 10 intervals.

So you have:

$$t_{i+1}-2t_i+\frac{t_{i-1}}{0.1^2}=bt_i^4$$

as well as compute the derivative at each point:

$$d_i=\frac{3t_i-4 t_{i-1}+t_{i-2}}{0.2}$$

and then solve for the set $(t_i, d_i)$

Not sure though ok but it's a start and in math, starts are important. :)

6. Aug 13, 2012

### haruspex

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:
$$x = B^{-1}∫^1_{t=T}(t^5 - α^5)^{-1/2}dt$$
It remains to find $\hat{α}$ s.t.
$$B = ∫^1_{t=\hat{α}}(t^5 - \hat{α}^5)^{-1/2}dt$$
Consider
$$I(α) = ∫^1_{t=α}(t^5 - α^5)^{-1/2}dt$$
$$I(α/k) = ∫^1_{t=α/k}(t^5 - (α/k)^5)^{-1/2}dt = ∫^k_{t=α}((t/k)^5 - (α/k)^5)^{-1/2}d(t/k)$$
$$= k^{3/2}∫^k_{t=α}(t^5 - α^5)^{-1/2}dt$$
So we can proceed as follows:
Choose an arbitrary $α, \check{α}$ = 0.1 say.
Perform the integral $$F(k) = ∫^k_{t=\check{α}}(t^5 - \check{α}^5)^{-1/2}dt$$ 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 $\hat{α} = \check{α}/k$
Note that starting the calculation of the integral is interesting because the integrand is infinite initially. This can be managed by approximating
$$((α+δt)^5 - α^5)^{-1/2} = (5α^4δt)^{-1/2}$$
and integrating to produce
$$F(\check{α}+δt) = 2(5\check{α}^4δt)^{1/2}$$