COURSE TIME:
Tuesdays 3:10  4:00 pm
COURSE LOCATION: Wellman 6
INSTRUCTOR:
Richard Scalettar
TEACHING ASSISTANT:
Blaine Bush
PROBLEM SESSIONS:
Physics 106; Tuesdays 4:005:30 pm
GRADING:

In this course you may use emacs or vi or any editor of your choice. However programs must be written in C or C++. 
TEXT:
None
In practice, we have found that not everyone is familiar with this material, so the course begins with an "Assignment 0'' which involves logging into the computer and entering, compiling, and running some very simple programs. We provide tutorials on the linux operating system used in the Physics Department computer lab, for those who will do their work there.
After Assignment 0, we will continue with simple programs motivated by standard calculus problems (root finding by Newton's method, numerical integration). Next comes a topic for which the programming is still very easy, but the concepts and results are much less familiar: chaos. The heart of the course will be "molecular dynamics" programs for the damped, driven oscillator and the Kepler problem. We will make contact with analytic solutions developed in Physics 105AB and also show how the method can do analytically intractable problems (anharmonic potentials, three body problems). We will finish by discussing the numerical solution of the diffusion equation.
Problem Set Topics
0. Intro to Computer Lab (linux, editor) and two simple C programs.
1. Newton's method for root finding.
2. Numerical integration with trapezoidal rule.
3. Chaos and the logistic map.
4. Molecular Dynamics for the harmonic oscillator.
5. Molecular Dynamics for the harmonic oscillator: driving and
damping.
6. Molecular Dynamics for the Kepler problem.
7. One dimensional diffusion equation.
Very Simple C Programs to look at (C++ versions below, courtesy of
Vlad Iglovikov):
Your zeroth problem set (see below) involves typing any four of the
programs below into the computer, compiling and running. If you would like
further practice, try some additional ones.
VERY IMPORTANT!!!!
I strongly encourage you *not* to cut and paste the programs in.
Type them yourself. This forces you to focus on the language, but
also gives you the opportunity to type things in incorrectly.
Paradoxically, this is a *good* thing, because you will begin
to get experience in error messages and debugging. It's much better to
start this process out with simple codes like these than
with the more complex ones which come later.
So, again, do not cut and paste the codes.
Adding two numbers (in C)
Counting even integers (in C)
Counting even integers with output to file
(in C)
Generating Fibonacci numbers (in C)
Summing arithmetic series (in C)
Summing geometric series (in C)
Taylor series for exp (in C)
Taylor series for sine (in C)
Finding intersection point of two lines (in
C).
dowhile loop (in C)
Random numbers and their moments (in C)
Very Simple C++ Programs to look at, courtesy of
Vlad Iglovikov, C versions above:
Your zeroth problem set (see below) involves typing any four of the
programs below into the computer, compiling and running. If you would like
further practice, try some additional ones.
VERY IMPORTANT!!!!
I strongly encourage you *not* to cut and paste the programs in.
Type them yourself. This forces you to focus on the language, but
also gives you the opportunity to type things in incorrectly.
Paradoxically, this is a *good* thing, because you will begin
to get experience in error messages and debugging. It's much better to
start this process out with simple codes like these than
with the more complex ones which come later.
So, again, do not cut and paste the codes.
Adding two numbers (in C++)
Counting even integers (in C++)
Counting even integers with output
to file (in C++)
Generating Fibonacci numbers (in C++)
Summing arithmetic series (in C++)
Summing geometric series (in C++)
Taylor series for exp (in C++)
Taylor series for sine (in C++)
Finding intersection point of two
lines (in C++) .
dowhile loop (in C++)
Random numbers and their
moments(in C++)
Problem Sets
Assignment 0
Assignment 1
Assignment 2
Assignment 3
Assignment 4
Assignment 5
Assignment 6
Assignment 7
Assignment 8
Student Work
Wesley Hu's animation of diffusive spreading (Assignment 7, problem 1).
Wesley Hu's animation of temperature equilibration (Assignment 7, problem 2).
Background Material
The vi editor
The linux operating system
Introduction to xmgrace
Some programming tasks you could try for fun.
Collatz Conjecture
The Locker Problem
Diagonalization Routines
Instructions for compilation and use.
jacobi.c
jacobi_test.c
nrutil.c
nrutil.h
input.txt