# Shape Functions

(Difference between revisions)
 Revision as of 16:12, 30 October 2009 (view source)JMora (Talk | contribs) (→The Three Node Linear Triangle)← Older edit Latest revision as of 18:43, 23 August 2011 (view source)JMora (Talk | contribs) (32 intermediate revisions by 2 users not shown) Line 212: Line 212: === The Three Node Linear Triangle === === The Three Node Linear Triangle === − :The solution $\varphi^{(e)} (x,y)$ for each element can be approached by their corresponding $\hat \varphi^{(e)} (x,y)$ to be expressed using the shape functions: + :The solution $\varphi^{(e)} (x,y)$ for each triangular element can be approached by their corresponding $\hat \varphi^{(e)} (x,y)$ to be expressed using the shape functions: − ::$\varphi^{(e)}(x,y) \cong \hat \varphi^{(e)} (x,y) = \sum_{i=1}^3 N_i (x,y) \varphi^{(e)}_i$ + ::$\varphi^{(e)}(x,y) \cong \hat \varphi^{(e)} (x,y) = \sum_{i=1}^n N_i (x,y) \varphi^{(e)}_i$ − :If the shape functions are lineal polynomials, this expression becomes: + :If the shape functions are lineal polynomials (three-node triangular element, n=3), and remembering: − ::$\hat \varphi^{(e)} (x) = \alpha_0 + \alpha_1 x + \alpha_2 y$ + ::$+ N_i^{(e)}(x_j,y_j) = + \begin{cases} + 1, & i = j \\ + 0, & i \ne j + \end{cases} +$ − [[Image:Three node triangle.jpg]] + :this expression can be written as: + + ::$N_i^{(e)} (x,y) = \frac{1}{2 A^{(e)}} \left [ a_i^{(e)} + b_i^{(e)} x + c_i^{(e)} y \right ] \qquad$      with $A^{(e)} \,$ the element area and   $i=1, 2, 3 \,$ + + + :And the system of equations is: + + + ::$+ \begin{bmatrix} + 1 & x_1^{(e)} & y_1^{(e)} \\ + 1 & x_2^{(e)} & y_2^{(e)} \\ + 1 & x_3^{(e)} & y_3^{(e)} + \end{bmatrix} + \begin{bmatrix} + a_1^{(e)} & a_2^{(e)} & a_3^{(e)} \\ + b_1^{(e)} & b_2^{(e)} & b_3^{(e)} \\ + c_1^{(e)} & c_2^{(e)} & c_3^{(e)} + \end{bmatrix} + = 2 ·A^{(e)}· + \begin{bmatrix} + 1 & 0 & 0 \\ + 0 & 1 & 0 \\ + 0 & 0 & 1 + \end{bmatrix} +$ + + + :The element area is computed as the half of the determinant of the coordinates matrix: + + + ::$2 ·A^{(e)} = + \begin{vmatrix} + 1 & x_1^{(e)} & y_1^{(e)} \\ + 1 & x_2^{(e)} & y_2^{(e)} \\ + 1 & x_3^{(e)} & y_3^{(e)} + \end{vmatrix} +$ + + + :[[Image:Three node triangle.jpg]] + + + :Finally, the different parameters can be expressed in terms of the nodal local coordinates as: + + + ::$a_i^{(e)}=x_j^{(e)}y_k^{(e)}-x_k^{(e)}y_j^{(e)}$ + + ::$b_i^{(e)}=y_j^{(e)}-y_k^{(e)}$ + + ::$c_i^{(e)}=x_k^{(e)}-x_j^{(e)}$ + + + :with  $i=1,2,3; \quad j=2,3,1; \quad k=3,1,2 \,$ + + + + For a more detailed description, visit [[Two-dimensional Shape Functions]] == Three-dimensional Shape Functions == == Three-dimensional Shape Functions == − [[Category:Theory]] + [[Category:Shape Functions]]

## Latest revision as of 18:43, 23 August 2011

The Shape Functions or basis fuctions[1] are used to obtain an approach solution ($\hat\varphi (x)$) to the exact solution ($\varphi (x)$) in the Finite Element Method as a lineal combination of some kind of well known functions $N_i(x) \frac{}{}$.

$\varphi (x) \cong \hat \varphi (x) = \sum_{i=0}^n N_i (x) a_i$

Some typical shape functions are:

1. Monomials[2]:
• $N_i (x) = x^i \frac{}{}$
• $\hat \varphi (x) = \sum_{i=0}^n a_i x^i = a_0 + \sum_{i=1}^n a_i x^i$
2. Fourier Functions[3]:
• $N_i (x) = sin ~ i x, cos ~ i x$
• $\hat \varphi (x) = \sum_{i=0}^n a_i sin ~ i x + \sum_{i=0}^n \beta_i cos ~ i x = a_0 + \sum_{i=1}^n a_i sin ~ i x + \sum_{i=1}^n \beta_i cos ~ i x$
3. Exponential Functions[4]:
• $N_i (x) = e^{bix} \frac{}{}$
• $\hat \varphi (x) = \sum_{i=0}^n a_i e^{bix}$

These functions can be defined:

• globally (to be applied over the whole domain $\Omega \frac{}{}$ of our problem); for example, using a polynomial function:
• $\varphi (x) \cong \hat \varphi (x) = a_0 + a_1 x + a_2 x^2 + ... + a_n x^n = \sum_{i=0}^n a_i x^i$
• note that the $n ~ a_i \frac{}{}$ values can be obtained if a set of $n ~ \varphi_i \frac{}{}$ values are known, typically for each point position ($x_i \frac{}{}$, what is called the node);
• or locally (in subdomains of $\Omega \frac{}{}$); :
• $\varphi (x) \cong \hat \varphi (x) = N_1^{(e)}(x) \varphi_1^{(e)} + N_2^{(e)}(x) \varphi_2^{(e)} + ... ~ + N_n^{(e)}(x) \varphi_n^{(e)} = \sum_{i=1}^n N_i^{(e)} (x) \varphi_i^{(e)}$
• $N_1^{(e)}(x), ..., N_n^{(e)}(x)$ are, in this case, the polynomial interpolation functions defined for each subdomain or element, and $\varphi_i^{(e)}$ is the value of the solution for each node i;
• each $N_i^{(e)}(x)=1$ in their corresponding node i, and $N_i^{(e)}(x)=0$ for the rest of the nodes;

Some important aspects to consider in the shape functions are:

• if they present continuity over the domain (or subdomain);
• if they respect the boundary conditions (for example, if $\Gamma_0=0\frac{}{}$, then $N_i(x_0)=0 \frac{}{}$);

## One-dimensional Shape Functions

A one-dimensional bar to be analysed using the finite element method (FEM) can be divided in N-1 elements (e) limited by their N nodes i:

The solution $\varphi^{(e)} (x)$ for each element can be approached by their corresponding $\hat \varphi^{(e)} (x)$ to be expressed using the shape functions:
$\varphi^{(e)}(x) \cong \hat \varphi^{(e)} (x) = \sum_{i=0}^1 N_i (x) \varphi_i$
If the shape functions are lineal polynomials, this expression becomes:
$\hat \varphi^{(e)} (x) = \sum_{i=0}^1 \alpha_i x^i = \alpha_0 + \alpha_1 x$

Note that $x^{(e)}_1$ and $x^{(e)}_2$ are the first and second nodal coordinates of the element (e), where the solution $\varphi^{(e)}_1$ and $\varphi^{(e)}_2$, respectively, has to be obtained.

\left . \begin{align} \hat \varphi^{(e)} (x_1) & = \varphi^{(e)}_1 = \alpha_0 + \alpha_1 x_1^{(e)} \\ \hat \varphi^{(e)} (x_2) & = \varphi^{(e)}_2 = \alpha_0 + \alpha_1 x_2^{(e)} \end{align} \right \} \Rightarrow \begin{bmatrix} 1 & x_1^{(e)} \\ 1 & x_2^{(e)} \end{bmatrix} \begin{bmatrix} \alpha_0 \\ \alpha_1 \end{bmatrix} = \begin{bmatrix} \varphi^{(e)}_1 \\ \varphi^{(e)}_2 \end{bmatrix}

\left . \begin{align} \alpha_0 & = \varphi^{(e)}_1 - \frac{\varphi^{(e)}_2 - \varphi^{(e)}_1}{x_2^{(e)}- x_1^{(e)}} x_1^{(e)} \\ \alpha_1 & = \frac{\varphi^{(e)}_2 - \varphi^{(e)}_1}{x_2^{(e)}- x_1^{(e)}} \end{align} \right \} \Rightarrow \hat \varphi^{(e)} (x) = \left( \varphi^{(e)}_1 - \frac{\varphi^{(e)}_2 - \varphi^{(e)}_1}{x_2^{(e)}- x_1^{(e)}} x_1^{(e)} \right) + \left( \frac{\varphi^{(e)}_2 - \varphi^{(e)}_1}{x_2^{(e)}- x_1^{(e)}} \right) x

This expression can be written in terms of the nodal values for the unknown:

$\hat \varphi^{(e)} (x) = \underbrace {\left( \frac{x^{(e)}_2 - x} {x_2^{(e)}- x_1^{(e)} }\right)}_{N_1^{(e)}(x)} \varphi^{(e)}_1 + \underbrace {\left( \frac{x - x^{(e)}_1}{x_2^{(e)}- x_1^{(e)}} \right)}_{N_2^{(e)}(x)} \varphi^{(e)}_2$

$\hat \varphi^{(e)} (x) = N_1^{(e)}(x) \varphi^{(e)}_1 + N_2^{(e)}(x) \varphi^{(e)}_2 = \sum_{i=1}^2 N_i^{(e)}(x) \varphi^{(e)}_i$

Therefore, the shape forms can be expressed in terms of the nodal coordinates:

\begin{align} N_1^{(e)}(x) & =\frac{x_2^{(e)} - x}{x_2^{(e)}-x_1^{(e)}} = \frac{x_2^{(e)} - x}{l^{(e)}} \\ N_2^{(e)}(x) & =\frac{x - x_1^{(e)}}{x_2^{(e)}-x_1^{(e)}} = \frac{x - x_1^{(e)}}{l^{(e)}} \end{align}

Again, note that the shape function corresponding to each node takes the unity value in that node and the zero value in the other:
$N_1^{(e)}(x) = \begin{cases} 1, & x=x_1 \\ 0, & x=x_2 \end{cases} \qquad N_2^{(e)}(x) = \begin{cases} 0, & x = x_1 \\ 1, & x = x_2 \end{cases}$

More than two nodes can be used for each element. The following images show the shape functions for the quadratic (three nodes for each element) and cubic (four nodes for each element) case:
A detailed description of how to obtain these shape functions can help to understand the great importance of selecting the right order.

### One-dimensional Lagrangian Elements

The shape functions based in this kind of polynomials, equivalents to the polynomial Lagrange[5], give the name to a particular set of finite elements called the Lagrangian elements.
For this case, the shape functions can be written:
$N_i^{(e)}(x)=\frac{(x - x_1)(x - x_2)... (x - x_{i-1})(x - x_{i+1})...(x - x_n)}{(x_i - x_1)(x_i - x_2)... (x_i - x_{i-1})(x_i - x_{i+1})...(x_i - x_n)}$

$N_i^{(e)}(x) = \prod_{j=1 (j \ne i)}^n \frac{x - x_j}{x_i - x_j}$

These expressions can be normalised using the natural coordinate system, based in $\frac{}{} \xi$, a variable defined in terms of $\frac{}{} x_c$, the central coordinate of the element, as follows:

$\xi = 2 \frac{x - x_c}{l^{(e)}}$

Note that $\frac{}{} \xi = -1$ in the left node, $\frac{}{} \xi = 0$ in the central point of the element, and $\frac{}{} \xi = 1$ in the right node of the element.

For the Linear case, this transformation can be illustrated:

In this way, all the shape functions can be expressed and, therefore obtained, independently of the real geometry, and then easier to implement.

$N_i^{(e)}(\xi) = \prod_{j=1 (j \ne i)}^n \left( \frac{\xi - \xi_j}{\xi_i - \xi_j} \right)$

The final specific expressions for the 1D Linear element are:

$N_1^{(e)}(\xi) = \frac {\xi - \xi_2}{\xi_1 - \xi_2} = \frac{1}{2} (1 - \xi)$
$N_2^{(e)}(\xi) = \frac {\xi - \xi_1}{\xi_2 - \xi_1} = \frac{1}{2} (1 + \xi)$

Check other normalised shape functions for higher order elements.

## Two-dimensional Shape Functions

### The Three Node Linear Triangle

The solution $\varphi^{(e)} (x,y)$ for each triangular element can be approached by their corresponding $\hat \varphi^{(e)} (x,y)$ to be expressed using the shape functions:
$\varphi^{(e)}(x,y) \cong \hat \varphi^{(e)} (x,y) = \sum_{i=1}^n N_i (x,y) \varphi^{(e)}_i$
If the shape functions are lineal polynomials (three-node triangular element, n=3), and remembering:
$N_i^{(e)}(x_j,y_j) = \begin{cases} 1, & i = j \\ 0, & i \ne j \end{cases}$
this expression can be written as:
$N_i^{(e)} (x,y) = \frac{1}{2 A^{(e)}} \left [ a_i^{(e)} + b_i^{(e)} x + c_i^{(e)} y \right ] \qquad$     with $A^{(e)} \,$ the element area and   $i=1, 2, 3 \,$

And the system of equations is:

$\begin{bmatrix} 1 & x_1^{(e)} & y_1^{(e)} \\ 1 & x_2^{(e)} & y_2^{(e)} \\ 1 & x_3^{(e)} & y_3^{(e)} \end{bmatrix} \begin{bmatrix} a_1^{(e)} & a_2^{(e)} & a_3^{(e)} \\ b_1^{(e)} & b_2^{(e)} & b_3^{(e)} \\ c_1^{(e)} & c_2^{(e)} & c_3^{(e)} \end{bmatrix} = 2 ·A^{(e)}· \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}$

The element area is computed as the half of the determinant of the coordinates matrix:

$2 ·A^{(e)} = \begin{vmatrix} 1 & x_1^{(e)} & y_1^{(e)} \\ 1 & x_2^{(e)} & y_2^{(e)} \\ 1 & x_3^{(e)} & y_3^{(e)} \end{vmatrix}$

Finally, the different parameters can be expressed in terms of the nodal local coordinates as:

$a_i^{(e)}=x_j^{(e)}y_k^{(e)}-x_k^{(e)}y_j^{(e)}$
$b_i^{(e)}=y_j^{(e)}-y_k^{(e)}$
$c_i^{(e)}=x_k^{(e)}-x_j^{(e)}$

with  $i=1,2,3; \quad j=2,3,1; \quad k=3,1,2 \,$

For a more detailed description, visit Two-dimensional Shape Functions