User:Eml5526.s11.team3.sahin/Homework 47

=Problem 5.3 Using Lagrange Interpolation Basis Functions to Obtain Trial and Exact Solution of Torsion Bar=

Given: Data set G1DM1.0/D1b defined on Lecture 26-2
Strong form for the Torsion Bar

where $${a_2}\left( x \right){\text{ =  2 + 3x}}$$  $$\qquad\text{and}\quad $$   $$f\left( {x,t} \right) = 5x $$  so we get Essential boundary conditions, Natural boundary conditions,

Find


1. Explain how Langrange Interpolation Basis Functions (LIBF) are used as Constraint Breaking Solutions

2. Plot all LIBF

3. Use matlab quad, WolframAlpha, ... to integrate

4. Plot $$ u_m^h  \ vs\   u$$ and $$ u_m^h\left(0.5 \right)-u\left(0.5 \right)\ vs\ m$$

1. Explaining how LIBF can be used as CBS
For a basis function, and for $$\displaystyle{{\Gamma }_{g}}=\{\beta \}$$, the corresponding basis functions satisfying

{ $$\displaystyle {{b}_{j}}(x), \quad j=1,2...n $$ }   such that   $$\displaystyle {{b}_{1}}(\beta)\ne 0$$   and     $$\displaystyle {{b}_{j}}(\beta)= 0, \quad  j = 2,3...n $$

Lets show that the statement above can be satisfied to explain how LIBF can be used as CBS

We know that general formula of Lagrange Interpolation Basis Function is

Lets denote m=4,

If $$\displaystyle x={{x}_{1}}, \qquad {b}_{1}=L_{1,4}(x_{1})= \delta_{1,1} =\frac{(x_{1}-x_{2})(x_{1}-x_{3})(x_{1}-x_{4})}{(x_{1}-x_{2})(x_{1}-x_{3})(x_{1}-x_{4})} =1 $$ If $$\displaystyle x={{x}_{2}},\qquad {b}_{2}=L_{1,4}(x_{2})= \delta_{1,2}= \frac{(x_{2}-x_{2})(x_{2}-x_{3})(x_{2}-x_{4})}{(x_{1}-x_{2})(x_{1}-x_{3})(x_{1}-x_{4})} = 0$$

If $$\displaystyle x={{x}_{3}},\qquad {b}_{3}= L_{1,4}(x_{3})= \delta_{1,3}= \frac{(x_{3}-x_{2})(x_{3}-x_{3})(x_{3}-x_{4})}{(x_{1}-x_{2})(x_{1}-x_{3})(x_{1}-x_{4})} = 0$$

If $$\displaystyle x={{x}_{4}}, \qquad {b}_{4}= L_{1,4}(x_{4})= \delta_{1,4}=\frac{(x_{4}-x_{2})(x_{4}-x_{3})(x_{4}-x_{4})}{(x_{1}-x_{2})(x_{1}-x_{3})(x_{1}-x_{4})} = 0$$

So for the Lagrange basis function $$\displaystyle {{b}_{j}}(x) $$ satisfy the Constraint Breaking Solution requirements since $$\displaystyle {b}_{1} =1, \quad and \quad {b}_{2}={b}_{3}={b}_{4} = 0 $$

And we can conclude that

We do same calculation for other m values such as m = 2,3,5,6,7,8,9 in Matlab program. As a result, we can choose Lagrange interpolation function as a basis because it will destroy the constraint.

2.Plotting all LIBF used for m = from 2 to 9
The LIBF used must satisfy the essential boundary conditions $$\displaystyle u\left( x=0 \right) = 4 \quad $$  according to Discrete Weak Form.

The essential boundary conditions to be satisfied are

$$\displaystyle {{b}_{1}}(0)=1 $$ and  $$\displaystyle {{b}_{2...n}}(0)=0 $$

Hence to satisfy the condition, the LIBF basis functions used

Using these basis functions, the LIBF are plotted for m = 2,3,4,5,6,7,8, and 9 until the convergence of the basis functions with the actual solution takes place where the error is less than $$\displaystyle  {{10}^{-6}} $$

The convergence becomes less than $$\displaystyle  {{10}^{-6}} $$ for  $$\displaystyle  m=9 $$. It is 1.0266 e-07 The LIBF are plotted for various values of $$\displaystyle m $$ until convergence.



The plots of the basis functions were developed using Matlab. These LIBF plots were produced by the following Matlab code below.

i. Constracting of Exact Solution
We have general 1-Dimensional Model Data set 1.b from Eq 3.1 to Eq 3.5

Integrating the strong form Eq 3.2 with respect to x, we get,  -

From the natural boundary condition,

If we denote natural boundary condition, we obtain

If we substitute $$ \displaystyle C_{1} $$ into Eq 3.11

Integrating Eq 3.15 again with respect to x using integration by parts with constant $$ \displaystyle C_{2}$$ involved, we have

We already know this from Homework 2.4

If we take it out of integral, we have

Now using essential boundary condition with $$ \displaystyle u \left( {x = 0} \right) =4$$ ,we can update above equation as -

So we find

Substituting this constant values gives

It is also equal to

ii. Constructing of Weak Form
As the weight function must vanish on the essential boundaries, we consider all smooth weight functions $$w(x)$$ such that $$w(0)= 0$$.

Multiplying the given differential equation and the natural boundary condition over the domain specified, by an arbitrary weight function

Now we integrate the Equation 3.24 by parts,

Integration by parts:

So

w(0) =0 therefore, the first term on the RHS of the above vanishes at x = 0. Substituting Equation 3.27 in Equation 3.24,

Substituting Equation 3.25 in Equation 3.28,

iii. Discretization of Weak Form
Approximated solution $$ u^{h} \left ( x \right ) $$ and $$ w^{h} \left ( x \right ) $$ :

where $$ \left ( c_{i} \right ) $$ and $$ \left ( d_{j} \right ) $$ are constants and $$ \left ( b_{i} \right ) $$ and $$ \left (b_{j}\right ) $$ are the LIBF. We divide equally to discretizate on our domain for m=2,3,4,5,6,7,8,9. We will use these LIBF as a shape function satisfying the CBS.

When we expand (Eq 3.30) for = 4, we get

where,

We get matrices K and F calculated in Matlab code below.

The convergence occurs at $$\displaystyle m=9 $$

Using Matlab to construct above two matrices until satisfying the convergence criterion, we finally have
 * {| style="width:100%" border="0"

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

{{K}_{FF}}=\left( \begin{matrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\   -48.861 & 167.423 & -276.316 &  345.621 & -349.434 & 260.149 & -142.253 & 55.498 & -11.827 \\    58.104 & -276.316 & 593.033 & -828.416 & 880.332 & -718.901 & 440.528 & -193.210 & 44.845 \\   -74.821 & 345.622 & -828.416 & 1349.981 & -1583.123 & 1382.496 & -919.426 & 432.555 & -104.867 \\    72.070 & -349.434 & 880.332 & -1583.123 & 2080.253 & -1954.709 & 1351.427 & -660.485 & 163.668\\    -49.752 & 260.150 & -718.901 & 1382.497 & -1954.709 & 2000.226 & -1453.569 & 712.071 & -178.013 \\    24.315 & -142.253 & 440.528 & -919.426 & 1351.427 & -1453.569 & 1152.701 & -595.975 &  142.252 \\    -8.185 &  55.498 & -193.211 &  432.555 & -660.485 &  712.071 & -595.975 & 376.137 & -118.406\\    1.520 & -11.827 & 44.845 &  -104.867 & 163.668 & -178.013 &  142.252 & -118.407 &  60.828\\ \end{matrix} \right)

$$
 * }
 * {| style="width:100%" border="0"

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

{{F}_{F*1}}=\left( \begin{matrix}  4\\   0.130\\  -0.041\\    0.694\\  -0.400\\   1.157\\ -0.123\\   0.909\\   12.174\\ \end{matrix} \right)

$$
 * }

By the equation $$\displaystyle Kd =F $$, we have
 * {| style="width:100%" border="0"

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

{{d}_{F*1}}=\left( \begin{matrix}  4.0000\\    4.8299\\    5.5341\\    6.1415\\    6.6712\\    7.1363\\    7.5463\\    7.9085\\    8.2283\\ \end{matrix} \right)

$$
 * }