Physics 410/609---Computational Physics
Assignment #2---Due Wednesday, February 20
For this assignment it is necessary to write code in a compiled, not
an interpreted, langauge. Examples of a compiled language are C, C++,
Fortran, Java. Interpreted languages include Matlab and Mathematica.
You may use python, if you compile your code. If in doubt, contact me.
Your future employers will expect you to be
able to write and debug code to be compiled, so it is good practice to do
so now. We will be considering an interpreted language later in the course.
You will be able to contrast the two approaches.
1) Complete Problem 3.8 on page 62 of CSM, with the following modifications.
Do not use the data in Table 3.1. Instead, use the data in the file
~sg/fourfilters.ax . This data comes from video capture of the fall of a
coffee filter. The two values on most lines represent time (in seconds)
and height (in meters). Notice the lines for t=0 and t=0.016666667
are commented out with a ";". The filter did not start to fall until
between 0.03333 and 0.05 seconds. You should adjust the origin in time
to take account of that.
For part (a) you do not need to derive (3.16), but you should use
(3.16) to estimate the acceleration. (I found it easy to use awk to
calculate the acceleration. Many other approaches can be used.)
For part (c), you don't need to write a class, as you may not be using java.
However, I would like you to use the Euler-Richardson algorithm which
is discussed on page 46.
Similarly, for part (e), you don't need to write a class, just modify
your code from part (c) to change the form of the drag force.
You are welcome to use my fall_euler_ansi.c program as a starting point
for your Euler-Richardson program, if you like. The program can be found
in ~sg/chap3. In any case, your homework should contain a copy of your codes.
2) Complete Problem 3.9 on pages 63-64 of CSM. You should use the
Euler-Richardson algorithm and include a copy of your code.