Transcription

1 Int. J. Engng Ed. Vol. 16, No. 4, pp. 362±368, X/91 $ Printed in Great Britain. # 2000 TEMPUS Publications. Using a Computer Algebra System to Teach the Finite Element Method* SHIRLEY POMERANZ Department of Mathematical and Computer Sciences, The University of Tulsa, Tulsa, OK , USA. This paper describes how the computer algebra system, Mathematica, can be used to introduce students to the finite element method. Typical students are juniors, seniors, and beginning graduate students in mathematics, computer science, and various engineering disciplines. Students were given template code. They were instructed to modify the code in order to solve two-dimensional elliptic boundary-value problems and to verify the correctness of their numerical solutions. INTRODUCTION THE FINITE ELEMENT method (FEM) is one of the topics introduced in our upper-level undergraduate course, Math 4503, Numerical Methods. During the Fall 1999 semester, we used a computer algebra system (CAS), Mathematica, to assist in teaching an introduction to FEM. The textbook used for this course [1] presents an introductory section on finite elements, and we supplemented this section. A Mathematica notebook (program) that implements a basic two-dimensional FEM using linear, triangular elements was made available to students at the website, index.html [2]. The use of this FEM notebook assumes that students are fairly familiar with Mathematica. This is a major requirement, since it generally takes a good deal of exposure to Mathematica to become comfortable using it at the level required here (use of palettes, templates, and the help browser in Mathematica Version 4 alleviates some of this requirement). At TU, we introduce our students to Mathematica in second semester calculus. Thereafter, many of our mathematics courses, including third semester calculus, differential equations, mathematical modeling, and numerical methods, use Mathematica. One of our faculty members has written a set of Mathematica tutorials to assist students and faculty in using this software effectively. These tutorials are available on the web [3]. FINITE ELEMENT NOTEBOOK AND ASSIGNMENT When the FEM notebook is opened, it initially appears in outline form, as shown in Fig. 1. Each section of the notebook is closed, and only the * Accepted 15 Febraury topic heading from the section appears; that is, the cell groupings are closed. Groups of Mathematica cells can be either open or closed. When a cell group is open, all the cells are visible to the user. When a cell group is closed, only the first or heading cell in the group is visible. Students could double-click on any closed cell-bracket (or use the menu option) to open the cell group and view and access the enclosed code corresponding to a specific portion of the notebook. This feature of Mathematica essentially modularizes any large program. Students can see the overall structure of the method, i.e., the steps are shown explicitly, and then can keep more focused on the specific step of interest. Students were given the following assignment. They were to work in teams of three students per team, access the FEM notebook (copy it onto a disk), and use it to solve a suitable problem of their choice. Suitable problems, i.e., those that the Mathematica program could handle, are as described in the documentation in the `Statement of problem' section of the notebook. The recommended type of problem was a basic second-order linear partial differential equation (e.g., Poisson's or Helmholtz's equation) with Dirichlet boundary conditions specified on &, a rectangle in the plane: cu ˆ f x; y in u ˆ g x; y This could represent, for example, a steady-state heat conduction problem in which the unknown, u, represents temperature. The problem type is restricted, yet general enough so students can ask `what if' questions. Students could run a sequence of cases to study the effect that varying some parameter had on the behavior of the FEM solution. The equation coefficients, nonhomogeneous term, domain size, and grid are among the quantities that could be varied. More advanced students 362

2 Using a Computer Algebra System to Teach the Finite Element Method 363 Fig. 1. Outline of Mathematica finite element method notebook. could investigate rewriting the code to make it more efficient or easier to understand. Instead of providing a program in which students would simply supply input parameters, students were provided a template program in which a specific boundary-value problem was solved. This was done intentionally. One goal was for students to experience a situation that occurs in practice; that is, code that has been intended to solve a specific problem is used to solve a different, but related problem. In this case, the code itself must be adapted to the problem of interest. Students must really understand what parts of the code are relevant and what operations these parts of the code perform. Students were to modify the code as necessary for their problems, solve their problems, and verify the correctness of their FEM solutions. These verifications could be done using analytic, numerical, and/or graphical comparisons with analytic solutions or numerical solutions obtained by other methods, or by refining their grids and verifying that their FEM solutions behaved as expected. Since this template code was provided, the only commands that required updating were in the section, `Enter data (including Dirichlet boundary conditions); compute grid spacings', and, additionally, one command in the section, `FEM error estimatesðcompute the discrete sup norm of the error and plot related graphs'. This latter change involved a parameter that became too large for moderately refined grids. The author had inadvertently written a command in a form that was essentially grid-dependent. However, the way that some of the students reacted to the resulting difficulties showed much about their programming skills and their approaches to dealing with the types of difficulties encountered in using software to solve engineering problems. This issue will be addressed in the section, Discussion and Conclusion. STRUCTURE OF FINITE ELEMENT NOTEBOOK The Mathematica notebook implements a basic finite element method (FEM) program, using linear, triangular elements, to solve a secondorder partial differential equation boundaryvalue problem (pde-bvp) on a rectangular region in the plane. Procedural programming was used because this programming style is easier for most students to follow (i.e., compared to functional programming or rule-based programming). The material in Fig. 2, which includes text, Mathematica commands, and graphics, is a summary of the notebook itself. For many of the Mathematica commands, output is suppressed in Fig. 2 in order to present this material more concisely. The entire Mathematica notebook is available at the website [2]. DISCUSSION AND CONCLUSION The FEM is an especially good candidate for CAS instruction since the method is very computationally intensive. Yet there is a well-defined sequence of steps to be performed. Mathematica takes care of the tedious computations, and students are able to concentrate on the general steps of the method. Students are not sidetracked by tedious hand computations that may obscure the overall nature of the method [5]. This computer technology is used to complement the lectures/textbook portion of the course. It is used to make the course more relevant

4 Using a Computer Algebra System to Teach the Finite Element Method 365 Fig. 2. Continued.

5 366 S. Pomeranz Fig. 2. Continued. (hands-on), make the material easier to learn, and because, for most of these students, this is the context in which they will eventually use numerical methods. As numerical methods have tradeoffs, so do methods of teaching numerical methods. This use of Mathematica with a template FEM program is more of a `middle of the road' approach [6]. Students have access to the code, should they wish to modify the program; however, on the other hand, this template can more or less be used as a `black box' in which case students update only the required commands. In either scenario, the notebook provides students with the

6 Using a Computer Algebra System to Teach the Finite Element Method 367 Fig. 2. Continued. capability to interactively explore and observe how the numerical solution depends on the values of certain parameters. This approach enabled the author to see how some of the students reacted when a particular command took too long to evaluate. One command in the section, `FEM error estimatesð Compute the discrete sup norm of the error and plot related graphs', involved a parameter that became too large for moderately refined grids. The author had inadvertently written a command in a form that was grid-dependent. Mathematica was performing a doubly nested loop in sampling the absolute value of the error at selected points. In the original code, 50 sampling points were used per grid step, both in the x-direction and in the y-direction. Thus, for the choice of 6 nodes in the x-direction and similarly in the y-direction, there were ˆ 62,500 sampling and comparison operations. However, when the students ran their problems with more refined grids, Mathematica got hung-up on this command. And this makes sense, because several hundred thousand (or more) operations were required. But instead of looking at the code and determining what might be the cause of this difficulty, some of the students just left Mathematica running all night! We have been introducing technology to our students as labor saving tools, and apparently the students interpreted this as saving all mental labor as well. This episode did generate a discussion with the students about looking at the code (in this case, the nested loops) and attempting to understand the cause of the difficulty and determining more effective `fixes'. Particularly with respect to the topic of finite elements, care must be taken in introducing this topic at the undergraduate level [7]. CASs can play a unique role in rendering this topic suitable for this level of presentation. If students have the mathematical background provided by three semesters of calculus, an introduction to linear

4 Exploring Course Content This chapter explores the course content available in MyMathLab courses. If you take more than one MyMathLab course, you will find that some resources are included in every MyMathLab

An Integrated Freshman Curriculum Cerry M. Klein Department of Industrial Engineering University of Missouri-Columbia Columbia, MO 65211 Abstract - This paper describes a four course sequence that is being

Mathematics/Statistics/ Computer Science Courses We strongly recommend that all students take four years of mathematics in grades 9-12. Many colleges and universities are requiring three years and recommending

Figure 2.8: CCSS Mathematical Practices Lesson-Planning Tool Unit: Date: Lesson: Learning target: As a result of today s class, students will be able to Formative assessment: How will students be expected

1 Students will explore linear functions through two activities. First, students will work in groups to connect a table, graph and equation that represent the same linear function. They will write a verbal

FIFTH GRADE NUMBER SENSE Number sense is a way of thinking about number and quantity that is flexible, intuitive, and very individualistic. It grows as students are exposed to activities that cause them

High Impact Indicators All of the indicators listed in the GED Assessment Target indicators describe the critical thinking skills essential to test-taker success in college, career training, and the workforce.

ALGEBRA THROUGH THE LENS OF FUNCTIONS JUNIOR CERTIFICATE HIGHER LEVEL PART 1 OF 2 1 Introduction To Teachers Algebra Through the Lens of Functions Part 1 and 2 have been designed by the Maths Development

Mathematics Courses Algebra I Course #6401 Grades 9-10-11-12 Prerequisite: 8th grade Mathematics, Pre-Algebra Algebra I is recommended for all students. The purpose of Algebra I is the development of critical

AP CALCULUS AB Course Overview My main objective in teaching AP Calculus is to have my students experience and understand the beauty and elegance of calculus and receive the necessary knowledge and skills

A Novel Set of Courses for Teaching Electrical System Analysis to Mechanical Engineering Students Rico Picone and Paul E. Slaboch Saint Martin's University, Lacey, WA Abstract For many years in the standard

PART MATHEMATICS IN GRADE Number and Operations Multiplication and Division Students consolidate their computational strategies for multiplication, building upon what they learned in Grades and. Representations

Math Pathways STEM students are students who plan to major in Science, Technology, Engineering or Mathematics. Their education plan should be directing them to Calculus and beyond. Math 125 and 131 the

Mathematics (MATH) 1 MATHEMATICS (MATH) MATH 1. Mathematical Reasoning., Summer Recommended for students whose majors do not include a specific mathematics requirement. Objectives are to show some of the

PowerTeaching i3: Grade 6 Mathematics Alignment to the Common Core State Standards for Mathematics Standards for Mathematical Practice and Standards for Mathematical Content for Grade 6 Key Ideas and Details

5 th Grade Common Core State Standards Flip Book This document is intended to show the connections to the Standards of Mathematical Practices for the content standards and to get detailed information at

Simple Interest LAUNCH (7 MIN) Before Why do banks pay interest to their customers? During What is the relationship between Line 1 and the deposit amount? After Which of the two lines shows a proportional

A Tutorial for Students Using MapleTA Louis F. Rossi 14 February 2006 1 For the computationally incompetent or uninterested. If you are comfortable using a web browser to buy something online, or identify

D-4502-9 1 Road Maps A Guide to Learning System Dynamics 2 System Dynamics in Education Project D-4502-9 Road Maps 2 System Dynamics in Education Project System Dynamics Group Sloan School of Management

Content/Discipline Algebra 1 Marking Period 1 - Unit 1 Foundations of Algebra Manhattan Center for Science and Math High School Mathematics Department Curriculum Topic and Essential Question How do you

Computer exercises of basic courses in mathematics at the Helsinki University of Technology Riikka Nurmiainen o/ Maf/tema^cs, 77ekmH t/m%er,s% o/ Abstract Nowadays computers play an increasingly important

The Problems of the Month (POM) are used in a variety of ways to promote problem solving and to foster the first standard of mathematical practice from the Common Core State Standards: Make sense of problems

PART 3 MATHEMATICS IN GRADE 3 Number and Operations Multiplication and Division Students develop an understanding of the operations of multiplication and division, particularly focusing on multiplication

Introduction to Excel Goals and Introduction Welcome to the beginning of your physics lab experience! The lab is an essential part of the course where we use measurement in an attempt to quantify and confirm

TEACHER GUIDE ABOUT MISSION PRIME GAME NARRATIVE It is the not-too-distant future, and the people of earth have decided to undertake a great project: to send a few brave scouts across the cosmos to explore

Algebra Learning Strategies What should students be able to do within this interactive? Select grid intro and read the sample problem. Understand the meaning of the problem. Understand that the problem

EASTERN OREGON UNIVERSITY Mathematics PROGRAM OBJECTIVES The program in mathematics has three primary objectives: To provide a major in mathematics that develops the attitude of mind and analytical skills

AC 2007-2818: IMPROVING CONCEPTUAL LEARNING IN MECHANICS OF MATERIALS BY USING WEB-BASED GAMES AND THE INVOLVEMENT OF STUDENTS IN THE GAME DESIGN PROCESS Arturo Fuentes, University of Texas-Pan American

Oklahoma Department of CareerTech www.okcareertech.org 22: MOODLE LESSON ACTIVITY WELCOME TO THE MOODLE LESSON ACTIVITY TUTORIAL! In this tutorial, you will learn: What the Lesson activity is Suggestions

Grade 5 Louisiana Student Standards: Companion Document for Teachers 2.0 This document is designed to assist educators in interpreting and implementing Louisiana s new mathematics standards. It contains

The Problems of the Month (POM) are used in a variety of ways to promote problem solving and to foster the first standard of mathematical practice from the Common Core State Standards: Make sense of problems

FOCAL POINTS AND TEKS COMPARISON TABLE SET GRADES 6-8 Texas Response to Curriculum Focal Points Highlights Grade 6 The curriculum focal point and its description are presented on the summary page for each

LAGUARDIA COMMUNITY COLLEGE CITY UNIVERSITY OF NEW YORK DEPARTMENT OF MATHEMATICS, ENGINEERING, AND COMPUTER SCIENCE MAT 12O ELEMENTARY STATISTICS I 3 Lecture Hours, 1 Lab Hour, 3 Credits Pre-Requisite:

On-line university a national realization for teaching science in the first academic years ÉLIANE COUSQUER U.S.T.L. (FRANCE) Table des matières 1 A national, cooperative realization..............................

Math 31 Introduction to MINITAB Lab #1 Login with your ID and pass word. If you do not have this, you need to go the 7 th floor of the Math Science building and get it. You will have to wait at least 45

Math Modeling reference cards Defining the problem statement Real-world problems can be broad and complex. It s important to refine the conceptual idea into a concise problem statement which will indicate

D-4506-5 1 Road Maps 6 A Guide to Learning System Dynamics System Dynamics in Education Project 2 A Guide to Learning System Dynamics D-4506-5 Road Maps 6 System Dynamics in Education Project System Dynamics

A COGNITIVE LAB REPORT FOR THE AMERICAN DIPLOMA PROJECT ALGEBRA I END-OF-COURSE EXAM Test, Measurement & Research Services October 14, 2010 1 Abstract In an effort to better understand high non-response