12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

122 chapter 5✞/ / Decay . java : Spontaneous decay simulationimport java . io .∗ ;import java . util .∗ ;☎public class Decay {static double lambda = 0.01; / / Decay constantstatic int max = 1000, time_max = 500 , seed = 68111; / / Paramspublic static void main ( String [] argv ) throws IOException , FileNotFoundException {int atom , time , number , nloop ;double decay ;PrintWriter w = new PrintWriter (new FileOutputStream ("decay . dat") , true );number = nloop = max ; // Initial valueRandom r = new Random( seed ) ; / / Seed number generatorfor ( time = 0; time

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!