\begin{titlepage} \begin{center} %\vspace*{1.29375in} \vspace*{2in} {\Large Computing Assignment, Part 2. A follow up. Derivation for the Ax=b and FEM program for illustration}\\ \vspace{.1in} Mathematics 503, Mathematical Modeling\\ \vspace{1.5in} California State University, Fullerton\\ \vspace{.1in} July 29 2007.\\ %\vspace{1.334375in} \vspace{1in} BY\\ \vspace{.1in} Nasser Abbasi\\ \end{center} \end{titlepage}



This is a suplement to the report for the computer project for Math 503. This includes the symbolic derivation of the $A$ matrix and the $b$ vector for the problem of $Ax=b$ which is generated from the FEM formulation for this project. I also include a very short Mathematica program which implements the FEM solution.

For MATH where $L$ is the length, we define the shape functions (called tent function in this case) as shown below


diag1.png

The shape function is defined by MATH where MATH

and MATH as shown in this diagram


diag2.png

Now the derivative of MATH is given by

MATH

Now we write the weak form in terms of the above shape function (which is our admissible direction). From part 1 we had

MATH

And Let MATH

Hence, now we pick one admissible direction at a time, and need to satisfy the above integral for each of these. Hence we write

MATH

But due to sphere on influence of the MATH extending to only MATH the above becomes

MATH

Hence we obtain $N$ equations which we solve for the $N$ coefficients $c_{j}$

Now to evaluate $I_{j}$ we write MATH

Now we will show the above for $j=1$ which will be sufficient to build the $A$ matrix due to symmetry.

For $j=1$

MATH

Hence breaking the interval into 2 parts we obtain

MATH

Hence

MATH

Now set up a little table to do the above integral.

MATH

The above table was build by noting that for $\phi_{j},$ it will have the equation MATH when $x$ is under the left leg of tent. And it will have the equation MATH when $x$ is under the right leg of the tent. This is because for $x<0$, the argument to $\psi()$ is negative and so we flip the argument as per the definition for $\psi$ shown in the top of this report.

Hence we obtain for the integral in (2)

MATH

so the above becomes integral becomes

MATH

Hence

MATH

Which becomes

MATH

or

MATH

Therefore

MATH

Hence MATH

Multiply by $h$ we obtain

MATH

Hence we now can set up the $Ax=b$ system using only the above equation by taking advantage that $A$ will be tridiagonal and there is symmetry along the diagonal.

MATH

The following is the FEM program to implement the above, with few plots showing how close it gets to the real solution as $N$ increases.


basic_fem.png

I also written a small Manipulate program to simulate the above. Here it is


manipulate_for_direct_method.png