# 30.6: 1D First Order Shape Functions


We can use (for instance) the direct stiffness method to compute degrees of freedom at the element nodes. However, we are also interested in the value of the solution at positions inside the element. To calculate values at positions other than the nodes we interpolate between the nodes using shape functions.

A one-dimensional element with length L is shown below. It has two nodes, one at each end, denoted i and j, and known nodal temperatures Ti and Tj. We can deduce automatically that the element is first order (linear) since it contains no ‘midside’ nodes.

One dimensional linear element with temperature degrees of freedom

We need to derive a function to compute values of the temperature at locations between the nodes. This interpolation function is called the shape function. We demonstrate its derivation for a 1-dimensional linear element here. Note that, for linear elements, the polynomial inerpolation function is first order. If the element was second order, the polynomial function would be second order (quadratic), and so on.

Since the element is first order, the temperature varies linearly between the nodes and the equation for T is:

$T(x) = a + bx$

We can therefore write:

$T_i = a + bX_i$

$T_j = a + bX_j$

which are simultaneous. To determine the coefficients a and b:

$\frac{T_i-a}{X_i} = b$

$\frac{T_j-a}{X_j} = b$

$\frac{T_i-a}{X_i} = \frac{T_j-a}{X_j}$

$(T_i-a)X_j = (T_j-a)X_i$

$T_iX_j - aX_j = T_jX_i - aX_i$

$T_iX_j - T_jX_i = a(X_j - X_i)$

$\frac{T_iX_j - T_jX_i}{(X_j - X_i)} = a$

$\frac{T_iX_j - T_jX_i}{L} = a$

and

$T_i - bX_i = a$

$T_j - bX_j = a$

$T_i - bX_i = T_j - bX_j$

$bX_j - bX_i = T_j - T_i$

$b(X_j - X_i) = T_j - T_i$

$b = \frac{T_j - T_i}{(X_j - X_i)}$

$b = \frac{T_j - T_i}{L}$

Substitution of Eqns.11 and 18 into Eqn.1 yields:

$T(x) = \frac{T_iX_j - T_jX_i}{L} + \frac{T_j - T_i}{L}x$

$T(x) = \frac{T_iX_j - T_jX_i}{L} + \frac{T_jx - T_ix}{L}$

$T(x) = \frac{T_iX_j}{L} - \frac{T_jX_i}{L} + \frac{T_jx}{L} - \frac{T_ix}{L}$

$T(x) = \frac{T_iX_j}{L} - \frac{T_ix}{L} + \frac{T_jx}{L} - \frac{T_jX_i}{L}$

$T(x) = T_i(\frac{X_j - x}{L}) + T_j(\frac{x - X_i}{L})$

It should be clear from Eqn.23 that the nodal temperature values are multiplied by linear functions of$$x$$– the shape functions. The functions are denoted by$$S$$with a subscript to indicate the node with which a specific shape function is associated. In the case presented:

$S_i = (\frac{X_j-x}{L})$

$S_j = (\frac{x-X_i}{L})$

And Eqn.23 becomes

$T(x) = S_iT_i + S_jT_j$

In matrix form

$T^e_x = \begin{bmatrix}S_i & S_j \end{bmatrix} \begin{Bmatrix}T_i \\ T_j \end{Bmatrix}$

For the case shown below, calculate T at x = 3.3.

1-dimensional linear element with known nodal temperatures and positions

$T(x = 3.3) = T_i(\frac{X_j-x}{L}) + T_j(\frac{x-X_i}{L})$

$T(x = 3.3) = 50(\frac{5-3.3}{2}) + 54(\frac{3.3-3}{2})$

From inspection of Eqn.26 we can deduce that each shape function has a value of 1 at its own node and a value of zero at the other nodes. The sum of the shape functions sums to one. The shape functions are also first order, just as the original polynomial was. The shape functions would have been quadratic if the original polynomial had been quadratic.

A continuous, piecewise smooth equation for the one dimensional fin first shown above can be constructed by connecting the linear element equations. We know that the temperature at any point in any element can be found from the nodal temperatures Ti and the shape functions Si. For the following system:

$\begin{matrix} T^e_x = S_iT_i + S_jT_j & X_i & \leq x \leq X_j \end{matrix}$

Node
Element # i j
1 1 2
2 2 3
3 3 4
4 4 5

$\begin{matrix} T^1_x = S^1_1X_1 + S^1_2X_2 & S^1_1 = \frac{X_2-x}{X_2-X_1} & S^1_2 = \frac{x-X_1}{X_2-X_1} & X_1 & \leq x \leq X_2 \end{matrix}$

$\begin{matrix} T^2_x = S^2_2X_2 + S^2_3X_3 & S^2_2 = \frac{X_3-x}{X_3-X_2} & S^2_3 = \frac{x-X_2}{X_3-X_2} & X_2 & \leq x \leq X_3 \end{matrix}$

$\begin{matrix} T^3_x = S^3_3X_3 + S^3_4X_4 & S^3_3 = \frac{X_4-x}{X_4-X_3} & S^3_4 = \frac{x-X_3}{X_4-X_3} & X_3 & \leq x \leq X_4 \end{matrix}$

$\begin{matrix} T^4_x = S^4_4X_4 + S^4_5X_5 & S^4_4 = \frac{X_5-x}{X_5-X_4} & S^3_4 = \frac{x-X_4}{X_5-X_4} & X_4 & \leq x \leq X_5 \end{matrix}$

$S^1_2 \neq S^2_2, S^2_3 \neq S^3_3, S^3_4 \neq S^4_4$

The temperature gradient through an individual element $$\frac{dT^e}{dx}$$ can be found from the derivative of Eqn.33

$T^e_x = T_i(\frac{X_j - x}{L}) + T_j(\frac{x - X_i}{L})$

$T^e_x = \frac{X_jT_i}{L} - \frac{xT_i}{L} + \frac{xT_j}{L} - \frac{X_iT_j}{L}$

$T^e_x = \frac{xT_j}{L} - \frac{xT_i}{L} + \frac{X_jT_i}{L} - \frac{X_iT_j}{L}$

$T^e_x = \frac{x}{L}(T_j - T_i) + \frac{1}{L}(X_jT_i - X_iT_j)$

such that

$\frac{dT^e_x}{dx} = \frac{T_j-T_i}{L}$

We can check that our shape functions are correct by knowing that the shape function derivatives sum to zero.

This page titled 30.6: 1D First Order Shape Functions is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Dissemination of IT for the Promotion of Materials Science (DoITPoMS).