$30
1. According to the Gauss quadrature rule, an integral is expressed as a weighted sum of n terms in the form: n=1 wi f(xi), where wi, w2, ···wn are unknown coefficients known as weights and x1, x2 ··· xn are the discretization points. Construct a Gauss quadrature rule and use it to evaluate the following integral: √e xx2 dx. In addition:
(a) Plot the function in the interval [0.1 - 4.9].
(b) Show the development of the quadrature rule, noting that the limits asked above are non-standard. Bonus points if you derive the nodes and weights using symbolic math in MATLAB.
(c) Study the accuracy of your rule as a function of the number of quadrature points, while comparing your output with the integral command in MATLAB for the same evaluation.
2. A thin metallic cylinder of length L and radius a, along the y − axis as shown in the figure. The electrostatic potential on the cylinder is given as 1V. Using point matching and expressing the surface charge density ρs in terms of a line charge density ρl, in turn expressed via a pulse basis expansion:
N ρl = ∑ angn(y), ρl = 2πaρs,
n=1
solve the following:
(a) find and plot the surface charge density on the cylinder ρs,
(b) plot the potential V over the surface of the sphere with radius 10m.
Assume cylinder length L = 1m, and radius a = 0.01m. It is recommended to at least use a 3-point Gauss-quadrature rule to evaluate the integrals. Bonus points if you can justify the choice of the number of quadrature points; also if you can re-use some code from Q1 here.