28
Paper ID #17679 Introducing the Galerkin Method of Weighted Residuals into an Undergrad- uate Elective Course in Finite Element Methods Dr. Aneet Dharmavaram Narendranath, Michigan Technological University Dr.Aneet Dharmavaram Narendranath is currently a Lecturer at Michigan Technological University (Michi- gan Tech). He received a PhD in Mechanical Engineering-Engineering mechanics in 2013. Subsequently, he worked as a visiting assistant professor at Michigan Tech from 2013-2014 and then as an Engineer at the French Nuclear Commission (CEA) in France until 2015. His research interests are mathematical modeling of fluid physics. His pedagogical interests are development of mathematically oriented coures in mechanical engineering. c American Society for Engineering Education, 2017

Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Paper ID #17679

Introducing the Galerkin Method of Weighted Residuals into an Undergrad-uate Elective Course in Finite Element Methods

Dr. Aneet Dharmavaram Narendranath, Michigan Technological University

Dr.Aneet Dharmavaram Narendranath is currently a Lecturer at Michigan Technological University (Michi-gan Tech). He received a PhD in Mechanical Engineering-Engineering mechanics in 2013. Subsequently,he worked as a visiting assistant professor at Michigan Tech from 2013-2014 and then as an Engineerat the French Nuclear Commission (CEA) in France until 2015. His research interests are mathematicalmodeling of fluid physics. His pedagogical interests are development of mathematically oriented couresin mechanical engineering.

c©American Society for Engineering Education, 2017

Page 2: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Introducing the Galerkin method of weighted residuals into anundergraduate elective course in finite element methods

Abstract

Modern day finite element methods (FEM) are closely attached to the advent of mathematical andmatrix algebra methods in the design of aeronautical structures. Primarily, FEM is anapproximation technique for partial differential equations. The power of FEM is realized whenthe fundamental field problems governing the engineering design are “encompassed” in irregularshapes. In other words, FEM is particularly useful in resolving the effect of static or dynamicloads (structural or thermal) on complex shapes. In this paper, regular shapes are:square/rectangular geometrics, circular cross sections.

Modern day finite element method (post 1940s-50s) as taught in undergraduate level (senior level)electives shows bifurcation from classical methods (pre 1900s) in at least its abstraction fromrigorous mathematical concepts through the use of powerful software tools. However, it isbeneficial for students of FEM to be made aware of the connection between classical methods(differential equations) and computer tool based analysis.

The overall objective is to introduce the Galerkin method of weighted residuals for linear ordinarydifferential equations and to extend that idea to linear, steady state problems in structuralmechanics and thermal transport. Exposure to the Galerkin method allows students to connectdifferential equation based mathematical models to plane-problems in elasticity, lubricationtheory problems in fluid dynamics and steady state thermal transport problems. Students aremade aware of the concept of “global” vs “local” shape functions, “element order”,“convergence” and “error”.

The Poisson’s equation u”(x)=f is primarily utilized to build the students’ confidence in solvingdifferential equations and applying the Galerkin method. This allows students to forge aconnection between differential equations and simple linear (yet powerful) mathematical models.An incremental approach is taken by making the Poisson’s equation hetergenous fromhomogenous (i.e, f6=0 or f=f(x) from f=0). Students find appropriate polynomial functions foruse in the Galerkin method of weighted residual for the Poisson’s equation. The choice and orderof polynomial functions and its relation to modifying or refining a shape function in software isrealized.

Finally, MATLAB and its partial differential equation toolbox, pdetool, is used to connect theGalerkin Method to classical engineering problems. How boundary conditions could have aneffect of reducing a 2-D problem to a 1-D problem was explored. This exercise allowed studentsto be conscientious of boundary conditions and the variety and applicability thereof, as evidencedthrough examination and homework assignment results.

Page 3: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Homework assignments, examinations, end of semester design problem/project and student exitsurveys are used as metrics to check efficacy of pedagogy. This course on finite element methodstargets ABET criteria a,b,e,g,i,k.

Paper Outline

This paper describes (i) analytical mathematical techniques, viz., solution of differential equationsby the method of variables separable and Galerkin’s method of weighted residuals and (ii)computational tools, viz, MATLAB and its partial differential equations toolbox (pdetool) for anundergraduate elective course in finite element methods.

In this paper, an introduction, literature review and brief philosophy of this study and the classdemographics are first described. A skill assessment exam is conducted to quantitatively uncovera the lack of understanding and application of boundary conditions as prevalent in most students.A description of the equation of choice and the rationale for this follows along with a list ofexamples that students have at their disposal to correct their deficiency in understanding thesignificance of and application of boundary conditions. This short yet powerful list of examplesalso sheds light on the fundamentally important problems in solid mechanics and fluid/thermaltransport. A description of one of the final skill assessment examination problems follows alongwith a discussion. Sample student results are then depicted. Only one correct solution is chosenfor this description whilst 4 wholly or partially incorrect solutions are also depicted. Finally, assupplementary material, examples using MATLAB pdetool is provided for readers to adopt oradapt for their respective courses and code snippets for post processing are provided to visualize,parse, interpolate and interpret data.

Introduction and literature search

The author performed a literature search (table 1,2) for the state of the art in the utility of theGalerkin’s method of weighted residuals in a predominantly undergraduate engineeringclassroom. The literature search included some prominent textbooks in the Finite ElementMethod (FEM), ASEE publications that appear through the use of search parameters “FEM/finiteelement”, “Galerkin” or “method of weighted residual” and the relevant “International journal ofmathematical education in science and technology” and the American physical society’s “thePhysics teacher”. It was revealed from this literature search, that the scope defined in this studywas relevant and different from what is in literature.

1. Previous authors have applied variational calculus concepts for the use of the Galerkin’smethod. However, since variational calculus itself is outside the scope of the currentundergraduate course in FEM, the author has utilized the Galerkin’s method of weightedresiduals as demonstrated by Duncan 1 . This method does not require an understanding ofweak and strong formulations and is perhaps one of the first treatises on the Galerkinmethod in English.

2. Previous authors have made no explicit connection between the direct stiffness method and

Page 4: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

a method of weighted residuals. Both lead to condensation of a problem into the{F} = [K]{x} form. This latter linear matrix algebra form is what modern day FEMhinges on.

3. Previous authors, when the Galerkin method is used, have made no explicit connectionbetween increasing the order of a shape function polynomial and the refinement of a mesh.

4. The use of MATLAB’s pdetool for an FEM class has not been found.

5. At least one previous author mentions the correct balance between theory and softwarepractice for undergraduate courses in FEM as being an important criteria. The current paperfinds a common thread in the tapestry of FEM and explores it using theory (GalerkinMWR) and software (MATLAB pdetool).

In summary in light of the literature search, the current paper explores a balance between theoryand software practice in FEM through the application of the Galerkin method of weightedresiduals. Supplementary, but important addition are the recognition of a class of differentialequations for a wide variety of fluid-thermal transport and structural mechanics problems and theapplication of boundary conditions and validation of numerical results.

Textbook Method of analysis DeficiencyReddy 2 Use of the weighted residuals

through variational calculus andstrong→ weak formulation.

Students do not have background ofvariational calculus. No connectionprovided between direct stiffnessmethod and the MWR. Higher or-der shape function utilization in theMWR and its connection to higherorder 2D elements not made in thisbook.

Rao 3 Only linear polynomial piecewiseshape functions are used.

No connection provided betweendirect stiffness method and theMWR. Higher order shape functionutilization in the MWR and its con-nection to higher order 2D elementsnot made in this book.

Logan 4 (used asprimary textbook incurrent course)

Sparse explanation of MWR and itsapplicability

Higher order shape function utiliza-tion in the MWR and its connec-tion to higher order 2D elementsnot made in this book. Applicationslimited to simple bar elements.

Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on thefinite element method and their deficiency

As part of an elective course in finite element methods, the author instructs the use of the Galerkinmethod of weighted residuals (Galerkin MWR) to solve fundamentally important problems influid-thermal transport and solid mechanics. The usual topics of direct stiffness method and

Page 5: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Publication Method of analysis Deficiency or opportunityfor improvement

International Journal ofMathematical Education inScience and Technolog

No mention of use ofGalerkin MWR

The Physics teacher No mention of use ofGalerkin MWR

Monterrubio 5 Use of the Rayleigh-Ritz vari-ational method for structural(beam) problem

Author does not not usethe MWR (although the Ritzmethod can be equivalent orproduce equivalent results).

Hamann 6 Use of MATLAB for hyper-bolic partial differential equa-tions

Course for graduate studentsin partial differential equa-tions. The weighted residualmethod as a solution methodis only expressed as part ofthe introduction.

Walker 7 Galerkin weak formulation Walker 7 Does not explorethe parallels between the di-rect stiffness method and theGalerkin method and the useof MATLAB’s pdetool and itsefficacy in the realization ofboundary condition formula-tion.

Echempati 8 Assesment of an FEM courseand focus on key characteris-tics of an FEM course for un-dergraduates

Mentions that FEM textbooksshould strike a balance be-tween theory and softwarepractice. The prominent text-books perused for this study(table 1) do not strike this bal-ance or make the connectionexplicit.

Table 2: Some publications that have mentioned or show the use of the Galerkin method in anengineering classroom.

Page 6: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

software skills are also instructed. The idea was to expose students to the powerful technique ofGalerkin MWR along with traditional tools of approximation.

This study of the introduction of the Galerkin’s method of weighted residuals (Galerkin’s MWR)into a predominantly undergraduate course in finite element methods (FE) is multi-fold:

1. A recognition of an approximation method put forth by Galerkin to:

(a) An appreciation of various trajectories that have led to the modern day FEM9,10,11,12

formulation of problems into an {F} = [K]{X} form, that is relatively easily solvedusing computers. In effect, the equivalence of the “direct stiffness method” to that ofthe “method of weighted residuals by Galerkin” allows for students to see FEM as anapproximation technique for (mechanical) engineering “field problems”.

Figure 1: Equivalence of the direct stiffness method and the Galerkin method of weighted residuals(MWR). Both trajectories of practice lead to the matrix structural formulation of {F} = [K]{X}.This comparison, although part of this course, is not included in this paper to keep it short.

(b) A recognition of various boundary conditions and their relevance and similarity insolving plane problems in elastic theory (mechanics of materials), low Reynold’snumber flow problems in fluid dynamics, steady state thermal transport problems andvibration problems. This study utilizes a small set of boundary conditions andmathematical models that they would have to source from for simple problems insolid mechanics (static and dynamic-vibrations) and fluid thermal transport(one-dimensional steady state lubrication approximation and one-dimensional steadystate thermal transport). Along the way, students are also exposed to the ideas of usingfluid mechanical continuity conditions as boundary conditions and the use ofboundary condition to model a one-dimensional problem on a two-dimensional grid(for one-dimensional fluid mechanics based on lubrication approximation).

(c) Validation of FEM results for fundamental problems, with analytical results and anappreciation of the notion of shape functions as approximating polynomials and theireffect on simulation results.

Page 7: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

2. Using the knowledge gained on this approximation method in the application of properboundary conditions and utility of MATLAB’s pdetool (part of the “Partial Differentialequations Toolbox”) to solve plane problems in elasticity, fluid-thermal transport usingmodern day FEM (use of 2-D elements, exploring element quality, exploring convergenceand grid dependency).

3. Disseminating information and diverse education comprising of conceptual understandingand hands-on skills to students to ensure conformation with various items in thedepartment’s strategic plan.

Students must understand the relationship between various mathematics based courses and coremechanical engineering courses. This allows for a greater appreciation of computer software13, itsability (and lack of) and when one may need to or not- use it. Students also map the steps involvedin Galerkin’s MWR with the general steps involved in the use of software (see table 3).

Analytical Step Equivalent step in softwareFormulate problem statement(differential equation with BCs)

Create geometry and apply BCs(including loads, which are aNeumann BC)

Choose an approximating globalshape function (there are rulesinvolved)

Discretize the geometry (thereare rules/guidelines involved)

Reconcile coefficients in globalshape function

“Solve the problem”

Plot the field variable solved forin the problem statement withthe coefficients included

“Post processing and plotting”

Compare with analytical solu-tion

Validate numerical solution withanalytical solution or experi-mental results

Table 3: Mapping of Galerkins MWR to software use.

This study does involve students solving fundamentally important engineering problems usingMATLAB’s pdetool and validating these results using the Galerkin MWR. Moreover, the reasonthat the mathematical theory of Galerkin’s MWR is used is so that those students who wish topursue advanced study in finite element method are provided some initial direction. In fact, manystudents from this course do register for a graduate level course in finite element methods.

Class demographics

The students who enroll for this course in FEM are either 3rd or 4th year mechanical engineeringundergraduate students or 1st year graduate students in mechanical engineering, electricalengineering or civil engineering. This course includes rigor pertinent to both levels of studentsviz., senior level undergraduate students and first year graduate students.

Page 8: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

This undergraduate level elective in finite element methods (FEM) is predominantly constitutedof by undergraduate students (approximately 70% of the course enrollment). There are graduatelevel students in this course as well (approximately 30% of the course enrollment) as it informsthem of skills that they can apply to many graduate level courses (such as computational fluiddynamics, numerical methods for differential equations, advanced finite element methods) whichhave a primary or secondary focus on numerical methods and approximations. This course isoffered throughout the academic year in Fall (September-December), Spring (January-May) andtrack-B of Summer (June-Aug). The idea is to expose students to multiple trajectories of FEMand the equivalence of these trajectories.

Assessment of skills

The skills of students entering this course are assessed through an initial “examination” that teststwo aspects. The total number of students in this analysis was 34. Although this examination isnot graded, the students receive feedback on any errors they may have committed. Thisexamination also allows for the instructor to pay attention to fundamental details that are lackingin the students’ knowledge.

1. Analytical skills: Application of boundary conditions for a second order linear ordinarydifferential equation for the following problem:Consider a uniform rod subjected to a uniform axial load q0. This rod is fixed at x = 0 andis free at x = L. It can be readily shown that the deflection, u(x) of this bar element isdescribed by the governing second order linear ordinary differential equation:

d2u

dx2+ q0 = 0 (1)

Find an exact solution for the deflection through the application of correct boundaryconditions. (Students are required to realize and apply the following boundary conditions:u(x = 0) = 0 and du

dx|x=L = 0 to resolve the two constants of integration when the method

of variable separable is used.)

2. Software skills: The use of software (ANSYS) to solve a simple beam deflection problemby following a set of steps.

Majority of (24) the students in this course were unsuccessful in the use and proper application ofboundary conditions analytically. However, a majority of the students (30) were able to useANSYS to solve the statically determinate loaded beam problem. Statistical correlations betweenstudent success in the analytical skills portion with the software skills portion was not developedat this stage. Based on the students’ unsuccessful attempt at reconciling boundary conditionsmathematically, the instructor used a sequential presentation of facts14 to ensure students“connected the dots” and recognized the synergy between basic mathematical methods andsoftware based methods, for fundamental engineering problems.

Page 9: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Galerkins MWR: Notes and examples

Notes

The instructor has collected multiple classical papers on the Galerkins MWR1,15 and distilledfrom these notes steps on how to apply this MWR for a particular field problem (differentialequation) of importance. The differential equation used is the second order Poisson’s equation(one-dimensional) as shown in equation 2 that has broad utility in mechanical engineering andapplied physics. The students are also conversant with this equation having seen it on multipleoccasions in introductory courses on ordinary differential equations (ODEs). All students enrolledin this course have had ODEs.

d2u

dx2= f (2)

Examples

The Poisson’s equation has been used to develop multiple examples in fluid mechanics, thermlatransport and solid mechanics (with appopriate boundary conditions). The student applies theGalerkin MWR on these examples to:

1. Develop approximate solutions. (skill exercised: exposure to idea of approximation)

2. Compare the approximate solution with exact solution. (skill exercised: checking forconvergence)

3. Modifies the weight function in the Galerkins method to iteratively develop a betterapproximation if necessary. (skill exercised: changing the order of the shapefunction/element/approximating polynomial for higher accuracy.)

4. Solution of problem using MATLAB’s native FEM solver, pdetool. The MATLAB pdetoolallows for the solution of two-dimensional problems in elasticity, fluid-thermal transportand electromagnetism. Appropriate boundary conditions would need to be applied to haveit solve one-dimensional problems as modelled by the Poisson’s equation. Post-processingof results and checking with Galerkin MWR. (skill exercised: Comparison of numericalsolution with analytical/semi-analytical results).

In case of fluid mechanics, the Poisson’s equation (equation 2), describes steady state,one-dimensional pressure driven (f = dp/dx) Poisseuille flow or shear driven Couette flow(f = 0). In case of heat transfer, equation 2 describes steady state, one-dimensional conductionwith f = g(x) or without a heat source f = 0. In solid mechanics and elastic theory, the Poissonequation describes a one-dimensional link under a loading condition described by f . In twodimensions, this equation may also be used to represent torsion of shafts (solid mechanics) orpotential flow describing flow over a cylinder or sphere (fluid mechanics, important for studyingaerodynamics, boundary layers etc.). However, for this study, only one-dimensional form of thePoisson’s equation is solved analytically.

Page 10: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

The boundary conditions (see table 4 mainly used for this problem are Dirichlet or Neumann.This terminology (Dirichlet and Neumann) is used regularly in this course so that student areeventually also able to make appropriate recognitions of boundary conditions when usingMATLAB and its native FEM solver, pdetool. MATLAB’s pdetool uses this terminology and it isnecessary for students to be conversant with it.

Boundarycondition

Formulation Field Physical significance

Dirichlet u|x=ξ = T0 Thermal transport Constant temperature boundary conditionDirichlet u|x=ξ = u0 Fluid mechanics Constant velocity boundary conditionDirichlet u|x=ξ = x0 Solid mechanics Deflection boundary condition

Neumann du/dx|x=ξ = q0 Thermal transport Heat flux boundary conditionNeumann du/dx+ dv/dy Fluid mechanics Continuity condition at inlet and outlet of flowNeumann du/dx|x=ξ = f0 Solid mechanics Load (traction force)

Table 4: Boundary conditions for the Poisson’s equation 2.

MATLAB pdetool examples

The following examples have been developed using MATLAB and its pdetool function. They areutilized to describe problem set-up and solution in MATLAB’s pdetool. These examples are alsoperformed by students in a commercial FEA software.

1. Plane problems in elasticity: Simply supported beams, cantilever beams and axialmembers. These are solved in two-dimensional space for a one-dimensional field variable(displacement). Checks may be performed using exact solutions, Galerkin method may beused also. Student needs to choose the appropriate differential equation and chooseappropriate boundary conditions (Dirichlet, Neumann with proper values for deflection orload).

2. Pressure drive Poiseuille flow problem. This is again a one-dimensional flow problemsolved in two-dimensional space. Checks are performed using exact solutions, Galerkinmethod is also used. Student needs to choose the appropriate differential equation andchoose appropriate boundary conditions (Dirichlet for top and bottom walls,Neumann/continuity equation for inlet and outlet). This specific problem is interesting asnone of the students realized (checked through a show-of-hands of 12/12 students (12students out of 12 present on the day) in Summer 2016 and 22/22 students (22 students outof 24 present on the day) in Fall 2016) that the Continuity condition needs to be used as a“boundary condition” defining the continuity of flow at the inlet and outlet of this flowproblem. The solution obtained using MATLAB’s pdetool is shown in figure 3.

3. Thermal transport: one-dimensional heat conduction with heat source. This is aone-dimensional heat conduction problem that is solved in two-dimensional space. TheGalerin MWR is used to solve this non-homogenous problem with Dirichlet boundary

Page 11: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

0 0.5 1 1.5 2 2.5 3-1

-0.5

0

0.5

1 Color: v Displacement: (u,v)

0

2

4

6

8

10

12

10 -6

Figure 2: Cantilever with upward acting point end load solved using MATLAB’s pdetool. Thisexample is used to describe the various boundary conditions, viz. Dirichlet-fixed displacement andthe Neumann-load conditions. This example is also used to demonstrate mesh refinement optionsavailable. The choice of the cantilever example is made to demonstrate the utility of MATLAB’spdetool because of the greater familiarity of this problem to students.

conditions. Multiple iterations are required to achieve convergence with exact solution.Neumann conditions of zero heat flux are require to solve this problem in two-dimensionalspace. This specific problem is also interesting as none of the students realized (checkedthrough a survey of 12/12 students (12 students out of 12 present on the day) in Summer2016 and 22/22 students (22 students out of 24 present on the day) in Fall 2016) that theNeumann/heat flux condition needs to be used as a “boundary condition” to solve thisone-dimensional problem in two-dimensional space. Effectively, heat flux in one directionhas to be set to zero to ensure one-dimensional isotherms. The simulation results fromMATLAB’s pdetool are shown in figures 18 and 19.

4. Supplementary simulations. MATLAB pdetool example programs have also beendeveloped to study inviscid flow over cylinders (potential flow: uses Poisson’s equation)and stress concentration in a “plate with a hole in tensile field”. These are optionalmaterials available for students to practice their MATLAB simulation, data processing andanalytical skills on. The important result of this supplementary materials is to show thesimilarity of pressure gradients and stress concentrations in these problems. They are bothamenable to potential theory. They are both solved using the same or similar differentialequations. These may be utilized in future semesters.

Note that the student also develops experience and expertise with a more standard commercialFEM package, viz. ANSYS for solutions of a field equation on complex geometries. MATLAB’spdetool also does allow for complex geometries, through either the creation of geometry throughmanually using primitive shapes (lines, points, curves etc.) or through the importing of .stlfiles.

Page 12: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 3: Poiseuille flow (pressure driven laminar flow) problem solved using MATLAB’s pdetool.The parabolic velocity profile obtained using this FEM tool is compared with the solution obtainedusing Galerkin’s method of weighted residuals. Exceptionally good match between results (nearly100%) is achieved even with an “out of the box” coarse mesh.

Final assessment of skills

The final assessment of skills learned was based on the “Thermal transport: one-dimensional heatconduction with heat source” discussed in the section on “MATLAB pdetool examples”. Theproblem statement and the differential equation is provided below. The boundary conditions mustbe designed by the student for both the exact/Galerkin MWR and the MATLAB pdetool drivensolution.

Consider the unsteady 1-D heat equation for temperature u [in units of Kelvin].

ρCdudt− kd

2u

dx2= Q+ h (uext − u)︸ ︷︷ ︸

Convective heat transfer

(3)

For the following example values: ρ = 1.0 [kg/cubic m] , C = 1.0 [J/kg-K] andk = 1.0 [W/m-K] , with a heat source term Q = x [W/cubic m] and no convection heat transfer,with boundary conditions u(0) = 0 and u(1) = 1 on the domain (0, 1):

• For steady state conditions, solve and specify an exact solution to this mathematical modeldescribing the temperature profile.

• Devise a polynomial based global shape function of the, use the Galerkin method ofweighted residuals to find the approximate solution uN . Refine your shape function so thatthe percentage error between the exact solution and the MWR approximation is less than5%.

• Solve this problem using MATLAB and its pdetool capability and upload your MATLABsource file to canvas. Use the following mesh input parameters described in table 5.

Page 13: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 4: Classical elasticity problem of “plate with hole in a tensile field” (horizontal stress fieldis plotted) on the left and the “inviscid flow over a cylinder” fluid mechanics problem (pressuredistribution is plotted) on the right. These are described to students through MATLABS’s pdetool.Validation of the stress field around the hole (left) and the pressure field around the cylinder (right)may be performed using either a stress function approach or the Bernoulli’s equation, respectively.This may be used in future semesters.

Parameter ValueMesh Maximum edge size 0.05Mesh growth rate 1.3Mesher version Default valueJiggle mesh Uncheck (deselect)

Table 5: Mesh initialization parameters that students must use

Discussion

Initially a large number of students were unable to determine the boundary conditions needed foran “axial member under load” problem but were able to effectively use ANSYS to solve similarproblems. An explicit cognizance of boundary conditions was missing. Finally, the thermaltransport problem (with heat source) needed students to recognize and apply, independently, thefollowing:

1. Choice of appropriate mathematical model (differential equation) and associatedboundary conditions. This shows a cognizance of the mathematics behind the problem.

2. Proper application of the Galerkin MWR to solve for temperature field. This shows thedevelopment of skills that allow for the choice of proper shape functions forapproximations.

3. Validation: Exact solution of the temperature field and comparison with the approximationfrom the Galerkin MWR. This allows for a cognizance and appreciation of exact solution(where available).

Page 14: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

4. Refinement of approximation by choosing a higher order shape function and re-solvingfor temperature field until convergence to within a specified percentage error. This showsthat students need to validate their numerical/FEM results.

5. Solution of this problem using MATLAB pdetool whilst being cognizant that the problemstatement is one-dimensional but MATLAB’s pdetool allows only two-dimensionalproblems. Appropriate application of insulated (Neumann) boundary condition to converttwo-dimensional pdetool specification to mimic one-dimensional thermal flow. This showsa refined level of expertise where boundary conditions are used in an advantageous fashion.It also shows that students have an understanding of the underyling physics. They arelooking for one-dimensional isotherms.

6. Postprocessing of FEM results available from pdetool and comparison with exactsolution and Galerkin MWR approximation. Presentation of results and reasoning skillsof students are exercised.

Learning and Teaching styles

Learning and teaching styles that this study used, according to Felder et al14.

1. Students are exposed to the method of weighted residuals through sequential steps. Anequivalence of the direct stiffness method of weighted residuals is demonstrated throughvisual presentations.

2. Inductive reasoning is used. Facts about the MWR and observations that related to theequivalence of the MWR to the direct stiffness method are provided and underlyingprinciples are inferred.

3. Initial acquisition of knowledge by the students is passive. They apply the knowledgeacquired about the MWR (active learning) to solving fundamentally important problems inelastic theory and transport theory.

Sample student results

Exact solution compared with Galerkin method

Students compared the exact solution with the Galerkin MWR. The idea was to reinforce theeffect of the approximating polynomial (global shape function). Students realized that changingthe order of the polynomial allowed for a better degree of accuracy of the Galerkin MWR withrespect to the exact solution.

Page 15: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 5: Student results: Graphical comparison of temperature profile of problem statement 3with 2nd order and 3rd order shape function (polynomials) based Galerkin MWR.

Results from MATLAB pdetool

MATLAB’s pdetool was used to simulate the same problem (equation 3) and the results showqualitative equivalence with the Galerkin method and the exact solution. Students havequalitatively (as shown in figure 8) and quantitatively (figure 9 compared the temperature profileobtained using MATLAB’s pdetool with the analytical methods (Exact solution obtained usingmethod of variables separable and Galerkin MWR). To quantitatively compare results obtainedfrom MATLAB’s pdetool with the exact solution, one must use the MATLAB internal functionpdeInterpolant. The MATLAB code for this exam problem along with post-processing andpdeInterpolant code snippets are included at the end of this text for use by other instructors andstudents.

Page 16: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 6: Steady state temperature at equidistant spatial locations.

Figure 7: Percentage error using the Galerkin MWR for the steady state heat equation with heatsource. Students show that a third order polynomial approximation (global shape function) pro-duces the best results as validated through comparison with exact solution.

Page 17: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

0

0.2

0.4

0.6

0.8

1T

empe

ratu

re

10.5Spatial location

000

0.2

0.4

0.6

0.8

1

Figure 8: Temperature profile from MATLAB pdetool (left) compared qualitatively with analyticalmethods (right, Galerkin and separation-of-variables-exact).

Figure 9: Temperature profile from MATLAB pdetool compared quantitatively with analyticalmethods.

Page 18: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

MATLAB pdetool selection screens

This section briefly depicts the various selection screens available in MATLAB’s pdetool. It isquite close in operation to the general preprocessing, solution and postprocessing steps andscreens available in most FEM software packages.

Figure 10: Options available in pdetool. It is customary to start with Draw and then move on toPDE specification, Boundary condition specification, Mesh properties, Solution, Exporting solu-tion for postprocessing.

Figure 11: Problem domain constructed using Draw options in pdetool

Page 19: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 12: Mathematical model (PDE) specification for the problem in equation 3.

Figure 13: Dirichlet boundary condition (constant temperature) specification for equation 3.

Page 20: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 14: Neumann boundary condition (insulated temperature) specification for equation 3.Neumann insulated conditions when specified for the upper and lower boundaries allow for thistwo-dimensional problem to be solved as a one-dimensional problem. The results show one-dimensional isotherms as are apparent from the plots on temperature contours (fig 18.

Figure 15: Default mesh. Students also realized through internal options that by default, the meshconstructed by pdetool is a first order mesh (constant strain triangles).

Page 21: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 16: Higher mesh density. Students performed mesh refinement as available in pdetool. Itis a simple button click that translates to using more elements while ensuring that a generally highmesh quality is retained.

Figure 17: Mesh quality plot for the case with “high mesh density” as in figure 16.

Page 22: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

Color: T Vector field: q

0

0.2

0.4

0.6

0.8

1

Figure 18: Temperature contours. Default mesh. The contour plot provides qualitative validationof the boundary conditions being satisfied. The vectors/arrows depict the direction of heat flux.

0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

Color: T Vector field: q

0

0.2

0.4

0.6

0.8

1

Figure 19: Temperature contours. Higher density mesh. The isotherms are straighter with a highdensity mesh.

Page 23: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Conclusion

This paper describes how the Galerkin method of weighted residuals (Galerkin MWR) wasintroduced into an undergraduate elective course in finite element methods (FEM). This electiveis open to both senior level undergraduate students and beginning graduate students. Beginninggraduate students enroll in this course as a stepping stone to graduate level finite element methodcourses. This course instructs students on the use of commercial FEM software (ANSYS) thougha lab section (2 hours per week). This course also has lectures associated with it (2 hours perweek). The focus of the lectures is analytical methods and the theory behind FEM.

As part of the lectures, the instructor observed that the majority of (24) the students in thebeginning of this course were unsuccessful in the proper application of boundary conditions andsolution of a differential equation describing linear bar deflection. However, a majority of thestudents (30) were able to use ANSYS to solve the statically determinate loaded beamproblem.

Through the utilization of classical publications on the Galerkin MWR, the instructor includedthis in the lectures. The idea was to have students come to a realization of the parallels betweenthis powerful analytical approximation technique (Galerkin MWR) and modern day FEM.

Students used both the Galerkin MWR and modern day FEM tools (MATLAB pdetool) to solve anonhomogenous, one dimensional, steady state thermal transport problem. As part of thisexercise, the following were revealed:

• The utility of boundary conditions to model a 1-D problem on a 2-D domain (becauseMATLAB pdetool allows only 2-D domains).

• The exact solution of the differential equation that governs the physical problem of thermaltransport with the appropriate use of boundary conditions.

• The solution of the governing differential equation through the Galerkin MWR andcomparison with the exact solution for different approximation polynomial orders.

• Qualitative and quantitative comparison of the solution achieved for this thermal transportproblem through MATLAB pdetool with the exact solution and the Galerkin MWRsolution.

It was revealed through this exercise that 31 out of 34 students were able to accomplish thisproblem successfully with no direction from the instructor. The remaining 3 students were alsoable to complete this problem but required regular meetings and direction from the instructor.Their initial unsuccessful attempts at this problem have been captured in the appendix.

Acknowledgement

The author acknowledges the department of mechanical engineering-engineering mechanics atMichigan technological university for support provided to the instructor to teach this course onmultiple occasions. This allowed for a steady improvement in examples being used in class tofortify concepts for students. The author thanks ASEE reviewers and the chair for comments,

Page 24: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

suggestions and recommendations provided during various stages of preparing this paper. Thisinput allowed for an improvement in the structure of this paper.

References

[1] William Jolly Duncan. Galerkin’s method in mechanics and differential equations. Technical report, DTICDocument, 1937.

[2] Junuthula Narasimha Reddy. An introduction to the finite element method, volume 2. McGraw-Hill New York,1993.

[3] Singiresu S Rao. The finite element method in engineering. Elsevier, 2010.

[4] Daryl L Logan. A first course in the finite element method. Cengage Learning, 2011.

[5] Luis E Monterrubio. Correlation of a cantilever beam using beam theory, finite element method, and tests.American Society of Engineering Education, 2016.

[6] R. Hamann, J. & Jacquot. Visualization of pde solutions using implicit methods & matlab. American Socie,1996.

[7] C. & Drapcho C. Walker, T. & Kim. Application of the finite element method (fem) instruction to graduatecourses in biological engineering. American Society of Engineering Education, 2002.

[8] E. & Sala A. Echempati, R. & Mahajerin. Assessment of a common finite element analysis course. AmericanSociety of Engineering Education, 2010.

[9] A Hrenikoff. Solution of problems in elasticity by the framework method. J. Appl. Mech, 8.

[10] Robert J Melosh. Basis for derivation of matrices for the direct stiffness method. AIAA Journal, 1(7):1631–1637, 1963.

[11] JL Tocher and BJ Hartz. Higher order finite element for plane stress. Proc. ASCE, Journal of the EngineeringMechanics Division, 93:149–174, 1967.

[12] Olgierd Cecil Zienkiewicz, Robert Leroy Taylor, Olgierd Cecil Zienkiewicz, and Robert Lee Taylor. The finiteelement method, volume 3. McGraw-hill London, 1977.

[13] Jammie Hoskin; Brad Wambeke; Ronald Welch. Classical analysis techniques set the stage for mastery ofcomputer analysis methods. In ASEE Annual Conference, 2004.

[14] Richard M Felder and Linda K Silverman. Learning and teaching styles in engineering education. Engineeringeducation, 78(7):674–681, 1988.

[15] Clive AJ Fletcher. Computational galerkin methods. In Computational Galerkin Methods, pages 72–85.Springer, 1984.

APPENDIX

MATLAB code for exam problem

All these example problems may be downloaded at https://github.com/dnaneet/ASEE17.

Page 25: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

1 % This script is written and read by pdetool and should NOT be edited.2 % There are two recommended alternatives:3 % 1) Export the required variables from pdetool and create a MATLAB script4 % to perform operations on these.5 % 2) Define the problem completely using a MATLAB script. See6 % http://www.mathworks.com/help/pde/examples/index.html for examples7 % of this approach.8 function pdemodel9 [pde_fig,ax]=pdeinit;

10 pdetool('appl_cb',9);11 set(ax,'DataAspectRatio',[1 0.91271033653846145 1]);12 set(ax,'PlotBoxAspectRatio',[1.6434567901234569 1.0956378600823047 1]);13 set(ax,'XLimMode','auto');14 set(ax,'YLimMode','auto');15 set(ax,'XTickMode','auto');16 set(ax,'YTickMode','auto');17

18 % Geometry description:19 pderect([0 1 0.5 0],'R1');20 set(findobj(get(pde_fig,'Children'),'Tag','PDEEval'),'String','R1')21

22 % Boundary conditions:23 pdetool('changemode',0)24 pdesetbd(4,...25 'dir',...26 1,...27 '1',...28 '0')29 pdesetbd(3,...30 'neu',...31 1,...32 '0',...33 '0')34 pdesetbd(2,...35 'dir',...36 1,...37 '1',...38 '1')39 pdesetbd(1,...40 'neu',...41 1,...42 '0',...43 '0')44

45 % Mesh generation:46 setappdata(pde_fig,'Hgrad',1.3);47 setappdata(pde_fig,'refinemethod','regular');48 setappdata(pde_fig,'jiggle',char('on','mean',''));49 setappdata(pde_fig,'MesherVersion','preR2013a');50 pdetool('initmesh')51 pdetool('refine')52 pdetool('refine')53

Page 26: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

54 % PDE coefficients:55 pdeseteq(1,...56 '1.0',...57 '0',...58 '(x+1)+(0).*(0.0)',...59 '(1.0).*(1.0)',...60 '0:10',...61 '0.0',...62 '0.0',...63 '[0 100]')64 setappdata(pde_fig,'currparam',...65 ['1.0';...66 '1.0';...67 '1.0';...68 'x+1';...69 '0 ';...70 '0.0'])71

72 % Solve parameters:73 setappdata(pde_fig,'solveparam',...74 char('0','4032','10','pdeadworst',...75 '0.5','longest','0','1E-4','','fixed','Inf'))76

77 % Plotflags and user data strings:78 setappdata(pde_fig,'plotflags',[1 1 1 1 2 1 7 1 0 0 0 1 1 1 0 1 0 1]);79 setappdata(pde_fig,'colstring','');80 setappdata(pde_fig,'arrowstring','');81 setappdata(pde_fig,'deformstring','');82 setappdata(pde_fig,'heightstring','');83

84 % Solve PDE:85 pdetool('solve')

MATLAB code for postprocessing and surface plot

To use this code snippet, the user must first export solution (u) and mesh data ([p e t]) from within the MATLABpdetool window. The in the MATLAB command window, running the following function leads to a surface plotbeing created (example: figure 20)

1 pdeplot(p,e,t,'xydata',u,'zdata',u,'contour','off','colormap','jet')2 %'jet' is a colormap type. p e t are the mesh parameters points, ...

elements and triangles while u is the solution. This solution data ...is unstructured and needs to be plotted using this pdeplot(...) ...function.

Page 27: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Figure 20: Surface plot of temperature plotted using MATLAB’s pdeplot(. . .) function.

MATLAB code interpolation

The MATLAB pdetool data is unstructured and needs to be properly passed through MATLAB’s internal functions soas to interpolate, say, temperature data at different points in the domain. The example code below allows forinterpolating and finding the temperature at point x = 0.5 in the domain.

1 F = pdeInterpolant(p,t,u);2 %Evaluate the interpolant at point, x=053 pOut = [0.5,0.5;4 0.5,0.5];5 uOut = evaluate(F,pOut)

Page 28: Board # 85 : Introducing the Galerkin Method of Weighted ......Table 1: Galerkin’s method of weighted residuals (MWR) in some prominent textbooks on the finite element method and

Unsuccessful initial attempts of some students

Figure 21: Insufficent order of shape function (left) and improper use of boundary conditions(right).

Figure 22: Second order terms of shape function missing (left) and improper use of boundaryconditions (right).

Figure 23: Incorrect sign in shape function (left) and improper use of boundary conditions (right).

The unsuccessful first attempts at solving the heat transfer exam problem shows that students were not aware or hadtenuous awareness of the effect of boundary conditions or choice of shape function, both being seminal componentsof the application of FEM (analytically or through software).