Initial Publication Date: August 23, 2019

Foundational computation for first year physics undergraduates

Duncan Carlsmith, Physics, University of Wisconsin-Madison

The AAPT/APS Joint Task Force on Undergraduate Physics Education report [1] examines the motivations for, goals of, and barriers to including computation in undergraduate physics education. I describe here a physics-forward approach to the task that uses MATLAB Live Scripts in an introductory survey course for aspiring physics majors as a foundation for integrating computation throughout the curriculum.

I was inspired to choose (and myself to just-in-time learn to use) MATLAB by its interactive onramp, tutorials, documentation, help, support, physics-focused MathWorks and user-supplied clickable examples, Live Scripts supporting LaTeX, cloud services and mobile app, and tools for symbolic mathematics, image processing, signal analysis, and deep learning. MATLAB is free for my students via a university license and GNU Octave is an open source alternative. The turn-key nature of MATLAB installation, onboarding, and use allows instructors and students to focus on applications.

An important question is how to include computation in a physics class without sacrificing canonical content. In a context of a CANVAS learning environment with integrated Wiley adaptive learning, e-text, and electronic homework system, and in parallel with active learning lectures and discussion, I provide a set of physics-focused CANVAS online MATLAB and physics tutorials while integrating computation in hands-on labs. The tutorials address simultaneously computational, science literacy, and communication learning goals. MATLAB-based modelling and data analysis in hands-on labs that employ traditional equipment and mobile phones improves student acquisition of science methodology and labs skills and student self-efficacy.

Via the physics-focused MATLAB tutorials illustrating a variety of computational methods and sophisticated MATLAB functions, students discover, download, and themselves analyze open science data from LHC, LIGO, NASA, and QUARKNET databases and from supplements to peer-reviewed publications. Students fit nonlinear functions to dilepton mass distributions while studying relativistic kinematics. While studying gravity, students filter and cross correlate gravitational wave interferometer signals and fit ellipses to infrared observations of stellar orbits around SAG A*. While studying magnetic induction, they numerically optimize the world's simplest electric train. Prior to studying conventional and cell-phone microscopes in the lab, students use symbolic matrix methods to analyze optical systems. Other tutorials illustrate numerical simulations of skydiving, electrostatic equilibrium, wave interference, radioactive decay, and matter wave bound states. The tutorials are constructed as CANVAS quizzes for automated and Speed Grader assessment. "Try this" elements are provided in the scripts to address questions in physics. Time-intensive coding and debugging is minimized.

In the hands-on labs, students import and themselves analyze data collected from PASCO equipment, digital oscilloscopes, and the inertial, acoustic, magnetic, and optical sensors of their own mobile phones. Executed Live Scripts and publication quality plots submitted through CANVAS interactive lab procedures and formal reports are the basis for assessment of the computation and other elements. Every lab is scaffolded with an assessed interactive CANVAS prelab. The prelabs provide template simulation and analysis scripts as well as information about the physics, equipment, goals, and procedures so students arrive at lab ready to dive in. Only one hands-on lab period in two semesters is sacrificed to a dedicated computational modelling project cabal.

In surveys, students indicate they have a new appreciation of the importance of modelling and analysis through computation in science and engineering. Many students are motivated to advance in mathematics and physics by tutorials which touch intermediate and advanced mathematical topics such as linear algebra, complex variables, differential equations and Fourier transforms, and intermediate and advanced physics topics such as the theory of radiation from a point charge and elementary particle physics. A number of students, newly enabled by their introduction to MATLAB, have dived into image analysis and deep learning independent projects. (Two such projects are described at A number of students have acquired post class summer research positions largely for having acquired the computational skills developed in this class.


This work is supported in part by the University of Wisconsin-Madison Educational Innovation small grants program.


[1] Phys21, Preparing Physics Students for 21st-Century Careers, A report by the Joint Task Force on Undergraduate Physics Programs, Paula Heron and Laurie McNeil, Co-chairs
Available from:

Downloadable version of this essay

Foundational compiutation for first year physics undergraduates (Microsoft Word 2007 (.docx) 25kB Aug23 19)