fem1d_heat_steady, a MATLAB code which applies the finite element method, 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.

### Usage:

u = fem1d_heat_steady ( n, a, b, ua, ub, @k, @f, x )
where
• n is the number of equally spaced nodes.
• a, b are the left and right endpoints.
• ua, ub are the prescribed values of U at the endpoints;
• @k is the function which evaluates k(x);
• @f is the function which evaluates f(x).
• x is the input vector of n nodes.
• u is the output vector of n values at the nodes, which can also be regarded as the finite element coefficients.

### Languages:

fem1d_heat_steady is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

fd1d_heat_steady, a MATLAB code which applies the finite difference method to the steady state heat equation in one spatial dimension.

fem_neumann, a MATLAB 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, a MATLAB code which applies the finite element method to a linear two point boundary value problem in a 1d region.

fem1d_adaptive, a MATLAB 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, a MATLAB 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, a MATLAB code which applies the finite element method to a nonlinear two point boundary value problem in a 1d region.

fem1d_pmethod, a MATLAB code which applies the p-method version of the finite element method to a linear two point boundary value problem in a 1d region.

### Reference:

1. Dianne O'Leary,
Finite Differences and Finite Elements: Getting to Know You,
Computing in Science and Engineering,
Volume 7, Number 3, May/June 2005.
2. Dianne O'Leary,
Scientific Computing with Case Studies,
SIAM, 2008,
ISBN13: 978-0-898716-66-5,
LC: QA401.O44.
3. Hans Rudolf Schwarz,
Finite Element Methods,
ISBN: 0126330107,
LC: TA347.F5.S3313.
4. Gilbert Strang, George Fix,
An Analysis of the Finite Element Method,
Cambridge, 1973,
ISBN: 096140888X,
LC: TA335.S77.
5. Olgierd Zienkiewicz,
The Finite Element Method,
Sixth Edition,
Butterworth-Heinemann, 2005,
ISBN: 0750663200,
LC: TA640.2.Z54

### Source Code:

Last revised on 20 January 2019.