•  
  •  
 

Publication Date

7-3-2026

Keywords

Machine learning, Coupled pendulums, Fourier analysis, Gradient descent, Differential equations education, Jupyter Notebook

Disciplines

Mathematics | Physical Sciences and Mathematics | Science and Mathematics Education

Abstract

As data-driven methods are increasingly used in science and engineering, students benefit from learning to integrate machine learning techniques with traditional mathematical modeling. We present a hands-on extra-credit assignment for an undergraduate ordinary differential equations (ODE) course that enables students to compare classical analytical methods with data-driven approaches on the same physical system. Using a coupled-pendulum system---two pendulums connected by a spring---with real experimental data acquired via video tracking of a real physical setup, students work through three models in a guided Jupyter notebook with all code provided. First, they fit a neural network with Fourier features as a purely data-driven approach and observe its failure to extrapolate beyond the training data. Second, they fit a physics-based two-frequency solution derived from the coupled ODE using gradient descent, beginning from random initial guesses in order to expose a concrete failure mode of gradient-based optimization. Third, they apply a hybrid approach in which two Fourier-peak frequencies extracted from the data serve as initial guesses for gradient descent, demonstrating how importing mathematical structure into the optimization step can overcome that failure. We find that Fourier-based initialization improves the reliability of gradient-based fitting and yields a strong data fit. The assignment concludes with a transfer task in which students apply these ideas to a new engineering scenario and argue for the approach they would choose.

Share

COinS
 
 

To view the content in your browser, please download Adobe Reader or, alternately,
you may Download the file to your hard drive.

NOTE: The latest versions of Adobe Reader do not support viewing PDF files within Firefox on Mac OS and if you are using a modern (Intel) Mac, there is no official plugin for viewing PDF files within the browser window.