Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 43

Analog Monte Carlo Simulation as a Random Walk

Recommended resources

Introduction

Welcome to the next major phase of our course. In the previous module, we established the mathematical and statistical foundations of the Monte Carlo method. You learned how to sample from probability distributions and, most recently, how to use those samples to estimate definite integrals and their associated uncertainties. These are the essential tools in our computational toolkit.

Now, we will apply these tools to our central problem: simulating the transport of radiation through matter. The goal of this lesson is to introduce the core conceptual model for this simulation. We will learn to describe analog Monte Carlo simulation of neutral particle transport as a random walk process. This framework bridges the gap between the abstract statistical methods we've studied and the concrete physics of particle interactions. We will focus on the "what" and "why" of the simulation logic, creating a strong mental model before we delve into the specific implementation details in the lessons to come.


The Particle History as a Random Walk

The life of a single particle—a photon or a neutron—as it travels through a medium is a sequence of probabilistic events. It is born at a source, travels in a straight line for some distance, interacts with an atom, perhaps changes direction and energy, travels again, and so on, until it is either absorbed or leaves the system. This stochastic journey is what we call a particle history.

We can visualize this history as a "random walk," a term with deep roots in statistical physics. It's a path made up of straight line segments, where the length and direction of each segment, as well as the outcome of the event at each vertex, are determined by random sampling from underlying physical probability distributions.

This diagram illustrates a particle's history as a random walk. Starting at point A, the particle undergoes a series of scattering events (at points \((x_1, y_1, z_1)\), \((x_2, y_2, z_2)\), etc.), with each step \(S_i\) representing a straight-line path between interactions. A Monte Carlo simulation generates many such paths to determine the average behavior of the radiation field.

By simulating a vast number of these individual random walks, we are essentially drawing samples from the complex, high-dimensional probability space that describes the radiation field. The Law of Large Numbers, which you encountered in the previous lesson, ensures that the average behavior observed across all these simulated histories converges to the true physical expectation value of quantities like flux, dose, or energy deposition.

This concept of solving a physical problem by simulating individual random paths is a powerful idea that extends beyond particle transport. It's used to solve complex partial differential equations (PDEs), including the Laplace and Poisson equations you've encountered in electrostatics and other areas of physics.

Monte Carlo Geometry Processing

This video, from a course on geometry processing, provides a beautiful and concise explanation of a related idea called the "walk-on-spheres" algorithm for solving the Laplace equation.

Watch the segment from the beginning of the explanation. Notice the key parallel: the value of the solution at a point is found by averaging the results of many random walks starting from that point. This directly connects the simulation of random paths to the solution of a fundamental physical equation, reinforcing the core idea of our approach to the transport equation.


Analog Simulation: A Faithful Reproduction of Reality

There are different ways to implement a Monte Carlo transport simulation, but the most direct and conceptually simple approach is called analog Monte Carlo. The name comes from the fact that the simulation is a direct "analog" of the real physical processes.

In an analog simulation:

  • Every simulated particle history is a plausible physical path that a real particle could take.
  • The probability of a specific event (e.g., scattering vs. absorption) occurring in the simulation is set to be exactly equal to the physical probability of that event occurring in nature.
  • Each simulated particle carries a "weight" of 1, meaning it represents one real particle. We are simply counting particles and their effects.

This faithfulness to reality is powerful. It means that not only does the average value of our simulation results converge to the true physical mean, but the variance and all higher statistical moments are also faithfully reproduced. For this reason, an analog simulation is often called a "true" simulation of the physical system.

The following slide from a presentation on the FLUKA Monte Carlo code provides a concise definition.

PowerPoint Presentation

These slides from a CERN training course provide excellent, high-level summaries of key concepts.

Please read the slide titled "Analog Monte Carlo" (slide 61). Focus on the core message: analog simulation reproduces the full statistics of the process, not just the mean.

The alternative, which we will study in a later module, is "non-analog" or "biased" simulation. In these advanced techniques, we deliberately alter the probabilities to make the simulation more efficient for specific problems (e.g., deep penetration shielding). This requires adjusting particle weights to correct for the "bias" we introduced, and while it converges to the correct mean value, it no longer reproduces the true statistical fluctuations. For now, and for the next several lessons, we will focus exclusively on the analog approach.


The Logical Flow of a Particle's Life

The random walk of a single particle can be described by a simple, iterative algorithm. The simulation code holds the particle's current state (position , direction , energy ) and repeatedly answers a series of fundamental questions until the particle's history is terminated.

Here is the fundamental loop of an analog Monte Carlo transport simulation:

  1. Birth: Initialize the particle's state () by sampling from the source distribution.
  2. Travel: Sample a path length, , for the particle to travel before its next interaction. Move the particle in a straight line from its current position to a new position .
  3. Interaction Decision: At the new position , an interaction occurs. Sample the type of interaction (e.g., Compton scatter, photoelectric absorption) based on the relative probabilities given by the partial cross sections at energy .
  4. State Update & Termination Check:
    • If Absorbed: The history ends. Terminate the simulation for this particle.
    • If Scattered: Sample a new direction and energy from the differential cross-section for the selected interaction. Update the particle's state to ().
    • If Escaped: If the new position is outside the problem geometry, the history ends. Terminate.
    • Energy Cutoff: If the new energy is below a predefined threshold, the history may be terminated (a process called "implicit capture").
  5. Repeat: If the history has not been terminated, go back to step 2 and continue the walk.

This logical flow is the heart of every analog Monte Carlo transport code. The following document provides a wonderfully clear, narrative description of this process.

Introduction to Monte Carlo Radiation Transfer

This document by Wood and Whitney is a classic, accessible introduction to the topic.

First, read the "Introduction" (page 1). It beautifully summarizes the core idea: a simple sequence of events. Next, review the section "A Plane Parallel, Isotropic Scattering Monte Carlo Code" (page 8). This section provides the step-by-step logic of a simple, practical code. Don't worry about the specifics of the geometry or Fortran files mentioned. Instead, focus on how the list of steps from 1 through 6 directly maps onto the logical flow we just discussed (birth, travel, interaction, termination).

To see this logic translated into a simple program, the following video provides an excellent demonstration. The author writes a basic transport code from scratch, and in doing so, clearly illustrates the main loop of the random walk.

Computational Physics Video 31 - Writing a Monte Carlo Radiation Transport Code

This video, "Writing a Monte Carlo Radiation Transport Code" by Hywel Owen, provides a live coding demonstration of the concepts we are discussing.

Watch the segment from where the history loop is constructed. The author sets up a while loop that continues as long as the neutron is not absorbed. Inside this loop, he samples a step length s and a random direction, then updates the particle's position. This is the implementation of our "Travel" step. Next, watch from the decision-making part. Here, he uses a random number to decide if the interaction at the end of the step is an absorption or a scattering. This corresponds directly to our "Interaction Decision" and "State Update" steps.


Conclusion

In this lesson, you have learned to view Monte Carlo particle transport as the simulation of many individual "random walks." This conceptual model is the foundation upon which we will build our practical understanding and implementation of a full transport code.

Key Takeaways:

  • A particle's journey through a medium can be modeled as a random walk, a sequence of straight-line flights punctuated by probabilistic interactions. This entire journey is called a particle history.
  • Analog Monte Carlo is a simulation method that faithfully reproduces the true physical probabilities of all events. This ensures the simulation captures not just the mean behavior but also the correct statistical fluctuations.
  • The core logic of a simulation follows a loop for each particle: birth, travel to a new location, interaction (deciding between scattering or absorption), and finally, termination or update of the particle's state for the next step.
  • By averaging the outcomes of a very large number of these random walks, we can accurately estimate macroscopic physical quantities, turning a stochastic simulation into a powerful tool for numerical integration.

Preview of the Next Lesson:
We have established the blueprint for our simulation. In the next lesson, we will begin to construct the first component of this algorithm: sampling the distance to the next collision. You will learn how the total macroscopic cross section defines an exponential probability distribution for particle path lengths and how to use the inverse transform sampling method to draw from it.