vix.ing · top · new · best · stats · spec

Learn Physics by Programming in Haskell

2014/12/11 by Scott N. Walck · 5 voices
Computer Science · Physics and Astronomy · #Calculus (dental) #Computational Physics and Python Applications #Current (fluid) #Dependency (UML) #Expression (computer science) #Functional programming #Haskell #Mathematics, Computing, and Information Processing #Teaching and Learning Programming #Type (biology) #cs.CY #cs.PL #physics.ed-ph

paper · pdf · doi:10.4204/eptcs.170.5

published as EPTCS 170, 2014, pp. 67-77 · In Proceedings TFPIE 2014, arXiv:1412.4738

openalex publication_date 2014/12/11 · arxiv created 2014/12/16 · arxiv updated 2014/12/17 · openalex created_date 2016/06/24 · openalex updated_date 2026/08/05

Abstract

We describe a method for deepening a student's understanding of basic physics by asking the student to express physical ideas in a functional programming language. The method is implemented in a second-year course in computational physics at Lebanon Valley College. We argue that the structure of Newtonian mechanics is clarified by its expression in a language (Haskell) that supports higher-order functions, types, and type classes. In electromagnetic theory, the type signatures of functions that calculate electric and magnetic fields clearly express the functional dependency on the charge and current distributions that produce the fields. Many of the ideas in basic physics are well-captured by a type or a function.

Citations

Discussions

Related