Introducing Computation: A Laboratory Approach

posted November 4, 2020 and revised December 17, 2021
by Kevin Adkins & Jennifer Birriel

Kevin Adkins and Jennifer Birriel

Department of Physics, Earth Science and Space Systems Engineering Morehead State University

“Practice makes perfect” and “start them young” are phrases we’ve all uttered or heard at some point, although likely in the context of athletics, musical instruments or hobbies. However, these easily apply to computational physics as well! In fact, this general attitude forms the foundation of the culture we are developing in our physics program around integrating computation into the curriculum. In our recently revised curriculum that goes into effect during the fall 2020 semester, students entering our program complete two introduction to scientific computing courses in their first year. The first features Microsoft Excel and Arduino, a C-style language written in an Integrated Development Environment (IDE) that provides an interface between the computer and a hardware microcontroller. The second focuses on the C++ programming language. But without a formal introduction to physics, the problems in these courses center more on syntax than modeling.

A two-semester sequence of calculus-based introduction to physics courses is required for our physics majors as well as some of the majors in chemistry, mathematics, and engineering technology. This sequence seems like a natural place in our curriculum for students to begin developing their computational skills to model physical problems and analyze output. However, we must be cognizant of those students who do not have a background in the C++ programming language, and make it equitable for all.

Microsoft Excel is familiar to most students entering the first half of the course, and affords the opportunity to learn and practice computation and analysis while interacting with programming concepts. It’s easy to draw parallels between Excel and a more syntax heavy language like C++. For example, autofilling a column in Excel can easily be related to a loop structure, and naming cells is no different from naming a variable complete with associated syntax errors if the correct identifier isn’t used leading naturally to a discussion of debugging. Additionally, Excel allows students to implement multiple numerical analyses in a single spreadsheet, and study the effects of changes to parameters like step size quickly with plots readily available in the software. Thus, Excel is a great platform to make the exercises accessible to all students.

Lab and Computation: A Perfect Pair

Our introductory courses are composed of both lecture and laboratory components. The lecture is a semester-long sprint focusing on conceptual basics and problem-solving applications, with little time to spare for computational exercises. The laboratory, on the other hand, is a dedicated 1 hour and 50 minute period every week where students work in groups of four to complete one experiment and analysis per session, to be submitted before they leave. This arrangement makes the lab an excellent atmosphere for students to work closely with their peers on computational exercises. This observation led us to integrate computation by converting three of the 12 lab experiments per semester into computational exercises where students can work in pairs on a single computer to solve a guided problem.

The new computational labs are selected to be representative of the semester’s material, presented concurrently with the concepts under discussion in the lecture. We do not lose anything from the curriculum, rather these labs simply replace the “traditional” lab with a computational exercise covering the same material. The converted labs are topics that lend themselves to a straightforward computational problem but also provide a more rigorous and stimulating exercise for the students than their traditional counterpart. For the first semester, students explore two-dimensional kinematics (week 4), power (week 9), and momentum (week 11). In the second half of the course they examine Coulomb’s law (week 2), RC circuits (week 7), and diffraction and interference (week 14).

Each exercise is prepared in a “laboratory style”: an introduction to the material and a scenario accompanied by a series of steps to follow that result in a solution. Along the way the goal is for the students to make the appropriate computations using a provided Excel spreadsheet and answer analysis questions. By the time it’s completed, the students have solved a full problem using computational methods broken up into digestible steps. Two sample labs, uploaded to Faculty Commons, are linked at the bottom of the page to demonstrate this approach.

The selected exercises explore essential techniques in computational physics, such as fundamental numerical methods like the Euler and Euler-Cromer methods to analysis. Each problem requires students to appropriately convert an equation into a correctly formatted command the computer can execute. Moreover, all of the computational labs require plotting output data to draw conclusions, whether that’s an object’s trajectory or the strength of the electric force. This is critical, because students frequently struggle to describe data and extract answers from plots. Practicing this necessary skill using familiar problems and concepts builds confidence as they move into advanced courses and research projects.

Student Reception

This implementation of computation in our curriculum is in its infancy. Nevertheless, initial student feedback from one semester has been overwhelmingly positive. They enjoyed the pair programming atmosphere, and were frequently surprised that we can easily model a “pencil and paper” problem with a computer and use the output to extract an accurate answer! This notion prompted discussion about computational physics both as a career field and as a tool. The experience with these problems persuaded some students to pursue the computational physics track that we offer in our department.

This excitement and response from students makes the implementation seem like a success, but we have to consider the pedagogical impacts. What is the true metric of this computational integration as instructors? How can we know if its an effective teaching practice? Unfortunately, the answer seems to be time. As the next several student cohorts move through the upper-division physics courses, specifically including our advanced computational physics class, we must take note of how students perform in computational exercises in our selected language, C++. Do they make the connection between C++ syntax and Excel methods? Do they interpret plots and extract answers correctly? These questions will help us evaluate our implementation, and also guide what connections we emphasize in the computational lab exercises moving forward. After all, if we’re going to start them young, we need to lay a solid foundation.


From an instructor point of view, this integration is the perfect scenario. The laboratory class size is small enough to work one-on-one with student pairs. Additionally, the problems are challenging but of an appropriate length to finish during a single class period. For the first time, students are introduced to the power of computing as a problem solving tool: a problem that could be solved by hand can also be solved using the implementation of an appropriate numerical method. Using problems that are similar to those they encounter in the lecture and their homework makes the connection between computation and advanced problem solving clear. Moving into advanced physics courses, independent studies, and research often means leaving behind exact answers. Fortunately, experience with implementing computational numerical methods, modeling, and analyzing output provides a pathway to an answer that may have otherwise been unachievable.

Sample Lab Exercises

Two exercises that we are using in our implementation are linked below. The first, a first semester lab, is related to the concept of work and power. The student will decide whether or not a car should attempt a pass on the highway given several constraints of their car. The second, a second semester lab, is an investigation of RC circuits both theoretically and numerically. The student will make numerical calculations for an RC circuit and then compare that to the exact solution and investigate any differences.

Horsepower: Click here to view the Horsepower Computational Lab in the Faculty Commons

RC Circuits: Click here to view the RC Circuits Computational Lab in the Faculty Commons