The Heat Equation in One Dimension
The heat equation in one dimension is:
\[
\frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2}
\]
Step 1: Discretize the Space and Time Domains
Let:
\[
x_i = i \cdot h \quad \text{for } i = 0, 1, 2, \ldots, N
\]
where \( h \) is the spatial step size.
\[
t_n = n \cdot \Delta t \quad \text{for } n = 0, 1, 2, \ldots
\]
where \( \Delta t \) is the time step size.
\( u_{i}^{n} \) represents the temperature at position \( x_i \)
and time \( t_n \).
Step 2: Discretize the Spatial Derivative
The second spatial derivative can be approximated using the central difference method:
\[
\frac{\partial^2 u}{\partial x^2} \approx \frac{u_{i+1}^{n} - 2u_{i}^{n} + u_{i-1}^{n}}{h^2}
\]
Step 3: Discretize the Time Derivative
The time derivative can be approximated using the forward difference method:
\[
\frac{\partial u}{\partial t} \approx \frac{u_{i}^{n+1} - u_{i}^{n}}{\Delta t}
\]
Step 4: Substitute into the Heat Equation
Substituting the finite difference approximations of the time and space derivatives into the heat equation gives:
\[
\frac{u_{i}^{n+1} - u_{i}^{n}}{\Delta t} = k \frac{u_{i+1}^{n} - 2u_{i}^{n} + u_{i-1}^{n}}{h^2}
\]
Step 5: Solve for \( u_{i}^{n+1} \)
To derive the recursive relation, solve the above equation for \( u_{i}^{n+1} \), the temperature at the next time step:
\[
u_{i}^{n+1} = u_{i}^{n} + \frac{k \Delta t}{h^2} \left( u_{i+1}^{n} - 2u_{i}^{n} + u_{i-1}^{n} \right)
\]
Step 6: Stability Condition (CFL Condition)
To ensure numerical stability, the time step \( \Delta t \) must satisfy the Courant-Friedrichs-Lewy (CFL) condition:
\[
\Delta t \leq \frac{h^2}{2k}
\]
Final Recursive Relation
Thus, the recursive relation for the 1D heat equation is:
\[
u_{i}^{n+1} = u_{i}^{n} + \alpha \left( u_{i+1}^{n} - 2u_{i}^{n} + u_{i-1}^{n} \right)
\]
Where \( \alpha = \frac{k \Delta t}{h^2} \) is the constant that governs the diffusion rate.