User:Eml5526.s11.t1.ab/HW5

=Problem 5.1: Weak form with appropriate functions such as Polynomial, Fourier & Exponential until convergence.=

Given
General 1-D Model 1 Data set 1. The Partial Differential equation for this data set is,

Find
Solve the Weak Form of the above general model 1 data set 1 for the Functions such as

1)Polynomial Basis Function,

2)Exponential Basis Function &

3)Fourier Basis Function

to find out the convergence point.

1) Polynomial Basis Function
Solve the Differential Equation

in the interval (0,1) with the boundary conditions

The Weak Form of the given Differential Equation will be obtained as follows

So we need to integrate the above equation using integration by parts, after which we will get the following equation,

We now have to select the appropriate Polynomial Basis Function which will follow the constraint breaking solution. so selecting

Clearly,

We need, So Choosing,

We now have, Using the essential Boundary condition we have, Therefore, In the identical way we can also write,

With the condition,

Therefore,

Now we need to calculate the derivative of $$U$$ & $$w$$, Therefore,

Substituting this into the weak form of $$\left(5.1.9\right)$$, we get,

Cancelling $$c_{i}$$ and Organizing, we get, Simplifying the last equation we get,

We can obtain the value of $$\displaystyle a_{j}$$ from the above equation.

The analytical exact solution on the other hand is obtained as,

therefore,

The Values of p & r are obtained by using the following boundary conditions,

To solve this system of equations we developed a MATLAB code. It was found out that with $$n=2$$ a good approximation is obtained. However with$$n=8$$ the error was smaller than $$10^{-6}$$. The MATLAB code is as follows.

Appendix
 Matlab Code: 

The analytical and the numerical solution along with the Error between the two are plotted as below.





2) Fourier Basis Function
To follow the constraint Breaking Solution we choose,

We need to satisfy the essential boundary condition So we choose the basis Function such that So we can write, Now the trial solution will be as follows,

Now we need to solve for the remaining coefficients By constructing a Stiffness & Force Matrices as follows.

Here the first equation gets satisfied for even values of i & j,

Whereas 2nd equation is satisfied for odd values of i & j,

further 3rd equation is satisfied for remaining combinations of i & j.

Here the first equation gets satisfied for even values of i & j,

Whereas 2nd equation is satisfied for odd values of i & j,

We developed a MATLAB code to generate the Force and the stiffness Matrix and We get the following values.

We can now use the relationship which is, $$\displaystyle Kd=F$$ to solve for $$\displaystyle d$$.

Ultimately the trial solution of the equation is,

We have developed at MATLAB code to solve these system of equations & to deliver the Error between analytical and the numerical solution.

Appendix
 Matlab Code: 

The analytical and the numerical solution along with the Error between the two are plotted as below. From the Plots we can explicitly say that the solution converges at n=9.





3) Exponential Basis Function
To follow the constraint Breaking solution we choose: Clearly, And as we need We choose, Eventually we have, From the essential boundary condition, we have, Therefore, In the identical way we have, Using the condition, Therefore Derivative of U & w will be,

Replacing in the weak form of $$\left(5.1.5\right)$$ we get,

Cancelling $$c_{i}$$ and then organizing we obtain, Performing the integration we obtain following equation,

The value of the $$a_{j}$$can be calculated from the above equation. we developed a MATLAB code to find the error between the Exact and the analytical solution. The MATLAB code is as follows.

Appendix
 Matlab Code: 

The following two figures shows the basis Function and the Error between the Analytical and the numerical solution. It can be observed that the Exponential basis Function converges somewhat Slowly than the Polynomial basis Function. For exponential the convergence was achieved with 10 terms whereas with polynomial, it was achieved with only 8 functions. Moreover the stiffness matrix obtained with exponential functions was bad-conditioned for a number of functions greater than 8.





=Problem 5.6: Quadratic Lagrangian Elemental Basis Function.=

Given
Consider any Quadratic Function.

Find
Plot of the Individual Lagrangian Quadratic Function and the combined plot of all the three Lagrangian Quadratic Functions.

Solution
For any Quadratic Function the Number of nodes are always 3. Therefore we can write, We will select the global node numbers as follows, We have according to the Lagrangian Interpolation Basis Function, Which is the Polynomial of degree (n-1)

So, Substituting the values from Equation $$\displaystyle (5.6.2)$$, we get,

In the Similar way,

&

We Developed a MATLAB code to plot all these Quadratic Lagrangian Basis Function. This very MATLAB code is as follows.

Appendix
 Matlab Code: 

The plots of all the Individual Lagrangian Quadratic Function and the Combined plot of all the Three Functions are as follows.