---
title: "Umbrella Sampling and MBAR Interactive Lab | Sandbox Physics"
description: "When do overlapping biased trajectories reveal the equilibrium free energy?"
canonical_url: "https://sandboxphysics.com/labs/umbrella-mbar/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/umbrella-mbar/"
---

FR15-B · Windows into a rare crossing

# Umbrella Sampling and MBAR

**When do overlapping biased trajectories reveal the equilibrium free energy?** Each window must sample its own equilibrium distribution and share configurations with its neighbors. MBAR then removes the known biases to estimate equilibrium probabilities. A hidden trapped coordinate can still spoil the result, even when the windows overlap.

Move an umbrella window across a two-dimensional landscape. Combine seeded trajectories, compare the recovered free energy with numerical integration, then leave a gap or trap the hidden coordinate.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Model assumptions

The data are overdamped Langevin simulations on a dimensionless two-coordinate potential with reflecting boundaries. Harmonic biases act on the horizontal coordinate. MBAR assumes each window samples its equilibrium distribution; visible overlap along one coordinate cannot establish that. A small block-bootstrap error can miss unsampled states. Biased trajectory time is not a reaction clock.

Seeded simulations · independent integration reference

## What survives after removing the bias?

Connected windows compare the reconstruction with a separate reference.

Correlation, held-out region and fit diagnostics

$N=7000,\quad p_{\rm R}^{\rm ref}=0.500$

The central eight bins define a predeclared validation interval. Its independent integration reference is withheld from fitting; all acquisition samples enter MBAR. The record saves the recovered probability and absolute error there. The effective sample estimate divides the Kish weight count by the largest coordinate-based statistical inefficiency across replicas; it is a coordinate-based heuristic diagnostic, not a variance guarantee for every observable.

The export includes all coordinates, acquisition times, bias energies, seeds, burn-in, sample stride, normalized target weights, overlap matrix and bootstrap replicas. Every record here is simulated.

[Continue the course on free energy and rare events](https://sandboxphysics.com/stories/free-energy/)

Physics tutorial

## Umbrella Sampling and MBAR

**Background** A cold trajectory can spend most of its time in one valley. A harmonic restraint keeps a trajectory near a chosen horizontal position, so several windows can visit the difficult crossing.

**Why it matters** Biased visits do not have their original equilibrium frequencies. Recovering those frequencies requires knowing both the bias and how the windows connect.

Start with the essentials

- **Focus question**: When do overlapping biased trajectories reveal the equilibrium free energy?
- **One-sentence intuition**: Overlapping equilibrated windows can share their relative statistical weights.

### Core mathematical model

#### A known harmonic bias

$$
B_i(x)=\frac{\kappa}{2}(x-c_i)^2,\qquad u_i=\frac{U+B_i}{k_{\rm B}T}
$$

The window center and stiffness set its bias energy. The reduced potential divides the total energy by the thermal energy.

#### MBAR combines the saved configurations

$$
\widehat f_i=-\ln\sum_n\frac{e^{-u_i(z_n)}}{\sum_jN_j e^{\widehat f_j-u_j(z_n)}}
$$

The sum uses every saved configuration. Each state has a sample count and an unknown normalization. Setting the first reduced free energy to zero fixes an arbitrary common constant.

#### Return to the unbiased distribution

$$
w_n\propto\frac{e^{-U(z_n)/(k_{\rm B}T)}}{\sum_jN_j e^{\widehat f_j-u_j(z_n)}},\qquad F(x)=-k_{\rm B}T\ln p(x)+C
$$

The weights form a histogram of the horizontal coordinate. The pale reference comes from separate two-dimensional integration; it never enters the MBAR fit.

### Common difficulties

#### Many saved frames can repeat little information

**Typical misconception** Every stored frame counts as a new independent observation.

**Better mental model** Nearby frames share the trajectory’s history. The diagnostic estimates autocorrelation in both coordinates; the bootstrap draws contiguous blocks within each independent replica.

### Run the experiment

1. 01

   #### Follow a shared crossing

   Watch A connected crossing. Select a window or drag its diamond, then compare the cyan reconstruction with the pale integration reference.

   **What to observe:** Neighboring colors visit some of the same configurations. The orange pooled histogram still shows the bias; MBAR changes the relative weights.

2. 02

   #### Remove the bridge

   Choose A missing bridge. Look at the overlap matrix and the two separated clouds.

   **What to observe:** The empirical overlap graph splits. A single global reconstruction is withheld because the record does not reliably connect the relative normalization of the two groups.

3. 03

   #### Test the hidden direction

   Choose The hidden trap. Compare the vertical coverage with the reconstructed population and its error bar.

   **What to observe:** The windows overlap horizontally but remain in the upper hidden valley. Resampling those same blocks can produce a small error bar around a biased answer.

Physical conclusion

Check overlap, hidden-coordinate mixing and correlation before trusting a free-energy curve.

## Related experiments and articles

Free energy and rare events · Reading path

### From Boltzmann probabilities to reaction paths

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **Crossing a barrier with overlapping umbrella windows**](https://sandboxphysics.com/stories/free-energy/umbrella-windows/)
2. [Article **How MBAR joins windows into one equilibrium distribution**](https://sandboxphysics.com/stories/free-energy/multistate-reweighting/)
3. [Article **Why error bars can miss the largest error**](https://sandboxphysics.com/stories/free-energy/uncertainty-and-validation/)
4. [Article **Use the MBAR paper to examine your own calculation**](https://sandboxphysics.com/stories/free-energy/reading-the-mbar-paper/)

Fields & matter · Starter path

## From a field to an electron microscope

Map an electric field and steer a charged particle. Then find the electron's wavelength and use electron beams to see a crystal and a surface.

[Start here → **Make an Electric Field Visible** Move the probe around a dipole and check that the field always points downhill on the potential landscape. Observe · 8 min](https://sandboxphysics.com/labs/electric-field/)

1. [1 Make an Electric Field Visible](https://sandboxphysics.com/labs/electric-field/)
2. [2 A Charge Bending through Fields](https://sandboxphysics.com/labs/charged-particle/)
3. [3 Electron Wavelength & Voltage](https://sandboxphysics.com/labs/electron-wavelength/)
4. [4 Electron Diffraction & Reciprocal Space](https://sandboxphysics.com/labs/electron-diffraction/)
5. [5 TEM Bright Field, Dark Field & SAED](https://sandboxphysics.com/labs/tem-mode-selector/)
6. [6 SEM Secondary-Electron Topography](https://sandboxphysics.com/labs/sem-topography/)

[View the full path →](https://sandboxphysics.com/topics/fields-and-matter/#starter-path)
