Computational Physics Course
Home Work in Computational Physics. Spring 2007
• HW 1

• HW2

Question 1:

I have wrote the program HW2.f using Fortran77 the output file hw2.out presents the enumeration of total number
of random walks of N steps that reach the point x, for all x for N=4,5,6,7 and 8.

The following conclusions can be made from the output file:

• The even positions can be reached only by even number of steps.
• The odd positions can be reached only with the odd number of steps.
• The general results form a triangular structure. The results which are presented in the output file form a trapezoid structure.
• For an even N, the highest number of random walks is to return to position zero.
• For an odd N the highest number of random walks is to gett to position +/-1.

Question 2:

Like it was asked in the question 2, I have compiled the program rwalk1.f
and cplot.f in order to draw graphs of P(x) (the probability that after N steps a walker has nett displacement X).
I checked it for N = 8,16,32 and 64. I wanted to check the statment that the better seed
is big and odd, for this purpose I have took diferent seeds, for example
1) small but odd - 123
2) smal and even - 242
3) big and odd - 76539
4) big but even - 34326
All the seeds were tested for every one of 4 numbers of steps (N). Unfortunatly, it was hard to distinct clearly a specific pattern
of influencing the change of the seed numbers on the mean displacement
of the graph. However it is possible to make the following conclusion: The range of the probability that a walker has nett displacement X
after N steps (N = 8,16,32, 64) was between 0 to ~0.3, for the checked seed
numbers. With increasing the steps number, the mean of x approaches zero
that strengthens the observation in question 1: X0 is the position with
the highest probability that a walker will end in.
The example of PGPLOT graph for N=16 with the seed of 76539 is presented on the Figure 1:
Figure 1: PGPLOT GRAPH FOR N=16 , SEED = 76539

Home Work 3
Project Information
Home Work 4
Home Work 5