Brownian motion · Synthetic experiment

Where does a wandering particle end up?

Every particle here follows the same rule and no two paths look alike. Watch where they finish and two things are true at once: the leftward and rightward moves cancel, so the average displacement stays near zero, while the typical distance from the start keeps growing. Telling those two apart is what this instrument is for.

A reproducible trial

The tracer ensemble

Compare the movement of individual tracers with the statistics of the whole ensemble. Changing when or how you observe the trial does not generate different paths.

Predict before the numbers

If you watch four times as long, does the typical distance from the start become 4 times as large, 2 times as large, or unchanged?

Three relations the model could have

Predict before the numbers

In a liquid twice as viscous, after the same time, does the typical distance become half as large, about 0.71 times as large, or unchanged?

Three relations the model could have

The result appears when you choose, say you have one in mind, or skip.

These buttons use the accepted trial, not unsaved draft edits. The requested time must lie on its recording grid.

Same-seed viscosity comparisons use common random numbers, not independent trials.

Experiment settings temperature, viscosity, radius, tracers, timing, seed
Record and observe
With the same settings, the same seed replays the same trial. Any whole number from 0 to 18,446,744,073,709,551,615 works.

The preview records at most 8 MiB of latent paths. Its default is 400 tracers for 10 seconds at 0.02-second resolution. Larger requests are refused, never silently reduced.

1 μm−5 μm+5 μmy displacement
Displacements from a common origin, not a literal microscope image. Lines connect recorded positions and do not supply an instantaneous velocity. 0 / 400 endpoints lie outside this view; none are removed from the ensemble.

Static worked example

Model note
  • Temperature (temperature), Dynamic viscosity (viscosity), Particle radius (particleRadius), Observation interval (observationInterval) and Number of tracers in the trial (ensembleSize): Host calculation, by the site's own reference code. Computed in bm01.acceptedInputs.
  • Boltzmann's constant (boltzmannConstant): Host calculation, by the site's own reference code. Computed in constants.modernSI2019.
  • Diffusion coefficient (diffusionCoefficient): Host calculation, by the site's own reference code. Computed in diffusion.stokesEinsteinD.
  • RMS displacement (one dimension) (rmsDisplacement1d), RMS coordinate displacement after 1 s (lambdaX1s) and RMS coordinate displacement after 60 s (lambdaX60s): Host calculation, by the site's own reference code. Computed in diffusion.rmsDisplacement.
  • Model total mean square (modelSecondMoment), Model mean distance (modelMeanNorm) and Model RMS distance (modelRmsNorm): Host calculation, by the site's own reference code. Computed in diffusion.moments.
  • Tracer positions at the end of the interval (tracerPositions), Coordinates along the drawn traces (traceCoordinates) and Random draws in the recording (recordingDraws): Host calculation, by the site's own reference code. Computed in diffusion.recordTracers.
  • Model apparent coordinate speed (modelApparentSpeed): Host calculation, by the site's own reference code. Computed in diffusion.apparentSpeed.
  • Sample apparent coordinate speed (sampledApparentSpeed), Signed coordinate mean, compared with its sampling band (signedMean) and Mean-square coordinate displacement, compared with its sampling band (meanSquare): Host calculation, by the site's own reference code. Computed in diffusion.ensembleMoments.
  • Times along the drawn traces (traceTimes), Times on the comparison plot (plotTimes), Sample signed mean at each plotted time (plotSampleMean), Sample total mean square at each plotted time (plotSampleMsd), Sample RMS distance at each plotted time (plotSampleRms), Sample apparent speed at each plotted time (plotSampleApparent), Model signed mean at each plotted time (plotModelMean), Model total mean square at each plotted time (plotModelMsd), Model RMS distance at each plotted time (plotModelRms), Model apparent speed at each plotted time (plotModelApparent) and Whether the existing recording was reused (reusedRecording): Host calculation, by the site's own reference code. Computed in bm01.measure.
  • Edges of the histogram bins (histogramEdges), Count in each histogram bin (histogramCounts), Share of the sample in each histogram bin (histogramFrequencies), Samples below the plotted range (underflow), Samples above the plotted range (overflow) and Kolmogorov distance (kolmogorovDistance): Host calculation, by the site's own reference code. Computed in diffusion.displacementHistogram.
  • Model probability of each histogram bin (histogramModel): Host calculation, by the site's own reference code. Computed in diffusion.intervalProbability.
  • Sampling band for the signed coordinate mean (meanBand), Sampling band for the total mean square (secondMomentBand), Lower edge of the sampling band for the signed mean (signedMeanLowerBand), Upper edge of the sampling band for the signed mean (signedMeanUpperBand), Lower edge of the sampling band for the mean square (meanSquareLowerBand) and Upper edge of the sampling band for the mean square (meanSquareUpperBand): Host calculation, by the site's own reference code. Computed in diffusion.ensembleMomentBands.
  • Sample signed mean (sampleMean), Mean absolute coordinate displacement (sampleMeanAbsolute), Sample mean square (sampleMeanSquare), Sample coordinate RMS (sampleRms), Sample mean distance (sampleMeanNorm), Sample total mean square (sampleMeanSquareNorm) and Sample RMS distance (sampleRmsNorm) (secondary results): Host calculation, summarizing the tracer positions above. Computed in diffusion.ensembleMoments.
  • Seed 1905: with the same settings, the same seed replays the same trial.
  • Computed from the settings last applied (settings revision 1, result 1).
  • Not modeled: Molecular collisions (no collision bath owns the displacement).
  • Show the code

Accepted synthetic trial: 400 tracers, 1 second, coordinate mean 0.0029237 micrometres and coordinate RMS 0.98602 micrometres.

Accepted trial: seed 1905; 400 tracers; 293.15 K; viscosity 1 mPa·s; radius 0.5 μm. Observe at 1 s in a 10-second recording. Constants: modern SI 2019.

t = 1.00 s, true rate (1 s/s)
At the natural rate a tracer moves about 0.93 μm along one axis in 1 s (root mean square; scale bar: 1 μm)Simulation view: accelerated snapshot across 10 s
View only: no calculation or new draws.
Fraction in each binChoose an answer aboveto see the result−4.6338 μm4.6338 μm
This plot appears when you choose an answer above, say you have one in mind, or skip.Solid bars: the synthetic sample. Dashed line: probabilities of the same bins under the unbounded model, not a density curve. Counts beyond the plotted range: 0 left, 0 right.
Whole-ensemble statistics: signed coordinate x, total over 1 coordinate
Diffusion coefficient (model)0.42944 μm²/s
Signed mean (sample)0.0029237 μm (modern SI 2019)
Mean absolute coordinate displacement0.77808 μm (modern SI 2019)
Mean-square coordinate displacement0.97223 μm²
Coordinate RMS (sample / model)0.98602 / 0.92676 μm (modern SI 2019)
Mean distance (sample / model)0.77808 / 0.73945 μm (modern SI 2019)
Total mean square (sample / model)0.97223 / 0.85888 μm²
Apparent coordinate speed (sample / model)0.98602 / 0.92676 μm/s
Sampling bands under the model

99.9% per comparison, not a simultaneous guarantee across the table or repeated observations. These ranges are calculated from the model variance, not estimated from the observed sample, and are not uncertainties of the model itself.

Signed coordinate mean (μm): −0.15248 to 0.15248

Total mean square (μm²): 0.67299 to 1.0729

Hundreds of particles each take their own random path from the same start. Their average position stays near the start, but their typical distance from it keeps growing, as the square root of the time.

Section 4 assumes that each particle moves independently of every other, and that one particle's moves in successive short intervals τ are independent of each other, a displacement Δ being as likely as −Δ. From these assumptions the density of particles obeys a diffusion equation, and for particles that all start at x = 0 its solution is a Gaussian with mean zero and mean square 2Dt. The typical displacement along one axis is therefore λx = √(2Dt). It grows as the square root of the time, which is why four times the observation interval doubles the spread. The instrument draws such an ensemble and sets its sample mean and RMS beside the model's.

Modern qualifications

Einstein printed λx = √(2Dt) in Section 4 and, putting in his Section 3 result D = (RT/N) · 1/(6πkP), λx = √t · √((RT/N) · 1/(3πkP)) in Section 5. In his notation k is the fluid's viscosity, not Boltzmann's constant, and P is the particle's radius. He did not claim to have explained an observed motion: the paper opens by saying these motions may be the Brownian motion, but that the reports available to him were too imprecise to judge. Langevin reached the same mean square in 1908 from an equation of motion with a random force, and Perrin's measurements of 1908 and 1909 used Einstein's formula to estimate N.

Inspect the model behind this trial

These equations describe the same accepted trial as the plots and table. Select a symbol or an operation to see what it means; model predictions are not sample estimates.

Explore the equation · Modern model notation

Why the apparent speed depends on how you watch

vapp:=λxtv_{\mathrm{app}} := \frac{\lambda_x}{t}

Shown in modern letters; Einstein's are in §4 of the German source face.

divides

Select a term or operation. In the formula, Down enters an operation, Up returns to its parent, and Left/Right move between siblings. Escape clears selection. Tab leaves the formula.

Each term and operation, in words

Static worked example

These values are for the settings last applied, not for edits you have not applied yet.

Apparent coordinate speed
0.92676 μm/s
Coordinate RMS displacement
0.92676 μm
Observation interval
1 s
Read the equation aloud in words

Apparent coordinate speed equals the model coordinate root mean square displacement divided by the observation interval.

This quotient depends on the observation interval. It is not instantaneous physical velocity. At zero interval the quotient is undefined, even though the displacement is zero.

Model assumptions and every term’s meaning
  • The same one-coordinate ideal Brownian model as the RMS relation.
  • A positive observation interval is required for the quotient.
  • Lines joining recorded points are a rendering convention, not a velocity measurement.
Define the observable
This defines an interval-dependent comparison. It does not introduce a physical instantaneous Brownian velocity. Read the prerequisite
Apparent coordinate speed
A distance-per-interval statistic. It is not a molecular collision speed. Read the prerequisite
Divide by the same interval
The distance grows as the square root of time, while the denominator grows linearly. The quotient therefore decreases as the interval grows. Read the prerequisite
Model coordinate RMS
The same accepted one-coordinate model displacement used by the neighboring RMS equation. Read the prerequisite
Positive observation interval
A zero interval yields no apparent-speed value. The interface keeps the explanation instead of fabricating zero or infinity. Read the prerequisite

Every term’s units were checked when this page was built. That checks the units, not the model. This equation is written for this edition in modern notation, not transcribed from the paper.

Explore the equation · Modern model notation

Resistance to motion controls spreading

D=kB T6 π η aD = \frac{k_B\,T}{6\,\pi\,\eta\,a}

Shown in modern letters; Einstein's are in §3 of the German source face.

is thermal energy divided by the viscous drag coefficient.

Select a term or operation. In the formula, Down enters an operation, Up returns to its parent, and Left/Right move between siblings. Escape clears selection. Tab leaves the formula.

Each term and operation, in words

Static worked example

These values are for the settings last applied, not for edits you have not applied yet.

Diffusion coefficient
0.42944 μm²/s
Boltzmann constant
1.3806 × 10−23 J/K
Absolute temperature
293.15 K
Dynamic viscosity
1 mPa·s
Particle radius
0.5 μm
Read the equation aloud in words

The diffusion coefficient equals the Boltzmann constant times the absolute temperature, divided by six times pi times the dynamic viscosity times the particle radius.

Thermal energy competes with viscous drag. Doubling viscosity halves the diffusion coefficient while reducing RMS displacement only by the square root of two. Radius means radius, not diameter.

Model assumptions and every term’s meaning
  • Dilute, approximately spherical tracers with no-slip Stokes drag in a homogeneous Newtonian liquid.
  • Wall corrections, interactions, inertia, and observation noise are not included.
  • The modern SI 2019 constant set is used; this is not a historical inversion exercise.
An ideal model
This equation assumes the dilute spherical tracer and Stokes-drag model; dimensional consistency alone does not establish those assumptions. Read the prerequisite
Diffusion coefficient
A squared-distance-per-time coefficient. This value comes from the accepted model calculation. Read the prerequisite
Why divide by drag?
Increasing the denominator reduces diffusivity at fixed thermal energy. This is a model dependence, not a rule that every larger quantity must reduce motion. Read the prerequisite
Thermal energy scale
Boltzmann constant times absolute temperature supplies energy per particle. Read the prerequisite
A known modern constant
The SI 2019 constant set supplies this value. It must not be treated as independent historical evidence when trying to infer molecular number. Read the prerequisite
Absolute temperature
Use kelvin. The laboratory holds viscosity as an independently supplied parameter. Read the prerequisite
The drag coefficient
Six pi times viscosity times radius is Stokes drag per speed for an isolated sphere in the assumed low-Reynolds regime. Read the prerequisite
Dynamic viscosity
Viscosity is in the denominator. Doubling it at fixed temperature and radius halves D, not the RMS displacement. Read the prerequisite
Particle radius
The input is a radius, not a diameter. Confusing them changes the predicted coefficient by a factor of two. Read the prerequisite

Every term’s units were checked when this page was built. That checks the units, not the model. This equation is written for this edition in modern notation, not transcribed from the paper.

Explore the equation · Modern model notation

From spreading to a measurable distance

λx=2 D t\lambda_x = \sqrt{2\,D\,t}

Shown in modern letters; Einstein's are in §4 of the German source face.

is the positive square root

Select a term or operation. In the formula, Down enters an operation, Up returns to its parent, and Left/Right move between siblings. Escape clears selection. Tab leaves the formula.

Each term and operation, in words

Static worked example

These values are for the settings last applied, not for edits you have not applied yet.

Coordinate RMS displacement
0.92676 μm
Diffusion coefficient
0.42944 μm²/s
Observation interval
1 s
Read the equation aloud in words

The model coordinate root mean square displacement equals the square root of two times the diffusion coefficient times the observation interval.

Squaring measures spread without cancellation between directions. Taking the positive square root turns squared distance back into a distance. Four times the observation interval gives twice the model RMS, not four times.

Model assumptions and every term’s meaning
  • Independent, zero-mean Gaussian displacement increments in a homogeneous liquid.
  • One-coordinate model statistic, not a measured speed or a sample estimate.
  • The overdamped regime is assumed rather than established from additional particle and fluid measurements.
A model relation
This equality concerns the ideal model. A finite synthetic ensemble fluctuates around it; its sample RMS is displayed separately. Read the prerequisite
Coordinate RMS
One coordinate, not the total three-dimensional distance. Model RMS and sample RMS have different meanings. Read the prerequisite
Why a square root?
Two D t has units of squared length. Its positive square root has units of length and defines the typical displacement. Read the prerequisite
Build the mean square
Independent zero-mean increments add their variances. The definition of D makes the coordinate mean square equal to 2 D t. Read the prerequisite
Diffusion coefficient
This is the accepted model diffusivity, not a rate inferred from the synthetic data. Read the prerequisite
Observation interval
This is the interval used for the displayed displacement, not the simulation frame rate. Re-observing the trial preserves its paths. Read the prerequisite

Every term’s units were checked when this page was built. That checks the units, not the model. This equation is written for this edition in modern notation, not transcribed from the paper.

RMS distance over recorded time

Choose an answer aboveto see the resultμm · log scale0.02 s10 s
This plot appears when you choose an answer above, say you have one in mind, or skip.Solid: this sample. Dashed: the model. The time axis is logarithmic. Zero sample values, if any, remain in the table but cannot appear on a log scale. All times refer to the same recorded paths.
Read the comparison as a table
RMS distance (μm)
Time (s)SampleModel
0.020.130380.13106
0.040.185560.18535
0.10.303680.29307
0.20.404160.41446
0.40.613880.58613
10.986020.92676
21.34951.3106
41.90351.8535
102.87232.9307

What is, and is not, being simulated

These synthetic paths are Gaussian independent increments for dilute spherical tracers in a homogeneous Newtonian liquid. They do not simulate individual molecular collisions, inertia, interactions, sedimentation, walls, localization error or motion blur.

Low Reynolds number and observation times long compared with momentum relaxation are assumed, not verified from fluid and particle data. Lines between samples are a drawing convention; they do not define an instantaneous Brownian speed.

The three latent coordinates are recorded together. Axis, dimension, observation and statistic changes reuse those coordinates. The histogram and statistics use every tracer, including those outside the view.

No FrankenSim WASM artifact produced this trial. Integer random draws follow the pinned Philox mapping; Gaussian conversion uses this host’s math functions and is not claimed bitwise identical across browser engines.

Logical recording draws: 1200000. This result was assembled from a newly generated deterministic recording.

Evaluator source digest: source:sha256:6e9e4cb91ff4a2493d2b641284d3697eec06b64a62f056de23ddc501ecb7aa67

Show the code

The site’s own reference code for this law, in TypeScript. It computes the numbers above when the page runs it, and it is what the page uses wherever a FrankenSim result is not available.

stokesEinsteinD · src/physics/reference/diffusion/distributions.ts · this site’s source, as built · sha256:a41fa1ff39026dbed9a701b368028012995d1835d9acebb2e32d5010f47404ec

This is the function that produced the numbers shown now.

In words

Take the temperature and the gas constant, divide by the number of molecules in a mole to get the energy scale of one molecule, then divide by the drag on a sphere of this radius in a liquid of this viscosity.

Mathematics

Resistance to motion controls spreading

D=kB T6 π η aD = \frac{k_B\,T}{6\,\pi\,\eta\,a}

Explore Resistance to motion controls spreading term by term, with this laboratory’s values

Implementation

/** SI: temperature K, viscosity Pa s, radius m, output m2/s. No ambient constants. */
export function stokesEinsteinD(
  {
    T,
    eta,
    a,
    medium = "liquid",
  }: { T: number; eta: number; a: number; medium?: "liquid" | "gas" },
  set: ConstantSet,
): Evaluation {
  if (![T, eta, a].every((v) => Number.isFinite(v) && v > 0))
    return outside(
      "diffusionCoefficient",
      "stokesEinsteinD",
      "T > 0, eta > 0, a > 0",
      "Enter positive finite temperature, viscosity, and particle radius.",
      "input",
      set,
    );
  if (medium !== "liquid")
    return outside(
      "diffusionCoefficient",
      "stokesEinsteinD",
      "stokes-gas-medium",
      "The liquid Stokes-drag model does not include the slip correction needed in a gas.",
      "model",
      set,
    );
  const k = thermalConstant(set);
  return number(
    "diffusionCoefficient",
    "stokesEinsteinD",
    (k.value * T) / (6 * Math.PI * eta * a),
    set,
    undefined,
    true,
  );
}
One worked example of this calculation. Constant set: Declared 1905-plan inputs.
StepExpressionValueUnit
The gas constant in SIR = 8.31 × 107 erg mol−1 K−18.31J mol⁻¹ K⁻¹
Thermal energy per moleRT2411.1J mol⁻¹
Drag on one sphere6 π η a (this operation in the equation)1.2723 × 10⁻⁸kg s⁻¹
Drag on a mole of spheresN 6 π η a7.6341 × 10¹⁵kg s⁻¹ mol⁻¹
Diffusion coefficientRT / (N 6 π η a) (this operation in the equation)3.1584 × 10⁻¹³m² s⁻¹
Coordinate RMS at 1 sλ_x = √(2 D t) at t = 1 s (this operation in the equation)7.9478 × 10⁻⁷m
Coordinate RMS at 60 sλ_x = √(2 D t) at t = 60 s (this operation in the equation)6.1564 × 10⁻⁶m

The site’s own reference code for this law, in TypeScript. It computes the numbers above when the page runs it, and it is what the page uses wherever a FrankenSim result is not available.

rmsDisplacement · src/physics/reference/diffusion/distributions.ts · this site’s source, as built · sha256:6d2d381222179a43397683f83d95eecf9dab253844f72dfcaa1eaab1302222eb

This function computes the listed outputs when it runs.

In words

The typical one-dimensional displacement is the square root of twice the diffusion coefficient times the observation interval.

Mathematics

From spreading to a measurable distance

λx=2 D t\lambda_x = \sqrt{2\,D\,t}

Explore From spreading to a measurable distance term by term, with this laboratory’s values

Implementation

export function rmsDisplacement(D: number, t: number): Evaluation {
  if (!validDt(D, t))
    return outside(
      "rmsDisplacement1d",
      "rmsDisplacement",
      "D >= 0 and t >= 0",
      "Diffusivity and elapsed time must be finite and nonnegative.",
    );
  return number(
    "rmsDisplacement1d",
    "rmsDisplacement",
    scale(D, t),
    undefined,
    undefined,
    D > 0 && t > 0,
  );
}

The site’s own reference code for this law, in TypeScript. It computes the numbers above when the page runs it, and it is what the page uses wherever a FrankenSim result is not available.

apparentSpeed · src/physics/reference/diffusion/distributions.ts · this site’s source, as built · sha256:1f2137435fdc15b0a9b5c91cc4dafba680e8d52b0f5143fdbefdfa9945f6baec

This function computes the listed outputs when it runs.

In words

Divide the model RMS displacement by the observation interval. The quotient depends on how long you watch.

Mathematics

Why the apparent speed depends on how you watch

vapp:=λxtv_{\mathrm{app}} := \frac{\lambda_x}{t}

Explore Why the apparent speed depends on how you watch term by term, with this laboratory’s values

Implementation

export function apparentSpeed(D: number, tau: number): Evaluation {
  if (!validDt(D, tau) || tau === 0)
    return outside(
      "apparentSpeed",
      "apparentSpeed",
      "D >= 0 and tau > 0",
      "An apparent speed needs a positive observation interval.",
    );
  return number(
    "apparentSpeed",
    "apparentSpeed",
    (Math.SQRT2 * Math.sqrt(D)) / Math.sqrt(tau),
    undefined,
    undefined,
    D > 0,
  );
}

The site’s own reference code for this law, in TypeScript. It computes the numbers above when the page runs it, and it is what the page uses wherever a FrankenSim result is not available.

ensembleMoments · src/physics/reference/diffusion/tracers.ts · this site’s source, as built · sha256:1d87c8e69590b8871bcc7a6390089003f59d0b80bfc7eb1919a57dec661743e6

This function computes the listed outputs when it runs.

In words

Average the recorded displacements of every tracer, not a viewport subset.

Implementation

/** Compensated sums over ALL members, never a viewport-selected subset. Row-major M by d. */
export function ensembleMoments({
  displacements,
  d,
  dt,
  viewport,
}: {
  displacements: Float64Array;
  d: number;
  dt?: number;
  viewport?: ViewportBounds;
}): Computation<EnsembleMoments> {
  if (
    !(displacements instanceof Float64Array) ||
    ![1, 2, 3].includes(d) ||
    displacements.length === 0 ||
    displacements.length % d !== 0 ||
    displacements.length > 30000 ||
    !displacements.every(Number.isFinite)
  )
    return invalid(
      ["displacements", "d"],
      "Provide finite, row-major displacements with one, two or three coordinates per tracer.",
    );
  const M = displacements.length / d,
    sums = new Float64Array(d * 3 + 1),
    corrections = new Float64Array(d * 3 + 1);
  function add(i: number, v: number) {
    const corr = corrections[i] ?? 0,
      sum = sums[i] ?? 0,
      y = v - corr,
      t = sum + y;
    corrections[i] = t - sum - y;
    sums[i] = t;
  }
  for (let i = 0; i < M; i++) {
    let norm = 0;
    for (let j = 0; j < d; j++) {
      const v = displacements[i * d + j];
      if (v === undefined) return failure("A required displacement coordinate was undefined.");
      if (v !== 0 && v * v === 0)
        return failure("A nonzero squared displacement is below the representable range.");
      add(j * 3, v);
      add(j * 3 + 1, Math.abs(v));
      add(j * 3 + 2, v * v);
      norm = Math.hypot(norm, v);
    }
    add(d * 3, norm);
  }
  const axes = Array.from({ length: d }, (_, j) => {
    const mean = (sums[j * 3] ?? 0) / M;
    const meanAbsolute = (sums[j * 3 + 1] ?? 0) / M;
    const meanSquare = (sums[j * 3 + 2] ?? 0) / M;
    return {
      mean,
      meanAbsolute,
      meanSquare,
      rms: Math.sqrt(meanSquare),
    };
  });
  const meanSquareNorm = axes.reduce((s, a) => s + a.meanSquare, 0);
  if (![...sums, meanSquareNorm].every(Number.isFinite))
    return failure("The moment reduction exceeded the numerical range.");
  const rmsNorm = Math.sqrt(meanSquareNorm);
  let insideCount: number | undefined;
  let outsideCount: number | undefined;
  if (viewport) {
    let inc = 0;
    let outc = 0;
    for (let i = 0; i < M; i++) {
      let isInside = true;
      for (let j = 0; j < d; j++) {
        const v = displacements[i * d + j] ?? 0;
        const minVal = viewport.min[j] ?? -Infinity;
        const maxVal = viewport.max[j] ?? Infinity;
        if (v < minVal || v > maxVal) {
          isInside = false;
          break;
        }
      }
      if (isInside) inc++;
      else outc++;
    }
    insideCount = inc;
    outsideCount = outc;
  }
  const apparentSpeed =
    dt !== undefined && Number.isFinite(dt) && dt > 0
      ? (d === 1 ? (axes[0]?.rms ?? 0) : rmsNorm) / dt
      : undefined;
  return {
    kind: "accepted",
    data: {
      M,
      axes,
      meanNorm: (sums[d * 3] ?? 0) / M,
      meanSquareNorm,
      rmsNorm,
      ...(apparentSpeed !== undefined ? { apparentSpeed } : {}),
      ...(insideCount !== undefined && outsideCount !== undefined ? { insideCount, outsideCount } : {}),
    },
  };
}

The site’s own reference code for this law, in TypeScript. It computes the numbers above when the page runs it, and it is what the page uses wherever a FrankenSim result is not available.

displacementHistogram · src/physics/reference/diffusion/tracers.ts · this site’s source, as built · sha256:746f24cee7b8573b8a986cd8e072b4786549eba47dffca106dbd38582d670c7b

This function computes the listed outputs when it runs.

In words

Count how many recorded displacements fall in each interval of the histogram.

Implementation

export function displacementHistogram(
  values: Float64Array,
  edges: Float64Array,
): Computation<{ counts: Float64Array; underflow: number; overflow: number; total: number }> {
  if (
    values.length === 0 ||
    values.length > 10000 ||
    edges.length < 2 ||
    edges.length > 1001 ||
    !values.every(Number.isFinite) ||
    !edges.every((v, i) => {
      if (!Number.isFinite(v)) return false;
      if (i === 0) return true;
      const prev = edges[i - 1];
      return prev !== undefined && v > prev;
    })
  )
    return invalid(
      ["values", "edges"],
      "Use finite samples and strictly increasing histogram edges.",
    );
  const counts = new Float64Array(edges.length - 1);
  let underflow = 0,
    overflow = 0;
  const firstEdge = edges[0];
  const lastEdge = edges[edges.length - 1];
  if (firstEdge === undefined || lastEdge === undefined)
    return invalid(["edges"], "Histogram edges array must contain at least two finite bounds.");
  for (const value of values) {
    if (value < firstEdge) {
      underflow++;
      continue;
    }
    if (value > lastEdge) {
      overflow++;
      continue;
    }
    let lo = 0,
      hi = edges.length - 1;
    while (hi - lo > 1) {
      const mid = (lo + hi) >>> 1;
      const edgeMid = edges[mid];
      if (edgeMid !== undefined && value < edgeMid) hi = mid;
      else lo = mid;
    }
    const bin = Math.min(lo, counts.length - 1);
    const prevCount = counts[bin];
    if (prevCount !== undefined) {
      counts[bin] = prevCount + 1;
    }
  }
  return { kind: "accepted", data: { counts, underflow, overflow, total: values.length } };
}
Every histogram count, including tails
Coordinate intervals in μm; half-open bins, with the final endpoint included
IntervalCount
Below the plotted range0
−4.6338 to −4.40210
−4.4021 to −4.17040
−4.1704 to −3.93870
−3.9387 to −3.7070
−3.707 to −3.47530
−3.4753 to −3.24370
−3.2437 to −3.0120
−3.012 to −2.78031
−2.7803 to −2.54861
−2.5486 to −2.31690
−2.3169 to −2.08527
−2.0852 to −1.85357
−1.8535 to −1.62186
−1.6218 to −1.390116
−1.3901 to −1.158412
−1.1584 to −0.9267615
−0.92676 to −0.6950728
−0.69507 to −0.4633824
−0.46338 to −0.2316939
−0.23169 to 039
0 to 0.2316943
0.23169 to 0.4633837
0.46338 to 0.6950726
0.69507 to 0.9267632
0.92676 to 1.158423
1.1584 to 1.390117
1.3901 to 1.62188
1.6218 to 1.85356
1.8535 to 2.08526
2.0852 to 2.31693
2.3169 to 2.54861
2.5486 to 2.78031
2.7803 to 3.0121
3.012 to 3.24371
3.2437 to 3.47530
3.4753 to 3.7070
3.707 to 3.93870
3.9387 to 4.17040
4.1704 to 4.40210
4.4021 to 4.63380
Above the plotted range0
Total, including both tails400

Separate controls and workers; both start with the same worked-example seed. Choose a new trial to compare independently seeded realizations.

Not modeled: Molecular collisions (no collision bath owns the displacement); The ballistic short-time regime and inertia; Hydrodynamic interactions; Walls and near-wall corrections; Sedimentation; Non-Newtonian or active fluids; Rotation; Polydispersity; A temperature law for viscosity; Localization error and motion blur (BM-08); Gas-phase slip.

A mean near zero does not mean no motion.

⟨x⟩=0,⟨x2⟩=2Dt,λx=2Dt\begin{gathered}\langle x\rangle=0, \\ \langle x^2\rangle=2Dt, \\ \lambda_x=\sqrt{2Dt}\end{gathered}
Explain this equation

The model’s signed mean is zero; a finite synthetic sample fluctuates around it. The mean square remains positive as the cloud spreads. Four times the observation interval gives twice the model RMS displacement, not four times the RMS.

The apparent-speed trap

λxτ=2Dτ\frac{\lambda_x}{\tau}=\sqrt{\frac{2D}{\tau}}

Dividing the typical displacement by the observation interval produces a quantity that grows as the interval shrinks. It is an interval-dependent apparent speed, not an instantaneous velocity of a tracer. At zero elapsed time it is not defined.

The accepted sample and the model curves are not experimental evidence. Historical constants remain in preparation.

Before you draw a conclusion

Common wrong turns this instrument speaks to

  • The average displacement is zero, so on average the grains have not moved.

    The paper does not average the displacements. It averages their squares and takes the root, and that number grows with the square root of the time.

    Read the full entry, with its sources

  • A grain's velocity can be read off its path under the microscope.

    The distance a grain covers grows as the square root of the time, so a distance divided by a time depends on how often you look. The paper works with the displacement in a stated time, not with a velocity.

    Read the full entry, with its sources

  • Doubling the viscosity halves the typical displacement.

    A liquid twice as viscous halves DD, but the typical distance goes as the square root of DD, so it falls to about 0.71 of its value, not to half.

    Read the full entry, with its sources

Embed this laboratory on another page. It starts from its worked defaults, not your current settings.