PHY4020/5020- Computational Physics


Instructors: Dr. Richard Gray and Dr. Chris Thaxton
[ Class Notes | Support Material | Exam Support | Introduction | Free Stuff | Tutorial Links | Dr. Thaxton's Homepage ]


Class Notes

These are the notes that we will be using in class. To supplement this, we highly recommend that you consider adding to your library Numerical Recipes - There are versions for C/C++ and Fortran 77/90.

Lecture 1 - Memory, variables, C language (I/O and Math)
Lecture 2 - Conditionals and Loops
Lecture 3 - Functions, file I/O (and gnuplot)
Lecture 4 - Interpolation
Lecture 5 - Root Finding
Lecture 6 - Minimization of functions
Lecture 7 - Numerical Integration
Lecture 8 - Integration of ODEs
Lecture 9 - Modeling of data
Lecture 10a (New) - REVISED 11/28/07: Fourier Series and the Fourier Transform
Lecture 10b - Convolution
Lecture 10c - Correlation



Exam Support

Final exam files
signal.dat
em.o
em.c


Stuff posted in preparation of the final exam

adaptive step size cose segment
ex96.c - Exercise 9.6 solutions (non-linear least squares)


Support Material

Fourier Transform Help and Exercise 10.4 solutions
UHA21.nor - Input for exercise 10.6
h.dat and r.dat - input for the convolution exercise
bms.c - Demo for the derivation of the Fourier series coefficients
bruteforce.c - Demo for Fourier Transform using brute force methods

cesium.dat - Exam 3 input file

ex91.c - Posted solution to exercise 9.1
ex95.c - Posted solution to exercise 9.5
data91.dat - Ex 9.1 data file
data94.dat - Ex 9.4 data file
data95.dat - Ex 9.5 data file

PHY4020 Syllabus
PHY5020 Syllabus
comphys.c - the library that contains all of our course-specific routines
comphys.h - the header file for comphys.c
hello.c - our first program (Lecture 1)
ex13.c - the magnetic dipole problem
sort_demo.c - demonstrates quicksort (from the notes)
grains.dat - for use in the grain sorting assignment
Example ex13.c - Comments and user loop-back
Solution to grain sorting assignment
decay.out - For use with problems 6.6 and 6.7.
ballistic.c - The solution to exercise 5.7
New gradesheet - To be applied after October 14, 2007



Welcome!

This is an introductory course in the methods of computational physics. There are many physics problems that can be solved numerically, and many that can only be solved numerically. The idealized problems found in your course work, although instructive, are rarely encountered. This class is designed less to probe the theoretical workings of computational algorithms and more toward the practical application of tried and true methods. If you continue your work in physics or engineering, you will undoubtedly come across the need for atleast a subset of the things you'll see in this class.

THIS CLASS CAN BE TIME CONSUMING IF YOU GET BEHIND - PLAN YOUR WORK ACCORDINGLY

We will be doing all of our work in the linux operating system. We will be compiling code using gcc and we'll be using gnuplot to visualize data. Much of your work can be done on the lab computers, but we are setting up a Linux server (URL to be annouced) which you can logon to remotely, and do work there. We will be using the gcc compiler for on Linux. Please see this file (README.txt) for a description of the systems that we will be working on, as well as instructions.

For more advanced computer users, you can install Linux on your home machine or laptop and do all of your work there. Try Fedora (Red Hat) or Ubuntu (Debian). If you're insistant on working on the Windows environment and want more power than a simple Xwindow via Xming, you could try installing Cygwin - a powerful linux environment that runs in Windows. You could also run what essentially is a linux emulator called MSYS (select the current MSYS-X.Y.ZZ.exe file. Also install the msysDTK-X.Y.Z.exe tool kit, also available on this page). Once you install MSYS, you can use the gcc compiler (go to http://gcc.gnu.org/ for more info).


Download and read this file (README.txt)!!

[ PHY4020 Syllabus | PHY5020 Syllabus ]



New Downloadable Instructions!

Operational Instruction Sheet - Confused about our system, the server, and all that, well, start here!
Xming Install Instruction - Wanting to load Xming onto your Windows box? Here's instructions
Server Communications in a Nutshell - Quick reference guide ot ssh, PUTTY, Xming, sftp, and WinSCP
Downloads for our class, including PUTTY, WinSCP, Xming, emacs, etc...


Free Stuff

Looking for some free stuff? Here's the best of what I've found so far:

For our class:
Numerical Recipes (on line books)
WinSCP - Windows sftp client (select "Installation Package"). This is point and click file transferring - very nice!
PUTTY - Windows ssh client.
Xming - The Xwindows for Windows that we will be using in class.
gnuplot - Plots data in Xwindows
GCC (GNU Compiler Collection)
emacs for Mac
emacs for Windows

Other Free Stuff:

Numerical Recipes (on line books)
Kick-butt free code editor for Windows: Color codes your files for easy debug
g95 Fortran compiler: Fortran isn't dead, yet.
Enough messing around - Go Cygwin: Powerful Linux environment in Windows
Wow! Intel's Fortran Compiler for Linux: Now that's power!
More free everything compilers and interpreters
I think there's a link to a Pascal Complier among this list of free stuff
Watcom Open Source C/C++ Complier for Windows. Caution - code that compiles here may not compile on gcc and vice versa.

Get running on other scientific platforms. Here are some of my favorites (most include demo and student versions at a discount):

Matlab
MAPLE
Origin
GRASS GIS



Tutorials

GNU C tutorial [Programmer's C standard] Cprogramming.com [All inclusive]
Cal Poly's C site [Custom animations - looks nice if nothing else]
Drexel Univ. C Tutorial [Worth a look]
About.com [High level intro., decent C/C++ glossary]
Steve Summit's C tutorial [Not bad]
UC Davis' Linux/Unix tutorial
Sysprog.net tutorials for C (on a mainframe) [Thorough content here]