Dr
Peter Boyle, 2009.
The
idea that physics is about solving equations analytically is a major
misapprehension in undergraduate education created by teaching you the
things we can solve instead of the
things we can't.
The mathematics underlying most problems of interest today (e.g. most
non-linear
systems) cannot be solved analytically, and the contribution of
computing in 20th century physics has been to solve otherwise intractable
equations by using numerical algorithms to integrate the nonlinear force in a
simulated time,
just as nature integrates its complex forces in real time.
In the 21st century, computer simulation will leave complete mathematical
solution
further behind and physical phenomena will be deemed understood when numerical
simulation of the governing equations of motion for the underlying processes
are shown to describe the
real world.
See the background section for more detail of the numerical algorithms used in this course.
See nutshell for a concise summary of the Java you need to know to carry out this course.
You should refresh your memory of with the Physics 2 Scientific Programming course and associated documents.
Particular attention should be payed to
· Loops
· Methods
· Objects
Some useful Java documentation (increasingly advanced).
This course aims to give you a background in the essential skills underlying 21st century physics.
Hopefully,
you will both acquire some object oriented programming skills and learn some
good programming habits in the process.
During this course you will:
The
programming language used in this course is exclusively Java.
While Java is not the scientific programming language of choice (C++
is faster and more powerful, and Fortran is a slowly dying but still common
dark art),
Java is cross-platform portable, reasonably object-oriented, eliminates
some of the warts of C++, and is very common in the "real"
world and thus a transferrable skill.
While it is intended that you use the CPLab Linux cluster you should be able to equally well use java tools on your own, or any other, computer. I have avoided relying on any physics department specific packages, and, with a standard J2SE JDK install from java.sun.com, you should be able to run all the code in this course on your own computer.
The required programming tools are all available in the Computational Physics Laboratory and your own computer is not required.
A reference summary of the programming environment is CPLab Java Reference
The material of this course is designed to be accessible anywhere on the Edinburgh University campus, through a World Wide Web interface. This page is accessible at https://www2.ph.ed.ac.uk/~paboyle/Teaching/CompMeth/index.html
Prior
to taking this course you must have a basic knowledge of the Java
programming language, and the Unix/Linux environment in the CPLab.
This
background would typically have been obtained in the Physics 2
SciProg course. If you have not taken this course you should
contact Dr Boyle to discuss your
programming background.
If you have passed the Computer Simulation 2h half course then you should sign up to the more advanced Computer Simulation course instead of the Computational Methods course.
This is a continuously assessed course, so you will be marked in the lab by demonstrators on your own work. You are responsible for ensuring you get your checkpoints marked by asking demonstrators to do so.
In
happier times, hacking, meant taking
existing high quality example code and modify it to rapidly solve a different
problem.
Being able to both decide on the best example to copy (there is a lot of code on the web, and effective
use of the web really is
an important skill both in programming and even for research) and then use it
cleanly and effectively is one of the skills we hope you acquire.
Bear in
mind that Google really is a programmers
best friend. For example try google:
"java string integer conversion"
It is
perfectly acceptable to find and
modify useful example code with google (providing they are not specifically
solutions from other
Students
to this particular course). This is the way real programmers operate on a
daily basis.
However simply copying someone else's working code is not conducive to either acquiring these skills nor acquiring a good mark.
In
this spirit we will provide you with starting points that solve similar but
different problems, as examples of good and well
documented code using the necessary constructs.
The
course is taught on-line in the CPLab with a series of computer examples and
assessed checkpoints. If you fail
to make a checkpoint, there is a "catch up" mechanism where we make
example solutions available for each checkpoint (with a reduced
mark for that checkpoint).
It is expected that you will need to spend more time on the course than the lab sessions alone.
There are five checkpoints in all.
Some of the marks in each checkpoint are labeled Harder. These are worth around 25% of the marks and are harder than the standard section. A perfectly good pass should be obtained without doing any advanced sections, but the best marks will be obtained by putting in the additional effort.
Checkpoints 1-4 are each worth twenty marks.
Checkpoint 5 has a basic component worth twenty marks
Checkpoint 5 has a final project component worth ten marks
The course is marked out of 110, and converted to a percentage.
The marking scheme for each checkpoint is linked at the top of each checkpoint web page
The following are the rules of the lab:
Please feel free to help each other in the lab, or use websearches, but avoid cut/paste and copying entire files.
When
help has been obtained from either a friend, or a websearch, acknowledge that
help with a
comment inserted in the code. Help for simply debugging or
checking/fixing syntax is very much encouraged,
and while there will be no effect on your marking, the acknowledgement
may help increase the mark of the person who helped
you.
If
help involves actually copying swathes of code, however, this may reduce that
portion of your mark, so this
should be minimised to obtain the best marks.
Anyone caught plagiarising without acknowledgement will fail the course.
Model solutions to checkpoints 3&4 will be made
available online after the deadline has passed since later checkpoints depend
on your solution