User:EML5526.S11.Team3.vnarayanan/Homework5

Problem Statement
Plot the Lagrangian Element basis function in case of a Quadratic element for the individual node and a combined plot.

Solution
A quadratic element has 3 nodes. Hence,

$$\;\;n = 3\;\;$$



For convenience we take

$$x_{1} = -1\; ; x_{2} = 0\; ;x_{3} = 1$$

The Lagrangian Interpolation Basis Function is given by,
 * {| style="width:100%" border="0"

$$\displaystyle
 * style="width:92%; padding:10px; border:2px solid #ff0000" |
 * style="width:92%; padding:10px; border:2px solid #ff0000" |

L_{i,n}(x) = \prod_{k = 1}^{m}\frac{x-x_{k}}{x_{i}-x_{k}}\;\; k\neq i

$$
 * }

$$L_{1,3}(x) = \frac{(x-x_{2})(x-x_{3})}{(x_{1}-x_{2})(x_{1}-x_{3})} = \frac{(x-0)(x-1)}{(-1-0)(-1-1)} = \frac{x(x-1)}{2} = \frac{x^2-x}{2}$$

$$L_{2,3}(x) = \frac{(x-x_{1})(x-x_{3})}{(x_{2}-x_{1})(x_{2}-x_{3})} = \frac{(x-(-1))(x-1)}{(0+1)(0-1)} = \frac{(x+1)(x-1)}{-1} = 1-x^2$$

$$L_{3,3}(x) = \frac{(x-x_{1})(x-x_{2})}{(x_{3}-x_{1})(x_{3}-x_{2})} = \frac{(x-(-1))(x-0)}{(1+1)(1-0)}  = \frac{(x+1)(x)}{2} = \frac{x^2+x}{2}$$

Using the above expressions, the plots of the basis functions were developed using Matlab