\documentstyle[a4wide,12pt]{article}

\begin{document}
\section*{Introduction to numerical projects}

Here follows a brief recipe and recommendation on how to write a report for each
project.
\begin{itemize}
\item Give a short description of the nature of the problem and the eventual 
numerical methods you have used.
\item Describe the algorithm you have used and/or developed. Here you may find it convenient
to use pseudocoding. In many cases you can describe the algorithm
in the program itself.

\item Include the source code of your program. Comment your program properly.
\item If possible, try to find analytic solutions, or known limits
in order to test your program when developing the code.
\item Include your results either in figure form or in a table. Remember to
       label your results. All tables and figures should have relevant captions
       and labels on the axes.
\item Try to evaluate the reliabilty and numerical stability/precision
of your results. If possible, include a qualitative and/or quantitative
discussion of the numerical stability, eventual loss of precision etc. 

\item Try to give an interpretation of you results in your answers to 
the problems.
\item Critique: if possible include your comments and reflections about the 
exercise, whether you felt you learnt something, ideas for improvements and 
other thoughts you've made when solving the exercise.
We wish to keep this course at the interactive level and your comments can help
us improve it.
\item Try to establish a practice where you log your work at the 
computerlab. You may find such a logbook very handy at later stages
in your work, especially when you don't properly remember 
what a previous test version 
of your program did. Here you could also record 
the time spent on solving the exercise, various algorithms you may have tested
or other topics which you feel worthy of mentioning.
\end{itemize}



\section*{Format for electronic delivery of report and programs}
%
The preferred format for the report is a PDF file. You can also
use DOC or postscript formats. 
As programming language we prefer that you choose between C/C++ and Fortran90/95.
You could also use Java or Python as programming languages. 
Matlab/Maple/Mathematica/IDL are not allowed as programming
languages for the handins, but you can use them to check your results where possible.
The following prescription should be followed when preparing the report:
\begin{itemize}
\item Use Classfronter to hand in your projects, log in  at 
blyant.uio.no and choose 'fellesrom fys3150 og fys4150'.
Thereafter you will see an icon to the left with 'hand in' or 'innlevering'.
Click on that icon and go to the given project. 
There you can load up the files within the deadline.
\item Upload {\bf only} the report file and the source code file(s) you have developed.
The report file should include all of your discussions and a list of the codes you have developed. 
Do not include library files which are available at the course homepage, unless you have
made specific changes to them.
\item Comments  from us on your projects, approval or not, corrections to be made 
etc can be found under
your Classfronter domain and are only visible to you and the teachers of the course.
 
\end{itemize}
Finally, 
we do prefer that you work two and two together. Optimal working groups consist of 
2-3 students. You can then hand in a common report. 

\section*{Project 3, Random walks in two dimensions, deadline  17 october  12pm (midnight)}
For this project you can build upon program programs/chapter9/program2.cpp (or the f90 version).
You will need to compute the expectation values $\langle x(N) \rangle$, $\langle y(N) \rangle$
and 
\[
\langle \Delta R^2(N) \rangle= \langle x^2(N) \rangle+\langle y^2(N) \rangle-\langle x(N) \rangle^2-\langle y(N) \rangle^2
\]
where $N$ is the number of time steps.
\begin{enumerate}
\item[a)] Enumerate all random walks on a square lattice for $N=2$ and obtain exact results
for $\langle x(N) \rangle$, $\langle y(N) \rangle$ and $\langle \Delta R^2(N) \rangle$.
Verify your results by comparing your Monte Carlo  simulations with the exact results.
Assume that all four directions are equally probable.

\item[b)] Do a Monte Carlo simulation to estimate $\langle \Delta R^2(N) \rangle$ for
$N=8,16,32$ and $64$ using a reasonable number of trials for each $N$. Assume that 
we have the asymptotic behavior 
\[
   \langle \Delta R^2(N) \rangle \sim N^{2\nu},
\]
and estimate the exponent $\nu$ from a log-log plot of $\langle \Delta R^2(N) \rangle$ versus $N$.
If $\nu \approx 1/2$, estimate the magnutide of the self-diffusion coefficient $D$ given by
\[
  \langle \Delta R^2(N) \rangle \sim 2dDN,
\]
with $d$ the dimension of the system.
\item[c)] Compute now the quantities 
$\langle x(N) \rangle$, $\langle y(N) \rangle$, $\langle \Delta R^2(N) \rangle$ and 
\[
\langle R^2(N) \rangle= \langle x^2(N) \rangle+\langle y^2(N) \rangle,
\]
for the same values of $N$ as in the previous case but now with the step probabilities
$0.4$, $0.2$, $0,2$ and $0.2$ corresponding to right, left, up and down, respectively.
This choice corresponds to a biased random walk with a drift to the right.
What is the interpretation of $\langle x(N) \rangle$ in this case? What is the dependence of
$\langle \Delta R^2(N) \rangle$ on $N$ and does $\langle R^2(N) \rangle$ depend simply on $N$?    
\item[d)] Consider now a random walk that starts at a site that is a distance $y=h$ above a  
horisontal line (ground). If the probability of a step down towards the ground is bigger than the
probability of a step up, we expect that the walker will eventually reach a horisontal line. This walk 
is a simple model of the fall of a rain drop in the presence of a random swirling breeze.
Assume that the probabilities are $0.1$, $0.6$, $0,15$ and $0.15$ corresponding to up, down, right and left, 
respectively.
Do a Monte Carlo simulation to determine the mean time $\tau$ for the walker to reach any site on the line 
at $x=0$. Find the functional dependence of $\tau$ on $h$. Can you define a velocity in the vertical
direction?
Since the walker does not always move vertically, it suffers a net displacement $\Delta x$ in the horizontal
direction. Compute $\langle \Delta x^2\rangle$ and find its dependence on $h$ and $\tau$.  
\end{enumerate}


\end{document}









