Computation in Undergraduate Physics:
The Lawrence Approach

Text of Talk Delivered as Part of a Panel Discussion at
the March Meeting of the American Physical Socie
Montreal, Quebec, CANADA
25 March 2004
Session W38 (2:30--5:36 PM Room 520E, Palais dex Congres)

David M. Cook
Department of Physics
Lawrence University
Box 599
Appleton, WI 54911-5626



Department website:

Project website:


Most efforts using computers in physics curricula focus on introductory courses or individual upper-level courses. In contrast, since the mid 1980s, the Lawrence Department of Physics has been striving to embed the use of general purpose graphical, symbolic, and numeric computational tools throughout our curriculum. Developed with support from the (US) National Science Foundation, the Keck Foundation, and Lawrence University, our approach involves introducing freshman to tools for data acquisition and analysis, offering sophomores a course that introduces them to symbolic, numerical, and visualization tools, incorporating computational approaches alongside traditional approaches to problems in many intermediate and upper level courses, and making computational resources available so that students come to see them as tools to be used routinely on their own initiative whenever their use seems appropriate. A text titled Computation and Problem Solving in Uncergraduate Physics and reflecting the developments at Lawrence is now complete, at least in a first edition, but---because of microscopic customizability that permits the text to be adapted to each end user's spectrum of hardware and software, it has not yet found a commercial publisher. Details about the Lawrence curricular approach and information about how to acquire copies of the text from the author can be found from links at


Since the mid 1980s, we in the Department of Physics at Lawrence University have been developing the computational dimensions of our upper-level curriculum. Rather than create a major in computational physics, we have focused on incorporating computation into a fairly traditional physics major. To that end, we have built a Computational Physics Laboratory---the CPL---that makes a wide spectrum of hardware and software available to students, and we have developed a curriculum that, first, introduces sophomores to these resources and, second, encourages them to continue to use the CPL in their subsequent studies. Further, with support from a recent NSF CCLI-EMD grant, I have completed a flexible and customizable text titled Computation and Problem Solving in Undergraduate Physics---CPSUP. This afternoon, I want to

Underlying Convictions

The primary tasks of an undergraduate program for physics majors are to awaken in our students a full realization of the beauty, breadth, and power of our discipline and to help them develop not only a secure understanding of fundamental concepts but also the skills to use a variety of tools in applying those concepts. Among the tools, we at Lawrence would firmly include computational resources of several sorts.

We also believe

In the broadest of terms, we should be structuring our curricula so that, ultimately, all physics majors will have the necessary knowledge and the personal confidence to pursue computational approaches fluently, effectively, and independently on their own initiative.

The Curricular Context

The best way to describe the Lawrence approach is to track the computational experience of an entering freshman physics major. Each year, full-time students at Lawrence take three courses in each of three ten-week terms. Class periods are 70 minutes long, and a one-term course translates officially into 3-1/3 semester hours. The typical program of a physics major is shown in OHD1. The minimum major is satisfied by the courses marked with an asterisk---ten in physics and four in mathematics. Courses in bold type direct students explicitly to the computer and, in most cases, include instruction in one or more of our computational resources. Of the twenty electives, three must be in physics, seven to ten will be chosen to satisfy various general education requirements, and ten to seven are completely free, though most of our (typically) ten graduates each year will take courses in physics, mathematics, and computer science beyond the minimum required for the major.

Available physics electives are shown in OHD2. Again, entries in bold type make explicit use of computational resources. In many other courses, students use our resources regularly on their own initiative. Majors must elect three courses from the top group of eleven, and most take three or four more from the entire spectrum. Tutorials and independent studies sometimes extend over more than one term and can culminate in honors in independent study at graduation.

The Computational Components

The computational experiences of Lawrence physics majors are summarized in OHD3. Prospective physics majors at Lawrence first encounter computational approaches in the introductory course. In particular, students use LoggerPro, Excel, and Kaleidagraph. Exercises assigned in the laboratory routinely involve automated data acquisition, statistical analysis, and curve fitting; exercises assigned in lectures occasionally send students to the laboratory computers for graphing theoretical results or pursuing numerical solutions to problems in dynamics.

Beyond the freshman year, majors---of course---continue to use Excel and Kaleidagraph. They also have 24/7 access to our Computational Physics Laboratory, which is equipped with nine Silicon Graphics UNIX workstations, monochrome and color printers, and software in all the categories I have enumerated. Fall-term sophomores are introduced explicitly to Electronics Workbench in our electronics course; winter-term sophomores are required to take the course Computational Mechanics, to which I will return in a moment; and spring-term sophomores see additional uses in the course Electricity and Magnetism.

With Computational Mechanicsas a uniform background, subsequent theoretical and experimental courses alike offer students many opportunities to continue honing their computational skills and, depending on the instructor, some of these courses will direct students explicitly to the CPL for an occasional exercise. One upper-level course---Computational Physics, to which I will return---is heavily dependent on the CPL. Most senior capstone projects exploit the resources of the CPL, at least for visualization of data and/or preparation of reports. Some projects, including those enumerated on this overhead, have made extensive use of these facilities.

Computational Mechanics

Two courses, one a required sophomore course and the other an elective junior/senior course, are now included among our offerings. In the winter of 2003 (just a year ago), we replaced an elective course titled Computational Tools in Physics and taken by only a few sophomore majors with a new---and required---sophomore course constructed by merging some of the topics covered in Computational Tools with some of the topics covered in an existing intermediate-level course in classical mechanics. The new course is called Computational Mechanics.

Beginning with last year's sophomores, Computational Mechanics became the starting point in our nurturing of our students' abilities to take full advantage of the resources of the CPL. The atalog description of this course is shown in OHD4, The topics addressed each week in this course are shown in OHD5, The course begins with a tutorial exercise to acquaint students with the SGI workstations and the UNIX operating system while also reviewing and embellishing introductory studies of translational and rotational kinematics and dynamics, impulse, momentum, work, kinetic energy, and common forces. Students spend week 2 entirely in the CPL becoming acquainted with the general capabilities of IDL, especially for graphical visualization of scalar functions of one, two, and three variables, and with TGIF for generating drawings. In weeks 3 and 4, we return to mechanics to set up and solve standard problems in one-dimensional motion via standard analytic techniques, and to extend the definition of potential energy and conservative forces to three dimensions. Then, in weeks 5 and 6, after a pause for evaluation, students encounter the elements of LaTeX and spend several days on the standard analytic approaches to the central force problem. The remainder of our ten-week term is spent mostly in computationally related activities, including an orientation to MAPLE, a discussion of numerical algorithms for solving ODEs and evaluating integrals, and experience using routines built into IDL for solving ODEs and evaluating integrals. Examples include many of the problems already discussed analytically but also introduce non-linear and chaotic systems. Sample integrals are found in the evaluation of potential energies, moments and products of inertia, and electric and magnetic fields and potentials.

Computational Mechanics does not, of course, cover all of the mechanics in its predecessor. In particular, Lagrangian mechanics and rigid body dynamics were moved to our elective course Advanced Mechanics. These topics thus remain available to junior and senior majors but are not any longer encountered by all majors. We believe, however, that this loss is more than compensated by the acquaintance all of our majors now have with computational approaches and by their and our ability to exploit computational approaches at many points in our intermediate and advanced curriculum.

Computational Physics

The second computational course, to be taught for the first time next fall, is called Computational Physics and is a junior/senior elective. Its catalog description is shown in OHD6, Some years ago, I harbored the illusion that finite-difference and finite-element approaches to partial differential equations could be incorporated into other courses in our curriculum. That effort faltered, first because it was difficult to find adequate time in those courses and second because only those students who had elected Computational Tools had the necessary background. Now, with all majors required to take Computational Mechanics, the second of those impediments has evaporated. I have created---better, I am in the process of creating---a new course that will fill this significant gap in the computational topics to which our majors are introduced. At the moment, however, I can say little more than what is in the course description. With support from a grant from the W. M. Keck Foundation, I will spend a very large part of my summer finalizing the details of the first offering of this course and drafting the text materials.

The Text

The NSF grant mentioned at the beginning provided support for expanding the extensive library of instructional materials developed at Lawrence into a flexible publication as a resource for other institutions. To address the challenge posed by the wide variety of hardware and software in use, CPSUP can be assembled in several different versions by selection from a wide assortment of components, some of which---the generic components---will be included in all versions and others of which---those specific to particular software packages---will be included only if the potential user requests them. Thus, the specific software and hardware treated in any particular version will be microscopically ``tailor-able'' to the spectrum of resources available at the instructor's site.

The table of contents for the first edition of CPSUP includes the chapters and appendices listed in OHD7. Chapter 1 stands alone; chapters 2 and 3 introduce the general features of two common array processors; chapters 4, 5, and 6 introduce the general features of three different computer algebra systems; chapters 7 and 8 introduce a programming language and the numerical recipes library; chapters 9, 10, 11, and 12 address several important categories of computational processing; and the appendices introduce a publishing system and a program for producing drawings. Any particular version would include at least one of chapters 2 and 3 and one of chapters 4, 5, and 6, and chapters 9, 11, and 12, though chapters 9, 11, and 12 would be assembled with only those components that illustrate the programs included in the selections from chapters 2--6. Chapters 7, 8, and 10 and the appendices would be included only if desired by the end user. Chapters flagged with an asterisk are included in the version used at Lawrence.

Chapters 2--6 and 10, which focus on individual application programs, adopt a tutorial, self-study style and lead the reader through an exploration of the main features of the corresponding programs. They lean in some measure on vendor-supplied documentation and on-line help to encourage and guide self-study. Each of Chapters 9, 11, and 12 begins with a section that sets six to eight representative physical problems, the successful addressing of which benefits from exploitation of the computational technique with which the chapter deals. Subsequent sections describe how one might use a symbolic tool in application to some of the problems set in the first section, describe appropriate numerical algorithms generically, and then illustrate how those algorithms can be invoked from a variety of application programs. Each chapter concludes with numerous exercises. While the objective is for students to become fluent in the use of a spectrum of computational tools---and the chapters are organized by program or by computational technique, the focus throughout is on physical contexts.

Detailed information about CPSUP, including tables of contents for each chapter and information about how to obtain examination copies is contained in links at the URL

Even among sites that use the same spectrum of hardware and software, however, many aspects of local environments---some of them shown in OHD8---are still unique to individual sites. CPSUP does not constrain local options in these matters. Throughout the book, individual users are directed to a local guide for site-specific particulars. A template for that guide, specifically the one used at Lawrence, is included in the supplementary materials available to each user, but it will require editing to reflect local practices.

The desired flexibility to tailor the book to a variety of circumstances would be unattainable without LaTeX, which, in particular, can decide in response to conditional statements controlled by Boolean flags which files should be included in any particular processing run. Further, additional topics can be added easily, and, in anticipation of the course I will be offering next fall, I am currently drafting a chapter on partial differential equations. Chapters on data analysis, curve fitting, Fourier analysis, and image processing are contemplated. Indeed, the flexibility of design means that, in time, other authors may be moved to contribute components, so the book may expand to accommodate a wider and wider spectrum of hardware and software and to include topics not originally incorporated.