UNIVERSITY COLLEGE CORK

DEPARTMENT OF PHYSICS



PY4109 COMPUTATIONAL PHYSICS


General Course Information

Instructor: Stephen Fahy ( s.fahy@ucc.ie )
Office: 104A Science Building,
Phone: 021-4902452

Technical Support: John O'Riordan ( j.oriordan@ucc.ie )
Robin Gillen ( R.Gillen@ucc.ie )

Class Times and Locations

Lecture: Tues, 9-10am in Room 217, Kane Building
Practical: Tues 4-6pm in Room 217, Kane Building



Homework and Hints


C++ compiler now installed on machines in Kane 217: use the g++ command
Please report any difficulties by e-mail.

Directory for tips and discussion: /home/users/usersdiscussion/
Put any tips or info you want to share by creating a file in this directory.




Major Goals of the Course PY4109

The principal aim of this course is to give the physics student a general introduction to the use of computational methods in the solution of physics problems in a development environment typical of that used by professional computational scientists. This course is intended to lead you to think critically about computational methods and their use in developing insight into physical problems, rather than simply exposing you to a series of computational methods.

  1. The computer as a tool for understanding physical problems
  2. Formulation of physical problems for computational analysis
  3. Making sense of computational results
  4. Reformulation of methods, based on intermediate results
  5. Some specific computational approaches to various areas of physics

A secondary aim is to allow the student to gain some familiarity with miscellaneous tools for the presentation of technical material in a general context (e.g., some C programming, the use of the UNIX operating systems and an X11 graphical interface, the preparation of technical material for presentation on a Web page, etc.)

So, we could categorize the computational areas touched upon in the course as follows:

  1. numerical analysis
  2. C programming
  3. using the UNIX operating system (click here for an introduction to UNIX)
  4. using HTML and writing a simple web-page

Although these computer skills are an important part of what I hope you'll learn in the course, it is principally physics which I want you to learn. The formulation of a physical problem in a form suitable for solution by computational methods involves a great deal of understanding of physics itself. Sometimes, when computational methods perform poorly or fail, that is telling us something about the behaviour of the real physical system we are studying. Sometimes, things that are difficult to anticipate in advance (in a complex simulation, for example) leap out at you in a very obvious way when the computational results are examined (for example, graphically).

A good general reference for computational methods in physics is the book "Numerical Recipies" ( www.nr.com ).


Organization of the Course PY4109

Weeks 1-2

In the first two weeks, we will introduce some general skills that will be needed throughout the course: e.g., some basic knowledge of UNIX, the "vi" editor , the gnuplot plotting package, some simple exercises in C (to remind you of what you've forgotten). If you want to write your programs in C++ or Fortran (the other main programming languages for heavy-duty scientific computational work), that's OK too, but we will not provide quite the same level of support for those languages in the course documentation. This is because the common language that all of you have learned (at least to some extent) is C or its more sophisticated variant, C++. In a number of assignments, you will need to use existing subroutines that are written in Fortran. The standard "Gnu" compiler can compile and link together programs consisting of subroutines written in a mixture of C, C++ and Fortran.

Although "higher-level" languages like Mathematica and Matlab could also be used to solve any of the problems we will tackle in the course and are in general extremely useful tools, we will not make use of them. They hide a great deal of the computational details that languages like C, C++ and Fortran represent explicitly and give you a different kind of experience in solving computational problems. Compiled languages (especially C and C++) remain the dominant languages worldwide for professional computational scientists and many more specialized languages mimic their syntax. Practically speaking, both C-like languages and higher-level languages, such as Mathematica or Matlab, are part of the normal toolbox of professional computational physicists.

Weeks 3-9

In the following seven weeks, a selection physics problems will be analysed, using the computer. In this way, various numerical methods and computer skills will be introduced as we need them. There will be computer home-work (usually in the form of a folder of files on your disk-space area of the course server, containing the appropriate computer programs, data sets, results from the application, and any general notes and comments) related to each problem. The level of "presentation" expected in these weekly exercises will not be very high - careful organization and layout of the work as you progress is what is to be emphasized here and is an important aspect of the training provided by the course. You r knoweldge of each problem will be tested in an in-class test (see below). A more complete presentation of some exercises will be required at the end of the course (see weeks 10-12). There will also be an in-class examination approximately every three weeks during term: on Oct 18, Nov 1, Nov 29 and Dec 6.

Here is the list of problems (including problem 1 from weeks 1-2):

  1. Period of a Non-Linear Oscillator
  2. Chaos in a Driven Pendulum
  3. A Noble Gas Cluster:
  4. Poisson's Equation:
  5. The Radial Schrodinger Equation:
  6. Hartree's Self-Consistent Field

Weeks 10-12

Each student will prepare a full write-up, in the form of a simple web-page (preferred) or a pdf document, for one topic covered in the course. This year, the topic will be the study of the heat capacity of the noble gas cluster. This write-up should discuss the background physics to the problem, the computational approach, show results in appropriate figures or animations, and discuss difficulties. It should be written at a level accessible to final-year undergraduate physics students. For this part of the course, it may be useful to learn a small amount of LaTex (the main scientific typesetting language) and some HTML for the production of your web-page. There is a brief online LaTex guide , a full online LaTex guide , and a short HTML Primer available on this server. For more guidance, you can consult the extensive list of on-line guides you'll find by searching "html primer" on Google, for example www.htmlprimer.com or www.htmlgoodies.com . The completed write-up is due at 6pm on the last day of study week.

There will also be an in-class practical exam in the final week (see above). In this exam, you will be required to formulate a computational solution to a given physics problem, indicating suitable numerical algorithms necessary, indicate special cases that would provide a test of the methods and discuss any anticipated difficulties.

Student Files

Each student will have file space (200 MBytes) allocated on the course server (est1.ucc.ie). Each of the machines in Kane 217 is set up so that, when you log on to it, you see your home directory on this server. So, from a functional point of view, all the machines in Kane 217 are equivalent. The student will be expected to maintain this file space in an appropriate manner, so that the course instructor can follow the progress of the students throughout the course. Private material should not be kept there. Files are date-marked automatically by last time of alteration by the system. Work for each assignment should be kept in a separate folder by each student.

It may be a good idea to keep a copy of your files on a data stick. This makes working at home or in the lab easier and also provides a personal backup of your work. You can connect a USB data stick to any of the machines in Kane 217 by inserting in one of the USB ports at the front of the machine. The file system on the data stick will be automatically mounted and a folder window will appear on your desktop when you insert the data stick. The data stick can be unmounted by clicking on the eject symbol to the right of its name.

The version of unix running on the course server and the other machines in Kane 217 is the Ubuntu distribution of linux ( http://www.ubuntu.com/). You will be able to log on to the course server from any unix machine on the internet, so you do not have to confine your work solely to the machines in Kane 217. (You can set up your own home PC or laptop to use Ubuntu or as a dual-boot machine, with both Ubuntu and Windows.)

At the end of the course, each student should have produced a simple, web-page or pdf document which will give an overview of one of the physics topics addressed in the course, along with computational results.

Final Student Assessment

The course will be graded on the basis of the four in-class tests (with any associated homework presented at the test) and on the basis of the report presented for one of the assignments. Each of these elements will be weighted equally.




This page was prepared by Stephen Fahy. s.fahy@ucc.ie