User:Eml5526.s11.team6.joglekar/hwk5

Introducing the arbitrary weighted function
Weak form can be found as follows, with weighted function

Now, multiply eq. 5.1.1 by $$ \displaystyle w $$ and integrate between 0 to 1.

Use integration by parts for the first term in eq. 5.1.4

Using eq. (5.1.2) and eq. (5.1.3), we get

Put eq. (5.1.6) in eq. (5.1.5), we get the weak form as follows

a.Using the exponential basis function

For getting appropriate constraint breaking solution, we choose Also, Take $$ \displaystyle \beta=0$$ for the constraint breaking solution. Therefore, From eq. 5.1.2 and eq. 5.1.10, we can say that Therefore, eq. 5.1.10 becomes Similarly, the weighted function can be written as Eq. 5.1.3 gives, Therefore eq. 5.1.13 becomes Hence, from eq. 5.2.12 and 5.2.15 Put this in eq. 5.1.7, we get Using eq. 5.1.15 we can find $$ \displaystyle w(1) $$ and put in eq. 5.1.18, we get By integrating and verifying with| Wolfram Alpha, we get

Following Matlab code is used to find coefficients a_j by changing values of i and j in the above equation After getting the coefficients of numerical solution, we compare numerical solution with analytical solution for different values of n.

Then graph of error that is difference between analytical solution and numerical solution is plotted at x=0.5



As expected, with increase in number of n,numerical solution approaches analytical solution.

From the above graph, error is almost zero for n=6 and above. But to get the error in the order of less than $$10^{-6}$$,we solve it further for higher values of n.

Introducing the arbitrary weighted function
Weak form can be found as follows, with weighted function

Now, multiply eq. 5.1.1 by $$ \displaystyle w $$ and integrate between 0 to 1.

Use integration by parts for the first term in eq. 5.1.4

Using eq. (5.1.2) and eq. (5.1.3), we get

Put eq. (5.1.6) in eq. (5.1.5), we get the weak form as follows

a.Using the exponential basis function

For getting appropriate constraint breaking solution, we choose Also, Take $$ \displaystyle \beta=1$$ for the constraint breaking solution. Therefore, From eq. 5.1.2 and eq. 5.1.10, we can say that Therefore, eq. 5.1.10 becomes Similarly, the weighted function can be written as Eq. 5.1.3 gives, Therefore eq. 5.1.13 becomes Hence, from eq. 5.2.12 and 5.2.15 Put this in eq. 5.1.7, we get Using eq. 5.1.15 we can find $$ \displaystyle w(1) $$ and put in eq. 5.1.18, we get By integrating and verifying with| Wolfram Alpha1 ,| Wolfram Alpha2,| Wolfram Alpha3 we get

Following Matlab code is used to find coefficients a_j by changing values of i and j in the above equation After getting the coefficients of numerical solution, we compare numerical solution with analytical solution for different values of n.

Then graph of error that is difference between analytical solution and numerical solution is plotted at x=0.5



As expected, with increase in number of n,numerical solution approaches analytical solution.

From the above graph, error is almost zero for n=6 and above. But to get the error in the order of less than $$10^{-6}$$,we solve it further for higher values of n.