Time: | Tuesday and Thursday, 10-11:30am |
Room: | 1250 USB |
Instructor: | Mark Newman |
Office: | 322 West Hall |
Office hours: | Wednesdays 1:30-3:30pm |
Email: | mejn@umich.edu |
Quick links:
The use of computers in physics has grown enormously in the twentieth and twenty-first centuries, to the point where computers play a central role in virtually every new physics discovery. From particle physics and astrophysics to quantum computing and biophysics, calculations on computers have become one of the most indispensable tools of scientists today.
This course will give participants an introduction to the solution of physics problems using computers. Assuming no previous computer programming experience, the course will introduce the basic ideas and programming skills of computational physics and students will develop their own computer software to solve problems in quantum physics, electromagnetism, biophysics, mechanics, chaos, nonlinear dynamics, and other areas.
Calculus, linear algebra, and physics up to 390 will be required to understand the material. No previous programming experience is required. The course will make use of the Python programming language, and will begin with an introduction to programming in Python.
The course will require you to do a fair amount of programming work on your own time. One of the advantages of the Python programming language is that it is available for free, which means that if you have a computer of your own you can download a copy of Python and work on your own computer. You can find instructions for installing Python in Appendix A of the textbook. You should install version 2 of Python (probably version 2.7 in fact), for compatibility with some of the other software we need to use. Then, also for compatibility, you need to include the following line at the start of each program you write:
from __future__ import division,print_functionNote that there are two underscore symbols before the word
future
and another two after it.
If you do not own your own computer or you do but you prefer not to use it, computers are available in the Physics Department's Physics Authorized Users Lab (PAUL) on the second floor of Randall Lab (vertically above the Physics Help Room, which is on the first floor, and next to the Computing and Technology Support office). Both Mac and Windows computers are available in PAUL, and all of them have the Python programming language already installed. PAUL also provides printers that you can use to print out material to be handed in. And even if you use your own computer for doing homework you can still use the PAUL printers for printing out the end results.
There will be weekly graded problem sets consisting mainly of programming challenges. Classroom time will be spent primarily on learning the principles and techniques behind computational physics methods; the homeworks are your chance to put those principles into action. A typical exercise will describe a physics problem that can be solved using a method studied in class and ask you to write a program to solve it and present your results.
Collaboration is allowed when solving exercises, but you must write your own programs and turn in your own work. Direct copying from other students is not allowed. You may use example programs from the textbook as a starting point for your work, but copying from any other source, including books or the Internet, is not allowed.
There will be four take-home midterms during the semester which will consist of programming challenges similar to those on the homeworks. The exams differ from the homeworks in that collaboration is not allowed. All exam problems must be solved without consulting others or copying from any source, except again that you may use programs from the textbook as a starting point. You will have 48 hours to complete each of the take-home exams. There will be no other homework in the weeks when there are midterms. There will be no final exam for this course.
The course grade will be 40% on the homeworks and 15% on each of the midterms.
There will be reading assignments for each lecture. The assignments are listed on the schedule below. Students are expected to do the reading for each lecture in a timely manner.
Throughout the semester we will have regular in-class programming sessions, as indicated on the schedule below. During these sessions you are invited to bring a computer to class and work on programming problems – optional example problems will be handed out in class, but you can also work on the homework problems if you wish. The programming sessions will provide an opportunity for you to get help with programming, debug code, and ask questions of the professor.
The textbook for the course is Computational Physics by M. Newman, ISBN 1480145513. It's brand new – just came out in November – and so may not yet be in stores, but you can buy it from Amazon here.
I know of no other textbooks on computational physics using Python, but there are several good books that make use of other languages. If you want a second opinion on a particular topic you might like to consult one of the following:
There are a bunch of programs and data files that you'll need for doing the homework. I've assembled everything you'll need into a single zip file which you can download from here. Grab a copy of this file and unzip it into a convenient folder on your computer, so that you have all the files ready when you need them. Throughout the textbook and in the homeworks, where it mentions files in the "on-line resources", this is what it is referring to.
Other files:
piano.txt
– waveform of a
single piano note
trumpet.txt
– waveform of
a single trumpet note
violin.txt
– waveform of
a single violin note
Date | Topic | Reading | Downloads | Notes |
---|---|---|---|---|
Thursday, Jan. 10 | Orientation and Introduction to Python | Chapter 1 | ||
Tuesday, Jan. 15 | Basic programming | 2.1, 2.2 | ||
Thursday, Jan. 17 | Loops, lists, and functions | 2.3-2.7 | Homework 1 | Homework 1 handed out |
Tuesday, Jan. 22 | Programming session | |||
Thursday, Jan. 24 | Graphics | Chapter 3 | Homework 2 | Homework 1 due, Homework 2 handed out |
Tuesday, Jan. 29 | Speed and accuracy | Chapter 4 | ||
Thursday, Jan. 31 | Integrals | 5.1-5.3 | Homework 3 | Homework 2 due, Homework 3 handed out |
Tuesday, Feb. 5 | Programming session | |||
Thursday, Feb. 7 | Romberg, Gaussian, and multidimensional integration | 5.4-5.8 | Homework 3 due, no new homework | |
Tuesday, Feb. 12 | Differentiation and interpolation | 5.9, 5.10 | Midterm 1 | First midterm handed out |
Thursday, Feb. 14 | Simultaneous equations | 6.1, 6.2 | Homework 4 | First midterm due, Homework 4 handed out |
Tuesday, Feb. 19 | Nonlinear equations | 6.3 | ||
Thursday, Feb. 21 | Maxima and minima | 6.4 | Homework 5 | Homework 4 due, Homework 5 handed out |
Tuesday, Feb. 26 | Fourier transforms | 7.1-7.3 | ||
Thursday, Feb. 28 | The fast Fourier transform | 7.4 | Homework 6, piano.txt , trumpet.txt | Homework 5 due, Homework 6 handed out, due March 12 |
Mar. 5, Mar. 7 | No class | Winter Break | ||
Tuesday, Mar. 12 | Ordinary differential equations | 8.1 | Midterm 2, violin.txt | Homework 6 due, Second midterm handed out |
Thursday, Mar. 14 | Higher order equations | 8.2, 8.3 | Homework 7 | Second midterm due, Homework 7 handed out |
Tuesday, Mar. 19 | Adaptive methods | 8.4 | ||
Thursday, Mar. 21 | Boundary value problems | 8.5 | Homework 8 | Homework 7 due, Homework 8 handed out |
Tuesday, Mar. 26 | Leapfrog and Bulirsch-Stoer methods | |||
Thursday, Mar. 28 | Partial differential equations | 9.1, 9.2 | Homework 8 due, no new homework | |
Tuesday, Apr. 2 | Forward time methods | 9.3 | Midterm 3 | Third midterm handed out |
Thursday, Apr. 4 | Spectral methods | 9.3 | Homework 9 | Third midterm due, Homework 9 handed out |
Tuesday, Apr. 9 | Random processes | 10.1 | ||
Thursday, Apr. 11 | Monte Carlo integration | 10.2 | Homework 10 | Homework 9 due, Homework 10 handed out |
Tuesday, Apr. 16 | Monte Carlo simulation | 10.3 | ||
Thursday, Apr. 18 | Simulated annealing | 10.4 | Midterm 4 | Homework 10 due, Fourth midterm handed out |
Tuesday, Apr. 23 | Advanced topics | Fourth midterm due |