fem1d_heat_steady, an Octave code which applies the finite element method (FEM), with piecewise linear elements, to solve the steady state (time independent) heat equation in one spatial dimension.
The finite element method is used with piecewise linear elements.
The steady state heat equation that is to be solved has the form:
- d/dx ( k(x) * du/dx ) = f(x)in the interval A < x < B. The functions k(x) and f(x) are given.
Boundary conditions are applied at the endpoints, and in this case, these are assumed to have the form:
u(A) = UA; u(B) = UB.
To compute a finite element approximation, a set of N equally spaced nodes is defined from A to B, a set of piecewise linear basis functions is set up, with one basis function associated with each node, and then the differential equation is multiplied by each basis function, and integration by parts is used to simplify the integrand.
A simple two point Gauss quadrature formula is used to estimate the resulting integrals over each interval.
u = fem1d_heat_steady ( n, a, b, ua, ub, @k, @f, x )where
The computer code and data files described and made available on this web page are distributed under the MIT license
fem1d_heat_steady is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version.
fd1d_heat_steady, an Octave code which applies the finite difference method to the steady state heat equation in one spatial dimension.
fem_neumann, an Octave code which sets up a time-dependent reaction-diffusion equation in 1d, with Neumann boundary conditions, discretized using the finite element method.
fem1d, a data directory which contains examples of 1d fem files, three text files that describe a 1d finite element model;
fem1d, an Octave code which applies the finite element method to a linear two point boundary value problem in a 1d region.
fem1d_adaptive, an Octave code 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_bvp_linear, an Octave code which applies the finite element method to a linear two point boundary value problem in a 1d region, using piecewise linear elements.
fem1d_nonlinear, an Octave code which applies the finite element method to a nonlinear two point boundary value problem in a 1d region.
fem1d_pmethod, an Octave code which applies the p-method version of the finite element method to a linear two point boundary value problem in a 1d region.