# lecture9 - Random walk declarations Program to perform a...

This preview shows pages 1–6. Sign up to view the full content.

Random walk declarations ! Program to perform a random walk in two dimensions ! repeats for many realizations and accumulates r**2 statistics IMPLICIT NONE INTEGER, PARAMETER :: Prec14=SELECTED_REAL_KIND(14) INTEGER :: i,j,is,ne,nt REAL(KIND=Prec14) :: rnd,rnds,r2,t INTEGER, PARAMETER :: ntmax=100 ! maximum number of time steps INTEGER, PARAMETER :: nemax=100000 ! number of walks in ensemble REAL(KIND=Prec14), DIMENSION(ntmax) :: r2a ! accumulated average of

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
! initialize random number generator call RANDOM_SEED Random number generator call RANDOM_NUMBER(rnd) call RANDOM_NUMBER(rnds) One random number (rnds) can be used to decide on +/- Step Other random number (rnd) can be used to decide whether we move walker in x or y direction
do ne=1,nemax ! nemax realizations of random walk do nt=1,ntmax 60 r2=real(i)**2+real(j)**2 r2a(nt)=r2a(nt)+r2/nemax enddo enddo

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
log <r 2 > log N Random walk results r 2 ~N • r 2 ~ N as expected
Declarations, Monte Carlo 2-D Ising model IMPLICIT NONE INTEGER, PARAMETER :: Prec14=SELECTED_REAL_KIND(14)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 16

lecture9 - Random walk declarations Program to perform a...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online