# Heat equation

• December 6th 2008, 02:49 AM
Rapha
Heat equation
Hello,

it is
$\frac{\partial u}{\partial t} = k*\frac{\partial^2 u}{\partial x^2}$ (as known as heat equation)

Show that

$\frac{\partial^2 u}{\partial x^2} \approx \frac{u(t,x_{i+1})-2u(t,x_i) + u(t,x_{i-1})}{h^2}$

Anyone knows how to show this?

Best Regards,
Rapha
• December 6th 2008, 03:01 AM
Laurent
Quote:

Originally Posted by Rapha
Show that

$\frac{\partial^2 u}{\partial x^2} \approx \frac{u(t,x_{i+1})-2u(t,x_i) + u(t,x_{i-1})}{h^2}$

Anyone knows how to show this?

For any twice differentiable function $f$, you have the asymptotic expansion: $f(x+h)=f(x)+f'(x)h+\frac{f''(x)}{2}h^2+o(h^2)$, and (substituting $-h$ for $h$): $f(x-h)=f(x)-f'(x)h+\frac{f''(x)}{2}h^2+o(h^2)$. Sum these expansions, and you get:
$f(x+h)+f(x-h)=2f(x)+f''(x)h^2+o(h^2)$,
and finally:
$f''(x)=\lim_{h\to 0}\frac{f(x+h)-2f(x)+f(x-h)}{h^2}$.

• December 6th 2008, 03:09 AM
mr fantastic
Quote:

Originally Posted by Rapha
Hello,

it is
$\frac{\partial u}{\partial t} = k*\frac{\partial^2 u}{\partial x^2}$ (as known as heat equation)

Show that

$\frac{\partial^2 u}{\partial x^2} \approx \frac{u(t,x_{i+1})-2u(t,x_i) + u(t,x_{i-1})}{h^2}$

Anyone knows how to show this?

Best Regards,
Rapha

This is a forward difference approximation.

Read this: Solution of the Diffusion Equation by Finite Differences
• December 6th 2008, 04:47 AM
Rapha
Hi

thank you Laurent,

thank you mr fantastic