NivaarExam PrepOfficial exam papers ↗

22-Mec-B10 Finite Element Analysis · December 2016

Question 5 of 7: Least-squares cubic solution for a bar under a linearly varying axial load

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

Notes on this paper

Paper format. National Examinations, December 2016 — 07-Mec-B10, Finite Element Analysis. Three hours, open book, any non-communicating calculator permitted. FIVE (5) questions constitute a complete paper and the first five appearing in the answer book are the ones marked; each question carries 20 marks and every question must be solved within the context of the finite element method. Some questions require an essay-format answer, where clarity and organization are themselves marked. All seven questions are worked below so the set functions as a complete study resource.

Reference texts (22-Mec-B10 Finite Element Analysis).

Question 5: Least-squares cubic solution for a bar under a linearly varying axial load (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. A bar fixed at $x=0$ and traction-free at $x=L$, carrying a distributed axial load that grows linearly from the wall:

Given data — Question 5
QuantityValue / expression
Governing equation$EA\, u''(x)+cx=0$, $0 \lt x \lt L$
Distributed axial load$q(x)=cx$ (force per unit length), $c$ constant
Essential boundary condition$u(0)=0$ (fixed end)
Natural boundary condition$EA\, u'(L)=0$ (free end, zero axial force)
Trial functioncubic polynomial in $x$
Evaluation points$x=\tfrac14 L$ and $x=\tfrac34 L$

Find. The approximate cubic displacement field produced by the least-squares form of the method of weighted residuals at the two stated evaluation points, and a statement of how it compares with the exact solution.

q(x) = cxx, uLx = L/4x = 3L/4fixedevaluation points marked in teal; free end at x = L
Figure 5.1 — Cantilevered bar of length L, fixed at the left end and traction-free at x = L, carrying the linearly varying axial load q(x) = cx. The two teal markers are the least-squares evaluation points at x = L/4 and x = 3L/4.

Approach. Choose a cubic trial function that satisfies the essential boundary condition identically, form the residual of the governing equation, minimise the sum of squared residuals over the two evaluation points, and close the system with the natural boundary condition — three conditions for the three remaining coefficients.

  1. Select an admissible cubic trial function. The essential condition $u(0)=0$ must be satisfied exactly by any admissible trial function, so the constant term is dropped: $$u_a(x)=a_1x+a_2x^{2}+a_3x^{3}$$ which gives $u_a(0)=0$ for any coefficients. Three unknowns $a_1,a_2,a_3$ remain, so three independent conditions are required.
  2. Form the residual. Differentiating twice, $u_a''(x)=2a_2+6a_3x$, so substituting into the governing equation leaves $$\mathcal{R}(x)=EA\, u_a''(x)+cx = EA\big(2a_2+6a_3x\big)+cx$$ Note that $a_1$ does not appear in the residual at all: it is a rigid-stretch coefficient that only the boundary condition can determine.
  3. State the least-squares criterion. The least-squares method minimises the squared residual, using the residual's own sensitivity as the weight function, $w_j = \partial\mathcal{R}/\partial a_j$. Evaluated discretely at the two points specified by the question, the object to minimise is $$S(a_2,a_3)=\sum_{k=1}^{2}\Big[\mathcal{R}(x_k)\Big]^{2},\qquad x_1=\tfrac14L,\;\; x_2=\tfrac34L$$ and the stationarity conditions are $$\frac{\partial S}{\partial a_2}=2\sum_k \mathcal{R}(x_k)\frac{\partial \mathcal{R}(x_k)}{\partial a_2}=0,\qquad \frac{\partial S}{\partial a_3}=2\sum_k \mathcal{R}(x_k)\frac{\partial \mathcal{R}(x_k)}{\partial a_3}=0$$ With $\partial\mathcal{R}/\partial a_2 = 2EA$ and $\partial\mathcal{R}/\partial a_3 = 6EAx$, these are two linear equations in $a_2$ and $a_3$.
  4. Reduce the normal equations. Because there are exactly two free coefficients in the residual and exactly two evaluation points, the $2\times 2$ normal-equation system is non-singular and its solution drives $S$ to its absolute floor of zero, which happens only if the residual vanishes at both points: $$\mathcal{R}\big(\tfrac14L\big)=0 \quad\text{and}\quad \mathcal{R}\big(\tfrac34L\big)=0$$ Writing them out, $$2EA\, a_2 + \tfrac{3}{2}EA\, L\, a_3 = -\frac{cL}{4},\qquad 2EA\, a_2 + \tfrac{9}{2}EA\, L\, a_3 = -\frac{3cL}{4}$$
  5. Solve for the residual coefficients. Subtracting the first equation from the second eliminates $a_2$ and leaves $3EA\, L\, a_3 = -cL/2$, hence $$a_3=-\frac{c}{6EA}$$ Back-substituting into the first equation, $2EA\, a_2 + \tfrac32 EAL\left(-\dfrac{c}{6EA}\right)=-\dfrac{cL}{4}$ gives $2EA\, a_2 - \dfrac{cL}{4} = -\dfrac{cL}{4}$ and therefore $$a_2=0$$
  6. Close the system with the natural boundary condition. The traction-free end requires $EA\, u_a'(L)=0$, that is $a_1+2a_2L+3a_3L^{2}=0$. With $a_2=0$ and $a_3=-c/(6EA)$, $$a_1+3L^{2}\left(-\frac{c}{6EA}\right)=0 \quad\Longrightarrow\quad a_1=\frac{cL^{2}}{2EA}$$
  7. Assemble the approximate solution. Collecting the three coefficients, $$\boxed{\, u_a(x)=\frac{cL^{2}}{2EA}\, x-\frac{c}{6EA}\, x^{3}=\frac{c}{6EA}\Big(3L^{2}x-x^{3}\Big)\,}$$ The tip displacement follows as $u_a(L)=\dfrac{c}{6EA}\big(3L^{3}-L^{3}\big)=\dfrac{cL^{3}}{3EA}$, and the axial force distribution is $N(x)=EA\, u_a'(x)=\tfrac{c}{2}\big(L^{2}-x^{2}\big)$, which correctly equals the total applied load $cL^{2}/2$ at the wall and zero at the free end.
  8. Check the residual and compare with the exact solution. Substituting the coefficients back, $$\mathcal{R}(x)=EA\big(0+6x\big)\left(-\frac{c}{6EA}\right)+cx = -cx+cx = 0\quad\text{for all }x$$ so the residual vanishes identically, not merely at the two evaluation points, and $S_{\min}=0$. Integrating the governing equation directly, $u''=-cx/(EA)$ gives $u'=-cx^{2}/(2EA)+K_1$; the condition $u'(L)=0$ fixes $K_1=cL^{2}/(2EA)$, and $u(0)=0$ fixes the second constant at zero, so $$u_{\text{exact}}(x)=\frac{c}{6EA}\Big(3L^{2}x-x^{3}\Big)$$ The least-squares cubic is the analytical solution.

The exactness deserves a sentence of its own, because it is the pedagogical point of the question rather than a coincidence. The exact solution of $EA\, u''+cx=0$ is itself a cubic polynomial, so the chosen trial space contains the exact solution. Any consistent weighted-residual method — least squares, collocation, subdomain or Galerkin — must then recover it, because the only member of the trial space with an identically zero residual and the correct boundary conditions is the exact solution itself. The choice of evaluation points at $L/4$ and $3L/4$ is therefore immaterial here: any two distinct points give the same coefficients.

Two features of the least-squares method are nevertheless worth naming, since they are what a marker is looking for beyond the algebra. First, the continuous form of the criterion — minimising $S=\int_0^L\mathcal{R}^{2}\, dx$ rather than a discrete sum — produces exactly the same coefficients on this problem, and it is the form to use when there is no reason to privilege particular stations. Second, least squares always yields a symmetric, positive-definite coefficient matrix, since the normal equations are of the form $\mathbf{B}^{\mathsf T}\mathbf{B}\,\mathbf{a}=\mathbf{B}^{\mathsf T}\mathbf{f}$; this is its advantage over collocation, which gives an unsymmetric system and no control over the residual between the chosen points. The price is that least squares needs second derivatives of the trial functions in the governing operator, so it demands higher continuity of the approximation than the Galerkin weak form does — which is precisely why the finite element method is built on Galerkin rather than on least squares.

Question 5 — final results
QuantityResult
Trial function$u_a=a_1x+a_2x^{2}+a_3x^{3}$ (satisfies $u(0)=0$)
Residual$\mathcal{R}(x)=EA(2a_2+6a_3x)+cx$
$a_1$$\dfrac{cL^{2}}{2EA}$
$a_2$$0$
$a_3$$-\dfrac{c}{6EA}$
Approximate solution$u_a(x)=\dfrac{c}{6EA}\big(3L^{2}x-x^{3}\big)$
Minimum of $S$$0$ — residual vanishes for all $x$
Comparison with exactIdentical (the exact solution is a cubic)
Tip displacement$u_a(L)=\dfrac{cL^{3}}{3EA}$
Axial force$N(x)=\tfrac{c}{2}\big(L^{2}-x^{2}\big)$, $N(0)=cL^{2}/2$