NivaarExam PrepOfficial exam papers ↗

22-Mec-B10 Finite Element Analysis · December 2013

Question 2 of 7: Gauss quadrature of a field variable over a rectangular domain [20 marks]

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Paper format. National Examinations, December 2013 — 07-Mec-B10 Finite Element Analysis, 3 hours, open book (any textbooks, references or notes; any non-communicating calculator). Seven questions of equal value [20 marks each]; candidates attempt any five, and all questions are to be solved within the context of the finite element method. Every one of the seven questions is worked below, because the full set is more useful as a study resource than a five-question subset.

Reference texts. The worked answers below are keyed to the standard finite-element texts used for this subject:

Question 2: Gauss quadrature of a field variable over a rectangular domain [20 marks]

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. The integrand and the rectangular domain over which it is integrated, together with the exact value quoted in the question:

Given data — Question 2
QuantityValue
Field variable$f(x,y)=(x+y^{2})y = xy + y^{3}$
Domain in $x$$0 \le x \le 4$
Domain in $y$$0 \le y \le 6$
Exact value (given)$g = 1440$

Find. The value of $g$ obtained by Gauss–Legendre quadrature, and an explanation of why that value agrees with (or differs from) the exact result.

x y (0.8453, 1.2679) (3.1547, 1.2679) (0.8453, 4.7321) (3.1547, 4.7321) 0 4 6 Ω : 0 ≤ x ≤ 4, 0 ≤ y ≤ 6
Figure 2.1 — The rectangular domain Ω and the four sampling points of the 2 × 2 Gauss–Legendre rule, shown at their physical (x, y) locations.

Approach. Establish the polynomial degree of the integrand in each direction to fix the number of Gauss points needed, map the rectangle onto the bi-unit parent square so the tabulated abscissae and weights apply, then sum the weighted samples multiplied by the constant mapping Jacobian.

  1. Establish the polynomial degree in each direction. Expanding the integrand, $f(x,y)=(x+y^{2})y = xy + y^{3}$, which is of degree 1 in $x$ and degree 3 in $y$. A one-dimensional $n$-point Gauss–Legendre rule integrates a polynomial of degree $2n-1$ exactly, so $$2n-1 \ \ge\ 3 \quad\Longrightarrow\quad n \ \ge\ 2$$ Two points in the $y$ direction are necessary and two in the $x$ direction are more than sufficient; a $2\times 2$ product rule is therefore the smallest rule that is exact here.
  2. Map the physical rectangle onto the parent square. Gauss data are tabulated on $-1\le\xi,\eta\le 1$, so use the linear maps $$x=\frac{a+b}{2}+\frac{b-a}{2}\,\xi = 2+2\xi ,\qquad y=\frac{c+d}{2}+\frac{d-c}{2}\,\eta = 3+3\eta$$ with $a=0,\ b=4,\ c=0,\ d=6$. The mapping is affine, so its Jacobian is constant: $$dx\,dy=\left|\frac{\partial(x,y)}{\partial(\xi,\eta)}\right|d\xi\,d\eta=(2)(3)\,d\xi\,d\eta = 6\,d\xi\,d\eta$$
  3. Write the quadrature form. Substituting the map converts the integral to the standard summation $$g=\int_{-1}^{1}\!\!\int_{-1}^{1} f\big(x(\xi),y(\eta)\big)\,(6)\,d\xi\,d\eta \;\approx\; 6\sum_{i=1}^{2}\sum_{j=1}^{2} W_i W_j\, f\big(x(\xi_i),\,y(\eta_j)\big)$$ For the two-point rule the abscissae and weights are $\xi_i,\eta_j=\pm 1/\sqrt{3}=\pm 0.577350$ and $W_i=W_j=1$.
  4. Map the sampling points into physical coordinates. With $\xi=\mp 0.577350$ and $\eta=\mp 0.577350$, $$x_{1,2}=2\mp 2(0.577350)=0.845299,\ 3.154701 ,\qquad y_{1,2}=3\mp 3(0.577350)=1.267949,\ 4.732051$$
  5. Evaluate the integrand at the four sampling points. Using $f=(x+y^{2})y$ at each pair, with all four weights equal to unity:
    2 × 2 Gauss sampling
    Point$\xi$$\eta$$x$$y$$W_iW_j$$f(x,y)$
    1$-0.577350$$-0.577350$0.8452991.26794913.110273
    2$-0.577350$$+0.577350$0.8452994.7320511109.961524
    3$+0.577350$$-0.577350$3.1547011.26794916.038476
    4$+0.577350$$+0.577350$3.1547014.7320511120.889727
    Weighted sum $\sum W_iW_j f$240.000000
    The four irrational sampling values sum to the exact rational number 240, which is itself a useful arithmetic check that the abscissae were placed correctly.
  6. Scale by the mapping Jacobian to obtain $g$. Multiplying the weighted sum by the constant Jacobian, $$g \;=\; 6 \times 240.000000$$ $$\boxed{\,g = 1440\,}$$

(b) Comparison with the exact solution [5 marks]

The quadrature result is identical to the exact value $g=1440$, not merely close to it, and the agreement is exact to machine precision rather than accidental. The reason is the exactness property of Gauss–Legendre quadrature: an $n$-point rule integrates any polynomial of degree $\le 2n-1$ exactly, because the $n$ abscissae are the roots of the degree-$n$ Legendre polynomial and the $n$ weights are chosen to annihilate the remaining $n$ moments. Here the integrand is a polynomial of degree 3 in $y$ and degree 1 in $x$, and the mapping to the parent square is affine so it does not raise the degree. The $2\times 2$ rule is exact to degree 3 in each direction, so there is no quadrature error left to observe.

The analytical check confirms the same number:

$$g=\int_{0}^{6}\!\!\left[\int_{0}^{4}\big(xy+y^{3}\big)dx\right]dy=\int_{0}^{6}\big(8y+4y^{3}\big)dy=4(6)^{2}+ (6)^{4}=144+1296=1440$$

Two contrasts make the point sharper. A single-point rule (the element centroid, $x=2$, $y=3$, weight $2\times2=4$) gives $4\,f(2,3)\,(6)=792$, an error of $-45\%$, because it is exact only to degree 1 and the cubic variation in $y$ is entirely unrepresented. A $3\times3$ rule returns $1440$ again: over-integration costs 9 function evaluations instead of 4 and buys nothing, since the error was already zero. The practical lesson carried into element stiffness computation is that the rule order should be chosen from the polynomial degree of the integrand, and that a rule of the correct order is not an approximation at all.

Question 2 — final results
QuantityValue
Rule required (degree 3 integrand)$2\times 2$ Gauss–Legendre, $\xi_i=\pm 0.577350$, $W_i=1$
Mapping Jacobian$6$
Weighted sum of samples$240.000000$
$g$ by Gauss quadrature$\mathbf{1440}$
Exact $g$ (given)$1440$ — identical, zero quadrature error
$1\times 1$ rule (contrast)$792$, error $-45\%$
$3\times 3$ rule (contrast)$1440$, no benefit from over-integration