A Pedagogical Framework for Physics-Informed Machine Learning: From Classical Pendulum to Quantum Anharmonic Oscillator Using PyTorch on Modern GPU Hardware

Abstract

We present a five-module pedagogical framework for teaching physics-informed machine learning (ML) through two progressively complex physical systems: a driven, damped nonlinear pendulum and a one-dimensional quantum anharmonic oscillator. Five model architectures are implemented and compared: a standard artificial neural network (ANN), a one-dimensional convolutional neural network (CNN), a long short-term memory (LSTM) network, and two physics-informed neural networks (PINNs) -- one per physical system. All models are implemented in PyTorch~2.9 and executed on an NVIDIA RTX~5090 GPU, making the framework directly applicable to modern deep learning laboratory courses. Quantitative benchmarks show that data-driven models achieve mean absolute errors of 1.3×10-2~rad (pendulum ANN) and 4.4×10-5~a.u.\ (quantum CNN), while the curriculum-trained pendulum PINN reaches an MAE of 3.1×10-2~rad using only collocation points. A systematic CPU-vs-GPU benchmark reveals speedups ranging from 1.2× (small ANN) to 24.6× (LSTM), providing a concrete pedagogical demonstration of when GPU acceleration is -- and is not -- warranted. The framework is packaged as self-contained Jupyter notebooks designed for a graduate-level Deep Neural Networks for Physical Systems course, with embedded reflection questions that guide students from data-driven thinking toward physics-constrained formulations.

0

Turn this paper into a full lesson

ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…