User:Eml5526.s11.team7.jb/work57p2

Solution
The Lagrangian Element Basis Function (LEBF) is given by the following equation and generates a polynomial of degree $$\displaystyle n-1$$:


 * $$L_{i,n}\left (x\right )=\prod_{k=1}^{n}\frac{x-x_{k}}{x_{i}-x_{k}},k\neq i$$

For a linear function the number of nodes is 2 ($$\displaystyle n=2$$). For uniform discretization with $$\displaystyle nel=4$$ the domain $$\displaystyle \Omega$$ will be subdivided into 4 equal length elements each having two nodes. The LEBFs for the first element $$\displaystyle n=1$$ over the elemental domain $$\displaystyle \omega^{(1)}=[0,.25]$$ can be written as follows:


 * $$L_{1,2}^{(1)}\left (x\right)=b_{1}^{(1)}=\frac{(x-x_2)}{x_1-x_2}=\frac{(x-.25)}{0-.25}=-4(x-.25)$$


 * $$L_{2,2}^{(1)}\left (x\right)=b_{2}^{(1)}=\frac{(x-x_1)}{x_2-x_1}=\frac{(x-0)}{.25-0}=4(x)$$

Recall the constraint breaking solution (CBS) states the basis functions must satisfy $$\displaystyle \left\{ b_i(x), i=0,1,2,...\right\}$$ such that $$\displaystyle b_0(\beta) \neq 0$$ and $$\displaystyle b_i(\beta) = 0$$ for $$\displaystyle i=1,2,...,n$$.

It can be seen that these basis functions for the first element satisfy the CBS at each node. For the first node, the basis function has a value of one at that node and a value of zero at every other node (there is only one other node for the linear LEBF). In other words the basis function is equal to the kronicker delta at each node.


 * $$b_{1}^{(1)}(\beta^{(1)}_1)=L_{1,2}^{(1)}\left (0\right)=b_{1}^{(1)}(0)=-4(0-.25)=1$$


 * $$L_{1,2}^{(1)}\left (.25\right)=b_{1}^{(1)}(.25)=-4(.25-.25)=0$$

Similarly for the second node, the basis function has a value of one at that second node and a value of zero at the first node.

A Matlab script was written to plot the LEBFs at each node for each element. The Matlab script is given followed by the plots. The first plot shows each of the LEBFs plotted across the entire domain. The second plot is more informative as the plot is divided into the elemental domains and lines corresponding to the values zero and one are present. The legend states the node number, $$n$$, and element number, $$e$$, of each LEBF.



As with the CBS, the coefficient at the essential boundary condition is equal to the essential boundary condition because the basis function is equal to one at the essential boundary condition:


 * $$g = \mathbf{d_{1}^{(1)}}\mathbf{b_{1}^{(1)}}(0)=\mathbf{d_{1}^{(1)}}*1=\mathbf{d_{1}^{(1)}}=4$$

The element matrices are formed as in problems 5.1 and 5.2 as follows:


 * $$\displaystyle \mathbf{F}^{e}_{F}=b_{i}^{(1)}(\alpha_{i}^{e} )h + \int_{\omega^{e}}^{.} {{b_{i}^{(1)}}fdx}$$



\displaystyle

h = {a_2}(\alpha )\frac = (2+3\alpha)\frac = 5*12/5=12

$$


 * $$\displaystyle \mathbf{F_{F}^{(1)}}=\mathbf{F}^{(1)}_{2}=b_{2}^{(1)}(.25)h + \int_{0}^{.25} {{b_{2}^{(1)}}fdx}=1*12+\int_{0}^{.25} 4x(5x)=12.104167$$

$$ \displaystyle

\therefore {F_F} = \left[ {\begin{array}{ccccccccccccccc} {12.104167} \end{array}} \right]

$$


 * $$\displaystyle \mathbf{K}^{e}_{ij}=\int_{\omega^{e}}^{.} b_{i}^{e'}(x^e)a_2(x^e)b_{j}^{e'}(x^e)dx$$



\displaystyle

\mathbf{K^{(1)}_{FE}} = \left\{ {\mathbf{K^{(1)}_{1j}};j = 2,...,n} \right\}

$$



\displaystyle

\mathbf{K^{(1)}_{12}}= \int\limits_0^{.25} b_{1}^{(1)'}a_2b_{2}^{(1)'}=\int\limits_0^{.25}-4*(2+3x)*4=-32(.25)-24(.25)^2=-9.5

$$



\displaystyle \therefore \mathbf{K^{(1)}_{FF}} = \begin{bmatrix} -9.5 \end{bmatrix} $$



\displaystyle

\mathbf{K^{(1)}_{FF}} = \left\{ {\mathbf{K^{(1)}_{ij}};i,j = 2,...,n} \right\}

$$



\displaystyle

\mathbf{K^{(1)}_{22}}= \int\limits_0^{.25} b_{2}^{(1)'}a_2b_{2}^{(1)'}=\int\limits_0^{.25}4*(2+3x)*4=32(.25)+24(.25)^2=9.5

$$



\displaystyle \therefore \mathbf{K^{(1)}_{FF}} = \begin{bmatrix} 9.5 \end{bmatrix} $$


 * $$\mathbf{K^{(1)}} \mathbf{d^{(1)}} = \mathbf{F_{F}^{(1)}} - \mathbf{K_{FE}^{(1)}} g$$


 * $$\mathbf{d_{2}^{(1)}} = \mathbf{K}_{FF}^{(1)-1}( \mathbf{F_{F}^{(1)}} - \mathbf{K_{FE}^{(1)}} g)$$


 * $$\therefore \mathbf{d_{2}^{(1)}} = 5.5208$$

Now the process is repeated for each element. The matrices are assembled into global matrices and all of the coefficients can be determined. The approximate solution is formed for each element by taking the coefficients times the basis functions. The approximate solutions for each element make up the global approximate solution.


 * $$\displaystyle \mathbf{K}_{ij} = \sum_{e=1}^{nel}\mathbf{K}^{e}_{ij}$$


 * $$\displaystyle \mathbf{F}_{i} = \sum_{e=1}^{nel}\mathbf{F}^{e}_{i}$$


 * $$\displaystyle u^{he}(x)= \sum_{j=1}^{n}d_jb_j(x),\quad \quad u^{h}(x)=\sum_{j=1}^{nel}u^{he}(x) $$

A Matlab script was written to generate the plots. The results and script are given below: