FEM1D_HEAT_EXPLICIT
Finite Element Solution of the
Time Dependent 1D Heat Equation
using Explicit Time Stepping


FEM1D_HEAT_EXPLICIT is a Python library which solves the time-dependent 1D heat equation, using the finite element method in space, and an explicit version of the method of lines to handle integration 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)
      

The spatial derivatives are approximated using the finite element method, with piecewise linear elements.

The solver applies an explicit forward Euler approximation to the first derivative in time.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

FEM1D_HEAT_EXPLICIT is available in a MATLAB version and a Python version.

Related Data and Programs:

FD1D_HEAT_EXPLICIT, a Python library which uses the finite difference method and explicit time stepping to solve the time dependent heat equation in 1D.

FEM1D_BVP_LINEAR, a Python program which applies the finite element method (FEM), with piecewise linear elements, to a two point boundary value problem (BVP) in one spatial dimension, and compares the computed and exact solutions with the L2 and seminorm errors.

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:

Examples and Tests:

TEST01 runs with initial condition 50 everywhere, boundary conditions of 90 on the left and 70 on the right, and no right hand side source term.

TEST02 uses an exact solution of g(x,t) = exp ( - t ) .* sin ( sqrt ( k ) * x ).

TEST03 runs on the interval -5 <= X <= 5, with initial condition 15 on the entire left and 25 on the entire right. The solution should settle down to a straight line from the left boundary to the right.

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


Last revised on 07 November 2014.