Numerical methods

FEM Shape functions

  1. What are shape functions?
    • Definition and application
    • Conditions that shape functions must satisfy
  2. Calculation of shape functions for a triangular element
    • Node 1
    • Node 2
    • Node 3
  3. Matrix notation
    • Equivalent computational notation
    • Verification of the sum of shape functions
    • Matrix representation of equations

What are shape functions?

Funkcje kształtu - wprowadzenie

Shape functions of a given element describe the distribution of parameters within the finite element.

What does this mean in practice?

If we calculate, using FEM, for example, the displacement values at the nodes of a triangular finite element, it does not mean that we know the displacement of any point within that element. Therefore, we need to perform interpolation of our results.

Shape functions must satisfy the following conditions:

  1. At the i-th node (which is the one we are currently calculating with respect to), it must equal one
  2. At the remaining nodes, it must equal zero
  3. The sum of the shape functions is ALWAYS equal to one

Calculation of shape functions for a triangular element

Element trójkątny - funkcje kształtu

It directly follows from the above how we can determine the shape functions for any element.

We write the functions \(N(x,y)=A\cdot x+B\cdot y+C\) for each node and solve the resulting systems of equations

Node 1

\[ \begin{aligned} &N_i(x, y)=A \cdot x+B \cdot y+C \\ &N_1(0,2)=A \cdot 0+B \cdot 2+C=1 \\ &N_1(1,0)=A \cdot 1+B \cdot 0+C=0 \\ &N_1(2,2)=A \cdot 2+B \cdot 2+C=0 \\ &A=-\frac{1}{2} \\ &B=\frac{1}{4} \\ &C=\frac{1}{2} \\ &N_1(x, y)=\frac{-1}{2} x+\frac{1}{4} y+\frac{1}{2} \end{aligned} \]

Node 2

\[ \begin{aligned} &N_j(x, y)=A \cdot x+B \cdot y+C \\ &N_2(0,2)=A \cdot 0+B \cdot 2+C=0 \\ &N_2(1,0)=A \cdot 1+B \cdot 0+C=1 \\ &N_2(2,2)=A \cdot 2+B \cdot 2+C=0 \\ &A=0 \\ &B=\frac{-1}{2} \\ &C=1 \\ &N_2(x, y)=\frac{-1}{2} y+1 \end{aligned} \]

Node 3

\[ \begin{aligned} &N_k(x, y)=A \cdot x+B \cdot y+C \\ &N_3(0,2)=A \cdot 0+B \cdot 2+C=0 \\ &N_3(1,0)=A \cdot 1+B \cdot 0+C=0 \\ &N_3(2,2)=A \cdot 2+B \cdot 2+C=1 \\ &A=\frac{1}{2} \\ &B=\frac{1}{4} \\ &C=\frac{-1}{2} \\ &N_3(x, y)=\frac{1}{2} x+\frac{1}{4} y-\frac{1}{2} \end{aligned} \]

Matrix notation

In practice, if we calculate shape functions using a computer rather than on paper/with a pen/calculator, it makes much more sense to use the equivalent notation:

\[ \begin{aligned} & {\left[\begin{array}{ll} x_1 & y_1 \\ x_2 & y_2 \\ x_3 & y_3 \end{array}\right]=\left[\begin{array}{ll} 0 & 2 \\ 1 & 0 \\ 2 & 2 \end{array}\right]} \\ & {\left[\begin{array}{lll} a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \\ c_1 & c_2 & c_3 \end{array}\right]=\left[\begin{array}{lll} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{array}\right]^{-1} \rightarrow\left[\begin{array}{ccc} -\frac{1}{2} & 0 & \frac{1}{2} \\ \frac{1}{4} & -\frac{1}{2} & \frac{1}{4} \\ \frac{1}{2} & 1 & -\frac{1}{2} \end{array}\right]} \\ & N_1(x, y)=a_1 \cdot x+b_1 \cdot y+c_1 \rightarrow \frac{y}{4}+\left(\frac{1}{2}-\frac{x}{2}\right) \\ & N_2(x, y)=a_2 \cdot x+b_2 \cdot y+c_2 \rightarrow-\frac{y}{2}+1 \\ & N_3(x, y)=a_3 \cdot x+b_3 \cdot y+c_3 \rightarrow \frac{y}{4}+\left(\frac{x}{2}-\frac{1}{2}\right) \end{aligned} \]

As can be seen, the results are unambiguous, and in both cases, the sum of the shape functions is one:

\[ \begin{aligned} & N_1(x, y)+N_2(x, y)+N_3(x, y)=1 \\ & \frac{y}{4}+\frac{1}{2}-\frac{x}{2}-\frac{y}{2}+1+\frac{y}{4}+\frac{x}{2}-\frac{1}{2}=1 \end{aligned} \]

The unambiguity of the results arises, of course, from the fact that the second approach is nothing more than a matrix representation of the equations from the first approach:

\[ \begin{aligned} N_1 = a_1x + b_1y + c_1 \end{aligned} \] \[ \begin{aligned} \begin{bmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{bmatrix} \begin{bmatrix} a_1 \\ b_1 \\ c_1 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} a_1 \\ b_1 \\ c_1 \end{bmatrix} \begin{bmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{bmatrix}^{-1} \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \end{aligned} \] \[ \begin{aligned} N_2 = a_2x + b_2y + c_2 \end{aligned} \] \[ \begin{aligned} \begin{bmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{bmatrix} \begin{bmatrix} a_2 \\ b_2 \\ c_2 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} = \begin{bmatrix} a_2 \\ b_2 \\ c_2 \end{bmatrix} \begin{bmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{bmatrix}^{-1} \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} \end{aligned} \] \[ \begin{aligned} N_3 = a_3x + b_3y + c_3 \end{aligned} \] \[ \begin{aligned} \begin{bmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{bmatrix} \begin{bmatrix} a_3 \\ b_3 \\ c_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} a_3 \\ b_3 \\ c_3 \end{bmatrix} \begin{bmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{bmatrix}^{-1} \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \end{aligned} \] \[ \begin{aligned} \begin{bmatrix} a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \\ c_1 & c_2 & c_3 \end{bmatrix} = \begin{bmatrix} x_1 & y_1 & 1 \\ x_2 & y_2 & 1 \\ x_3 & y_3 & 1 \end{bmatrix}^{-1} \end{aligned} \]
FEM Shape functions