COURSE TIME:
Tuesdays and Thursdays noon - 3:00 pm
COURSE LOCATION: Physics 285
INSTRUCTOR:
Richard Scalettar
TEACHING ASSISTANT:
Keerthi Vasan Gopala Chandrasekaran
ADDITIONAL PROBLEM SESSIONS:
GRADING:
|
![]() Programs will be written in C or C++ in first part of course, and python in the second portion. |
TEXT:
None required. However....
REQUIRED BACKGROUND:
NOTES:
DETAILED SYLLABUS, PART ONE (Computational Physics in C):
Class/Lab One (Tuesday April 2):
Class/Lab Two (Tuesday April 4):
Class/Lab Three (Tuesday April 9):
Class/Lab Four (Thursday April 11):
Class/Lab Five (Tuesday April 16):
Class/Lab Six (Thursday April 18):
Class/Lab Seven (Tuesday April 23):
Class/Lab Eight (Thursday April 25):
Class/Lab Nine (Tuesday April 30):
Class/Lab Ten (Thursday May 2):
Class/Lab Eleven (Tuesday May 7):
Class/Lab Twelve (Thursday May 9):
Class/Lab Thirteen (Tuesday May 14):
Class/Lab Fourteen (Thursday May 16):
DETAILED SYLLABUS, PART TWO (Computational Physics in Python):
Class/Lab Fifteen (Tuesday May 21):
Class/Lab Sixteen (Thursday May 23):
Class/Lab Seventeen (Tuesday May 28):
Class/Lab Eighteen (Thursday May 30):
Class/Lab Nineteen (Tuesday-Thursday June 4-6):
Quiz 1
Diagonalization Routines
You will probably find it useful to have a book on
computational physics, and guides to C and python programming.
I suggest:
"Numerical Methods for Physics", Alejandro Garcia,
which is available in both C++ and Python versions ($19 and $16
respectively on Amazon):
http://www.algarcia.org/nummeth/nummeth.html
These cover both the programming and tools in one swell foop, and hence
are probably your best bet as a single, efficient, source.
Longer books on the languages themselves are
"Teach yourself C++" by Al Stevens,
"Think Python" by Allen B. Downey.
Everything you need to know will be provided in class, so
it is up to you to decide if background reading helps you learn better.
GENERAL COURSE INFORMATION/GOALS/OUTLINE:
The goal of this course is to familiarize you with the basic tools and
algorithms for using a computer to do physics problems (and "scientific
computing" more generally). Concerning tools, we will learn both C and
python.
We will, however, not attempt a formal
presentation of these languages. Instead we will learn by example,
writing codes from the most simple "hello world" to, ultimately,
more complex ones to implement molecular dynamics, solve Laplace's
equation, diagonalize matrices, etc.
Similarly, we will not essay a formal presentation of numerical
analysis. Instead
we will learn the material
through applying
tools and concepts to some specific problems.
My experience is that there is a more broad range of student backgrounds
in computational physics courses than in any of the department's other
classes.
I will not assume you know *anything* about coding or computational
methods. I will provide supplementary problems to those students
who do have a deep background, so they can push forward as well.
SHO and Projectile
Kepler
Partial Differential Equations
Diffusion Equation
Laplace Equation
Analytic Solution to Laplace Equation
Introduction to C++; Simple Practice Programs.
     
For the "expert": The Collatz Conjecture; The Locker Problem
     
Lab One write up
Introduction to C++ (continued);
Geometric, Arithmetic, and Taylor Series.
     
For the "expert": Intersecting lines, root finding by bisection.
     
Lab Two write up
Numerical Differentiation and Integration;
Plotting using xmgrace.
     
Lab Three write up
Molecular Dynamics: the harmonic oscillator.
     
Lab Four write up
Plotting; More molecular Dynamics: the damped oscillator and
projectile motion.
     
Lab Five write up
The Kepler problem.
     
Lab Six write up
Kepler Part Two; Conservation of Energy and Angular Momentum;
Condition for circular orbits.
Arrays.
Diffusion equation in one dimension.
     
Lab Seven write up
Partial differential equations;
Discretization of second derivative.
Laplace equation in one dimension.
     
Lab Eight write up
Connection between diffusion and random walks.
Random number generator; Random number moments.
     
Lab Nine write up
     
Analytic Solution Data File
Analytic solution of diffusion equation;
Greens functions.
Exploring diffusion equation for different initial conditions.
Random walks.
     
Lab Ten write up
"Visual test" of random number generator.
(Random numbers fall mainly in the plane.)
Using random numbers to compute a famous constant.
Laplace equation in two dimensions.
     
Lab Eleven write up
Analytic solution of Laplace equation.
Iteration step is not the same as time!
A simpler example of iteration.
Analytic Solution data file
     
Lab Twelve write up
Mathematics of eigenvalues and eigenvectors.
Eigenvalues in classical mechanics. Normal modes of diatomic molecule.
More eigenvalues in classical mechanics. Normal modes of N atom chain.
Eigenvalues in quantum mechanics.
Using Numerical Recipes function 'jacobi'.
     
Lab Thirteen write up
Participation ratio.
Matix multiplication.
     
Lab Fourteen write up
Python in Interactive Mode.
     
Lab Fifteen write up
Python with scripts. More python syntax.
     
Lab Sixteen write up
Plotting in Python; Arrays in Python;
Molecular Dynamics in Python- the harmonic oscillator.
     
Lab Seventeen write up
Molecular Dynamics in Python- the anharmonic oscillator,
the Kepler problem.
     
Lab Eighteen write up
More on Arrays,
Diffusion Equation, Laplace Equation.
     
Lab Nineteen write up
Quiz 2
Quiz 3
Quiz 4
Quiz 5
Quiz 6
Quiz 7
Quiz 8
Instructions for compilation and use.
jacobi.c
jacobi_test.c
nrutil.c
nrutil.h
input.txt