Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Example: Monte Carlo Validation

Crate: kwavers
Run: cargo run -p kwavers --example monte_carlo_validation
Source: crates/kwavers/examples/monte_carlo_validation.rs

Overview

Compares Monte Carlo photon transport with the diffusion approximation to validate both solvers and understand their respective domains of validity.

Validation regimes

Regimeμₐ/μₛ’Valid solver
Strongly scattering< 0.01Both (diffusion ≈ MC)
Moderate absorption0.01–0.1MC preferred
Highly absorbing> 0.1MC only

The example sweeps across optical property combinations and computes relative error between the two methods, plotting convergence of the MC solution.

Part Reference

Part IV — Validation and Benchmarking