PHY494 — Topic: Computational Methods in Physics
The course provides an introduction to using the computer as a tool to solve problems in physics. Students will learn to analyze problems, select appropriate numerical algorithms, implement them using Python, a programming language widely used in scientific computing, and critically evaluate their numerical results. Problems will be drawn from diverse areas of physics.
The class has been running since Spring 2016; it will be offered in Spring 2021.
For a brief overview, see this page and the Syllabus (PDF).
Topics
The topics of the last class included applications in electrostatics and heat transfer as well as writing a molecular dynamics code to simulate liquid argon.
Students worked on Final Projects in 2019 as diverse as path integral Monte Carlo, simulations of celestial bodies such as Jupiter’s Trojan asteroids or the solar system, electrons in J J Thompson’s classical experiment, molecular dynamics of organic molecules or rock salt crystals, or the collective behavior of self driving cars.
The Final Projects in 2016 included navigation in the solar system, real time digital soundeffect processing, and agent-based modeling such as generating a winning strategy for Black Jack.
Time and requirements
- Spring 2021: listed as PHY 494, class 20366
- TTh 1:30pm — 2:45pm
- ASU Sync Mode (online or in-person in room PSH 355 if requested)
- Students will have to contact the Physics Undergraduate Coordinator, Ms Morgan Texeira, to get access to the course.
- PHY 252 is a pre- or co-requisite.
If possible, bring your own laptop (Linux or Mac OS X preferred but we can make Windows work, too).
Course Description
The course provides a practical introduction to using the computer as a tool to solve problems in physics. Students will learn how to work in a scientific computing environment, to analyze a physical problem, select appropriate numerical algorithms to solve the problem, and to implement them. The course will introduce the students to computer graphics and object oriented design. Students will work in teams, critically evaluate their approaches and results, and present them in a professional manner to their peers. The instructor will introduce problems and guide students to their solution.
This is a three-credit hour course. It will be taught in a computer laboratory/studio setting. The emphasis is on practical work, with the instructor initially introducing the problem, and the students then pursuing pre-structured programming exercises and projects. Assessment will primarily focus on projects, including group projects, in which students solve a problem as a small team and present their work as a short report or as a poster presentation.
In order to facilitate the interactive setting, the capacity will be capped at 24 students. The class is designed to work equally well for remote and in-person students.
PHY 252 is a co-requisite.
Learning outcomes
Students will learn to program computers in order to solve physical problems. In particular, they will be able to write object oriented code in the open source Python programming language, which is widely used in science and engineering and in some of the biggest tech companies such as Google.
Students will also learn how to solve problems in teams and to communicate their work clearly and effectively.
By the completion of the course, students should be able to quickly apply their knowledge to problems they encounter in other courses and experimental and theoretical research projects.
List of topics
- Working in a scientific computing environment: basic Linux and command line.
- Version control with git
- Programming in Python (including object oriented programming and use of the numpy library).
- Plotting and visualization with matplotlib.
- Numerics fundamentals: numbers, errors
- Differentiation and Integration
- Ordinary differential equations (ODE), integration of equations of motion
- Linear algebra (vectors, matrices, eigenvalue problems)
- Root finding and optimization
- Partial differential equations (PDE) e.g. Poisson’s equation, wave equation
- Use of high performance computing (HPC) (if time permits)
Books and Resources
Recommended text books
- Computational Modeling and Visualization of Physical Systems with Python, Jay Wang (2016) Wiley-VCH. ISBN: 978-1-119-17918-4
- Computational Physics: Problem Solving with Python, 3rd Edition, Rubin H. Landau, Manuel J. Páez, Cristian C. Bordeianu. (2015) Wiley-VCH. ISBN: 978-3-527-41315-7
Additional books and online resources
- Effective Computation in Physics. Field Guide to Research with Python, Anthony Scopatz and Kathryn D. Huff. (2015) O’Reilly
- A Survey of Computational Physics, Rubin Landau, Manuel J. Páez, and Cristian C. Bordeianu. (2011) Princeton University Press. Free online ComPADRE edition and PDF
- Software Carpentry (especially the lessons on the Unix Shell, Version Control with Git, and Programming with Python)
Course website
- Course page asu-compmethodsphysics-phy494.github.io/ASU-PHY494/
- ASU-CompMethodsPhysics-PHY494 GitHub site
Videos
For a number of lessons in Spring 2020, videos were created, which you can look at to get a feel for the class.
In the Bisection routine, the |f(c)| < eps will give bad results if the slope is small e.g. f(x) = 10**(-8)*g(x). The relative error |b – a| <= eps*|b| will do the job.