montecarlo_partition


montecarlo_partition, a MATLAB code which approximates the integral of a function over a multidimensional domain. As a particular example, the method is applied to approximate the partition function of a harmonic oscillator involving many particles. This code is derived from Dianne O'Leary's "Scientific Computing with Case Studies".

The case study presents two ways of looking at the Monte Carlo method. In the first case, we recall that integration is equivalent to computing the area under a curve - a concept which extends to the multidimensional case as approximating a volume.

In the second view, we think of integration as a way of computing the average value of a function over the integration domain (if we divide the integral by the area of the domain). This approach helps us to get some additional information from the Monte Carlo method, which can suggest to us whether our approximation is probably good enough for our purposes.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

montecarlo_partition is available in a MATLAB version.

Related Programs:

montecarlo_partition_test

Reference:

  1. Dianne O'Leary,
    Multidimensional Integration: Partition and Conquer,
    Computing in Science and Engineering,
    Volume 6, Number 6, November/December 2004.
  2. Dianne O'Leary,
    Scientific Computing with Case Studies,
    SIAM, 2008,
    ISBN13: 978-0-898716-66-5,
    LC: QA401.O44.
  3. montecarlo_partition.pdf
  4. Dianne O'Leary's Scientific Computing with Case Studies https://www.cs.umd.edu/users/oleary/SCCS/

Source code:


Last revised on 06 November 2026.