User:Eml5526.s11.team6.deshpande/hwk6

= Problem 6.7 Rules of Matrix algebra=

Solution
Hence, Therefore, Now, Hence, from eq. (6.7.6) and eq. (6.7.11)

Now, Using eq. (6.7.8), we can write Verified using | Wolfram Alpha

Hence, from eq.(6.7.14) and eq.(6.7.15) we can say that

Syntax for Wolfram Alpha:

Multiplication of two matrices:

{{1, 1, 1}, {2, -1, 3}, {3, 2, 6}}*{{1, 3, 5}, {1, -4, 1}, {2, 5, 8}}

Transpose of those multiplied matrices:

transpose[{{1, 1, 1}, {2, -1, 3}, {3, 2, 6}}*{{1, 3, 5}, {1, -4, 1}, {2, 5, 8}}]

Inverse of the above:

invert{transpose[{{1, 1, 1}, {2, -1, 3}, {3, 2, 6}}*{{1, 3, 5}, {1, -4, 1}, {2, 5, 8}}]}

Take inverse of A and then transpose it:

transpose[invert{{1, 1, 1}, {2, -1, 3}, {3, 2, 6}}]

Take transpose of A and then invert it:

invert{transpose[{{1, 1, 1}, {2, -1, 3}, {3, 2, 6}}]}

=Problem 6.8=

Solution
Nodes and weights for the 5-point Gauss–Legendre formula according to | NIST Handbook are as follows:

For the table given in the problem statement, the calculated value of each term is as follows

In Fish and Belytschko's book on page 89 The position of Gauss points and corresponding weights are as follows

Hence, from the above tables we can conclude that the table given in problem statement (from [[media:fe1.s11.mtg36.djvu|Mtg 36 (a,x)]]) is reasonably accurate when compared to the above tables from NIST handbook and Fish and Belytschko's book on page 89.

2.Use Gauss quadrature to obtain exact values of the following integrals. Verify by analytical integration:
(c) Write a MATLAB code that utilizes function gauss.m and performs Gauss integration. Check your manual calculations against the MATLAB code.

Solution
a) We have $$2n_{gp}-1\ge 2 \Rightarrow \quad take \quad n_{gp}=2$$

Hence, $$(W_1,{\xi}_1) ,\quad (W_2,{\xi}_2)$$ can be calculated as follows:

Now, a=0, b=4

Hence,

Hence, the integral becomes,

Analytically, the integration can be calculated as follows:

We get the value of Gauss integration from MATLAB code as 25.33333 which is same as we got in eq. (6.8.7) by Gauss quadrature and also same as eq.(6.8.8) by Analytical integration.

b) The given integral is

We have

$$2n_{gp}-1\ge 4 \Rightarrow \quad take \quad n_{gp}=3$$

Hence, from the table of $$ {W_i,x_i}$$ in the first part of this problem we get,

Hence integral becomes,

Analytically, the integration can be calculated as follows:

We get the value of Gauss integration from MATLAB code as 1.7333 which is same as we got in eq. (6.8.11) by Gauss quadrature and also same as eq.(6.8.12) by Analytical integration.

3.Use three point Gauss Quadrature to evaluate the following integrals. Compare to the analytical itegral.
(c) Write a MATLAB code that utilizes function gauss.m and performs Gauss integration. Check your manual calculations against the MATLAB code.

Solution
We have

$$ \quad n_{gp}=3$$

Hence, from the table of $$ {W_i,x_i}$$ in the first part of this problem we get,

Hence, the integral becomes,

a)

We get the same results by integrating this function with Wolfram Alpha. Hence it is same as the analytical solution of the integral.

We get the value of Gauss integration from MATLAB code as 0 which is same as we got in eq. (6.8.16) by Gauss quadrature and also same as by Analytical integration in Wolfram Alpha.

b)

We have

$$ \quad n_{gp}=3$$

Hence, from the table of $$ {W_i,x_i}$$ in the first part of this problem we get,

Hence, the integral becomes,

We get the result by integrating this function with Wolfram Alpha as I=1 which is different than which is calculated with three point qudrature as I=1.5299 (eq.6.8.18).

We get the value of Gauss integration from MATLAB code as 1.53 which is same as we got in eq. (6.8.18) by Gauss quadrature but it is different than Analytical integration in Wolfram Alpha.

4. Effect on accuracy of integration due to change in number of points in Gauss Quadrature
The integral $$\displaystyle \int\limits_{-1}^{1}{\left( 3{{\xi }^{3}}+2 \right)d\xi }$$ can be integrated exactly using two-point Gauss quadrature. How is the accuracy affected if

a. one-point quadrature is employed;

b. three-point quadrature is employed.

Check your calculations against MATLAB code.

Solution
a.

We have

$$ \quad n_{gp}=1$$

Hence, from the table of $$ {W_i,x_i}$$ in the first part of this problem we get,

Hence, the integral becomes

b.

We have

$$ \quad n_{gp}=3$$

Hence, from the table of $$ {W_i,x_i}$$ in the first part of this problem we get,

Hence, the integral becomes,

We get the value of Gauss integration from MATLAB code as 4 for both n=1 and n=3 which is same as we got in eq. (6.8.20)of part (a) and (eq.6.8.22) of part (b) by Gauss quadrature and also it is same as Analytical integration in Wolfram Alpha.

Hence, the accuracy of the given integral is not affected for one point Gauss Quadrature and for three point Gauss Quadrature.