Computational Physics Laboratory PHZ4151C/PHZ5156C
  Spring 2009

  Class Meetings: HCB 0219, Tuesday and Thursday from 2:00 to 3:15 PM

  Office Hours: Wednesday 4:00 - 5:00 or upon appointment

  Course Text: David Yevick, A First Course in Computational Physics and Object-Oriented Programming with C++

Monte Carlo Integration


Complete the coding of class MonteCarloIntegrator. This class should implement both Monte Carlo Sampling and Monte Carlo Mean Value Methods. Use the program to calculate pi.


Example:
> ./MonteCarloIntegrator

Output:
The program needs a moment to run.
Pi from M_PI: 3.14159 Number of Points: ... 100 ... Pi by Mean Value: ... 3.32 ... Pi by Sampling: ... 3.16962 ...


Source Code




Multi-Dimensional Integration


Example:
> ./DoubleIntegral

Output:
Integral = 1.7611277

Source Code