FD1D_HEAT
Finite Difference Solution in 1D
Time Dependent Heat Equation


FD1D_HEAT is a MATLAB program using double precision arithmetic, which solves the time-dependent 1D heat equation using the finite difference method in space, and a method of lines in time.

This program solves

        dUdT - k * d2UdX2 = F(X,T)
      
over the interval [A,B] with boundary conditions
        U(A,T) = UA(T),
        U(B,T) = UB(T),
      
over the time interval [T0,T1] with initial conditions
        U(X,T0) = U0(X)
      

A second order finite difference is used to approximate the second derivative in space.

Currently, there is only one solver available, which applies an explicit forward Euler approximation to the first derivative in time. It would be useful to include two more common and instructive variants, which involve a fully implicit backward Euler approximation, and the Crank-Nicholson approximation. These latter two methods have improved stability.

A second worthwhile change would be to replace the constant heat conductivity K by a function K(X,T). The spatial variation would allow for the modeling of a region divided into subregions of different materials.

Related Data and Programs:

FD1D is a MATLAB program which uses finite differences to solve a 1D predator prey problem.

FEM_50_HEAT is MATLAB program which applies the finite element method to solve the 2D heat equation.

FEM1D is a MATLAB program which applies the finite element method, with piecewise linear basis functions, to a linear two point boundary value problem;

FEM1D_ADAPTIVE is a MATLAB program which applies the finite element method to a linear two point boundary value problem in a 1D region, using adaptive refinement to improve the solution.

FEM1D_NONLINEAR is a MATLAB program which applies the finite element method to a nonlinear two point boundary value problem in a 1D region.

FEM1D_PMETHOD is a MATLAB program which applies the p-method version of the finite element method to a linear two point boundary value problem in a 1D region.

FEM2D_HEAT is a MATLAB program which applies the finite element method to solve the 2D heat equation.

FREE_FEM_HEAT is a MATLAB program which applies the finite element method to solve the time dependent heat equation in an arbitrary triangulated 2D region.

HOT_PIPE is a MATLAB program which uses FEM_50_HEAT to solve a heat problem in a pipe.

HOT_POINT is a MATLAB program which uses FEM_50_HEAT to solve a heat problem with a point source.

Reference:

  1. George Lindfield, John Penny,
    Numerical Methods Using MATLAB,
    Second Edition,
    Prentice Hall, 1999,
    ISBN: 0-13-012641-1,
    LC: QA297.P45.

Source Code:

A simple heat problem is defined by the following routines:

FD1D_HEAT_EXPLICIT solves the problem using an explicit method.

You can go up one level to the MATLAB source codes.


Last revised on 04 April 2008.