Differential dynamic microscopy

When does a soft solid start to flow?

Hair gel, mayonnaise and toothpaste hold their shape at rest but flow when pushed hard enough: they yield. Shear such a material back and forth between two plates, film tracer beads in it, and compare frames taken exactly one cycle apart. Whatever the shear undoes every cycle cancels in that comparison, and only the rearrangements it leaves behind remain: an echo of the material's memory. Here you can check what this echo differential dynamic microscopy (echo-DDM) finds on simulated soft materials (Edera et al. 2021).

Try this first: shear a viscous liquid harder. Do its echoes fade faster? Predict, then watch the page check it.

How deep do you want to go?
Simulating the movie...
Live simulated bright-field movie

Hands on

The bench

Choose the material and how hard and how fast it is sheared, then the microscope and the camera (controls on the left, or just below on a phone). The bench records one movie of a few hundred frames and takes about ten seconds; the strain sweep of step 7 takes about two minutes. "Copy a link to this setup" gives an address that opens the bench with the same settings.

1

Set up the shear cell and the microscope

The sample sits between two glass plates 500 µm apart. The bottom plate stays still, the top one slides back and forth along x: each layer of the sample follows, the more the higher it is. The microscope looks up through the bottom plate at a thin layer in the middle, where tracer beads mixed into the material show its motion. The strain is how far the top plate moves divided by the gap: at 50 % it travels 250 µm each way.

The whole layer in focus is carried back and forth too, by far more than the field of view. Real experiments follow it with the stage or shift each frame back in place (registration); the movie here is filmed in the frame that moves with the focal plane, so what is left is the shear across the depth in focus and anything the material does on its own.

How one bead looks

What this step gives: the finest stripes the movie can hold, and how deep a layer each pattern collects beads from: the deeper, the more the shear moves its beads by different amounts within one cycle.

The math: what the shear does to each bead

The flow is along x, the velocity changes along the height h (the axis of the microscope) and y is the vorticity direction. A bead at height h is drawn at

x(t) = x0(t) + γ0 (h − hfocus) sin(2πt/T0)

the affine displacement relative to the focal plane, with γ0 the strain amplitude and T0 the period. The position x0, y0, h moves only by what the shear does not undo. Rearrangements of the material (the microgel): diffusion of x0, y0, h in the material's own coordinates, which are back in place whenever the strain is zero, with coefficients Dx, Dy, Dh that depend on the strain (step 7): an assumption of the model. Brownian motion (the liquid): the bead is carried by the flow while it diffuses, dx = γ̇(t)(h − hfocus) dt + dWx, so a step dh at strain γ also moves x0 by −γ dh. Over whole cycles this adds γ02D0/2 along the flow, even between frames at zero strain: shear-induced dispersion (for oscillatory flows see Jansons, On Taylor dispersion in oscillatory channel flows, 2006). The beads are 2 µm polystyrene spheres; their images are computed as on the sizing page (Mie scattering and the partially coherent light of the condenser). The simulation keeps a layer 40 µm deep around the focus: beads further away add only a smooth background.

2

Record a movie, a few frames per cycle

32-bit, photoelectrons per pixel; opens in ImageJ, Fiji and fastDDM.

The camera takes a few frames in every cycle, the first when the top plate passes its rest position, and keeps going for many cycles: the rearrangements a material does in one cycle are often tiny, and only add up to something visible over tens or hundreds of cycles.

What this step gives: a stack of frames, each at a known point of the cycle. The period sets which frames show the sample in the same state.

In fastDDM

With your own movies you would start from the image files, registered so that the layer in focus stays in place:

import fastddm as fd
img_seq = fd.read_images(file_names)
m = 4                                  # frames per period
3

Subtract two frames

Subtract a frame from one taken a little later. Everything that is in the same place in both cancels out; what is left is what moved, plus the camera noise.

What this step gives: for every pair of frames a delay apart, an image of what changed. A quarter of a cycle apart the shear has moved the beads; a whole cycle apart it has put them back, apart from what the material did on its own.

The math: the difference image
ΔI(x; t, Δt) = I(x, t + Δt) − I(x, t)
4

Split it into stripe patterns

Strength of each pattern in the difference (click it, or use the sliders)
The pattern you picked
How much of each pattern is left
-10, gone1, all there

Any image can be built by adding up stripe patterns of different spacing and direction. The Fourier transform tells how much of each pattern the difference image contains, averaged over the whole movie. The centre of the map holds wide stripes, the edge fine ones.

The charts further down label each pattern by q, a number that grows as the stripes get finer: q = 2π divided by the stripe spacing, in inverse micrometres. Stripes 1 µm apart have q of about 6.

The shear moves the beads along x only, so it mostly affects stripes that cross the flow: those whose spacing is measured along x, to the left and right of the centre of the map. Stripes lying along the flow, above and below the centre, hardly notice it. Move the delay slider to a quarter of a period and then to a whole one, and watch the map.

The dashed circle on the strength map marks the finest pattern the microscope can resolve.

What this step gives: for each stripe spacing and direction, and each delay, how much the movie has changed. The analysis keeps two directions apart: patterns along the flow (q along x) and along the vorticity (q along y).

The math: structure function and echoes
d(q, Δt) = ⟨ |F[ΔI](q; t, Δt)|2 ⟩t = A(q) [1 − f(q, Δt)] + B

Within a cycle, beads at different heights in the depth of field move by different amounts, γ0(h − hfocus) [sin 2π(t + Δt)/T0 − sin 2πt/T0], so f drops for qx ≠ 0. At Δt = kT0 that term vanishes, and

f(q, kT0) = exp[−(Dxqx2 + Dyqy2) kT0]

for rearrangements that add up like diffusion. Map axes: qx to the right, qy up. The page averages over two sectors of ±20°: along the flow and along the vorticity.

5

Watch a pattern through a few cycles

Follow one stripe spacing over the first three cycles, in the two directions. Across the flow, the pattern fades within each cycle, as the shear carries beads at different depths by different amounts, and comes back at the end of it, when the plates are where they started: an echo. Half way through it comes back only in part: pairs of frames that start at rest find the plates back in place, those that start at the largest strain find them on the opposite side. Along the flow, the shear hardly touches the pattern.

The points are f(q, Δt) = 1 − (d − B) / A in the two sectors, at the q picked on the map of step 4. The echoes, at whole periods, are drawn larger: how high they reach is what step 6 follows over the whole movie.

The numbers behind this chart: how much of a pattern is left within the first three cycles, across and along the flow
Predict first: the sample is now an elastic solid, a rubber that never rearranges. One full cycle later, how much of a pattern across the flow is left?

What this step gives: which frames to compare. Within a cycle the shear scrambles the patterns; at whole periods it gives them back, and what is missing is what the material did on its own.

6

Follow the echoes

Now compare only frames a whole number of cycles apart. Each echo is a little lower than the one before if the material rearranges a little every cycle: fine stripes lose their echo first, wide ones last. From how fast the echoes fade the page reads how fast the beads wander away from where the shear would have brought them back, along the flow and across it.

At each q and in each sector, f at the echoes is fitted with a weighted line through the origin of −ln f against the delay, while f > 0.15 (weights f2): the rate Γ, and D = Γ / q2. The q that pass the checks are averaged (mean of ln D; uncertainty from a jackknife over eight parts of the movie). Only pairs that start at zero strain are used (Addict: "Echoes at zero strain").

Along the flow, the shear direction (patterns with q along x): how much of each is left at the echoes
Along the vorticity (patterns with q along y): how much of each is left at the echoes
The numbers behind these charts
How fast the beads wander, read from each pattern, along the flow and along the vorticity
    The numbers behind this chart: diffusion coefficient of the rearrangements found at each q
    Signal A(q) and camera noise B. Large beads make a strong signal: it stands far above the noise until the finest patterns the microscope resolves. The dips are the patterns at which the light scattered across a bead cancels, at spacings set by its size (for 2 µm beads, near 2.7 and 5.7 µm-1): there the signal is weak and those patterns count little.
    The numbers behind this chart: signal and noise amplitudes
    What the analysis is told, and what it finds

    Told (inputs): the pixel size, the frame rate, the number of frames per period and the camera noise (from the mean count and the read noise).

    Found from the movie: f at the echoes at each q, along the flow and along the vorticity, and the diffusion coefficients of the rearrangements.

    In this simulation the rearrangements are diffusion by construction, so the model fits by design; in a real material they can be intermittent or ballistic, and the shape of f tells.

    What this step gives: how much the material rearranges per cycle at this strain, in two directions: the irreversible part of its motion.

    The math: the fit of the echoes
    −ln f(q, kT0) = Γ(q) kT0,    Γ = Σk wk tk (−ln fk) / Σk wk tk2,    wk = fk2

    Noise and amplitude. B = 2 (mean count + read noise2), from the camera; A = 2⟨|F|2⟩ − B, from the mean power of each mode, so that a sample that never rearranges keeps its whole amplitude (its temporal variance would be zero). Echoes at zero strain. For the microgel, whose rearrangements the model applies in the material's own coordinates: a bead that moved along the height between two echoes sits where the affine displacement is different, and at strain γ it is displaced by γ Δh along the flow, which adds γ02 sin2(phase) ⟨Δh2⟩ to ⟨Δx2⟩. Averaged over every phase, as in the paper, Dx gains γ02 Dh / 2; pairs that start at zero strain (every half period here) leave it out, because the material coordinates are back in place there. For the liquid this cancellation is not complete: a Brownian bead carried by the flow does not come back exactly, and even the zero-strain pairs keep an extra D0 γ02 / 2 along the flow (shear-induced dispersion). That part is real motion, and the page counts it in what it expects; the zero-strain pairs remove only the further extra that averaging over the phases adds. Checks. A q is left out when its signal is below the noise, when it is finer than the microscope resolves, when it fades within one period (fewer than three echoes above 0.15), or when it hardly fades within the movie (the last echo above 0.9). When no pattern fades enough, the page gives the slowest D this movie could have shown: −ln 0.9 / (qmax2 tmax). What the page does not fix. Below the yield point, where the echoes fade only over most of the movie, the jackknife underestimates the uncertainty: on six independent samples at 20 % strain, D along the flow scattered by 12 % from sample to sample, about twice the jackknife, around the right value (on average 1 % high). The simulated layer holds about 160 beads, and each wanders by less than a pixel over the movie; a real field of view holds many more. Above it (80 %) the jackknife came close to the scatter: 12 % against 15 %.

    In Python, with F the Fourier transform of each frame and m frames per period:

    import numpy as np
    F = np.fft.fft2(img_seq)                       # frames x rows x columns
    def echo_d(k):                                 # d(q) at k periods, pairs starting at zero strain
        t0 = np.arange(0, len(F) - k * m, m // 2)
        return (np.abs(F[t0 + k * m] - F[t0]) ** 2).mean(axis=0) / F[0].size
    7

    Yielding: a strain sweep

    Repeat the measurement from a gentle to a strong strain. A soft solid below its yield point holds: its beads hardly move from one cycle to the next. Past the yield point it flows, and the rearrangements jump up by orders of magnitude. A simple liquid behaves differently: along the vorticity its echoes fade only by the beads' own Brownian motion, however hard it is sheared; along the flow they fade a little faster with the strain, because a bead that diffuses up or down while the layers slide is not carried exactly back.

    The sweep runs the bench at 11 strain amplitudes from 5 % to 150 %, each a new movie, and plots Dx and Dy on log scales against the strain, with the model used by the simulation. For the microgel, the model is set to the two strains measured by Edera et al. (2021) on Carbopol, 20 % and 80 %: D = (2.2-2.6) × 10-4 µm2/s below the yield strain of about 60 % and (1.9-2.9) × 10-1 µm2/s above it; how D changes in between, and beyond, is our assumption (see "The math").

    Predict first: the sample is now a viscous liquid, a mix of glycerol and water. You shear it much harder, from 20 % to 150 %. Do the echoes along the flow fade faster, more slowly, or at the same pace?

    What this step gives: the yield strain, where the rearrangements jump, and how anisotropic they are once the material flows.

    A question to think about: Above the yield strain the page finds the beads wandering faster along the flow than along the vorticity. If you averaged the echoes over every phase of the cycle, instead of starting at zero strain, which of the two would change, and why?

    Only the one along the flow. For the rearrangements of the microgel, which the simulation moves within the material: a bead that has moved up or down between two echoes sits where the shear carries it by a different amount, but only along the flow and only while the strain is not zero: at strain γ its echo is off by γ Δh along x. Averaged over the cycle this adds γ02 Dh / 2 to Dx: at 150 % strain about three quarters of the rearrangements themselves. Try it at the Addict level ("Echoes at zero strain" off).

    The math: the model of the materials

    Microgel (Carbopol 0.5 %). At 1 Hz, with γ the strain amplitude and s(γ) = 1 / (1 + e−(γ − 0.6) / 0.05) a smooth step at the yield strain of 60 %:

    Dx = 2.2 × 10-4 (γ/0.2)2 + 0.29 (γ/0.8)2 s(γ) µm2/s,    Dy = Dh = 2.6 × 10-4 (γ/0.2)2 + 0.19 (γ/0.8)2 s(γ) µm2/s

    so that it passes through the values of Edera et al. (2021) at 20 % and 80 %. At other frequencies the same rearrangement per cycle is assumed: D scales with the frequency. The beads have no thermal motion of their own in the gel. Rubber. D = 0. Viscous liquid. No rearrangements; the beads diffuse with the Stokes-Einstein coefficient of the liquid, D0 = kBT / 6πηa, and are carried by the flow while they do: along the vorticity the echoes fade with D0, along the flow with D0(1 + γ02/2) (unconfined height motion; the walls of the cell, 40 µm apart here, hardly change it over a few cycles). In our tests the page read 1.23, 1.54 and 2.19 times D0 along the flow at 50, 100 and 150 % (three samples each; the formula gives 1.13, 1.5 and 2.13) and 1.03 to 1.06 along the vorticity. The real materials do more: intermittent, localised rearrangements below the yield point, shear bands in some materials past it (Edera et al. 2024), slip at the plates. None of these is simulated.

    Settings used for this run
    
              

    In a real experiment

    What matters

    Each card sets the bench to a typical case and shows where to look; some also run the sweep of step 7. Use "Back to the standard sample" to start again.

    What this page adds to the published methods

    Edera et al. (2021) introduced echo-DDM: images taken a whole number of periods apart under oscillatory shear, their structure functions averaged over the phases of the cycle, with the noise from the first delays. The steps below are not in the papers we cite: we added them while testing the page against its own simulations, and some may exist elsewhere. At the "Addict" level each can be switched off, and the result table shows a baseline: the published steps alone, as implemented here, on the same movie (every phase averaged, B from a quadratic through the first three echoes). This baseline is one implementation of the published steps, run on movies from this page's own simulation: it shows what each added step changes here, not how the published method performs in general.

    Glossary

    Numerical aperture (NA)
    How wide a cone of light the objective collects, or the condenser sends: n sin(half-angle). A larger NA resolves finer details and keeps a thinner layer in focus.
    Wave vector q
    Describes a stripe pattern of the image: q = 2π divided by the stripe spacing, in µm-1. Not the wave number of the light, k = 2πn/λ.
    Structure function d(q, Δt)
    The average strength of pattern q in the difference of two frames taken Δt apart.
    Amplitude A and noise B
    A(q): how much pattern q changes once the sample has fully renewed it. B: what the camera noise adds, at every delay.
    Intermediate scattering function f(q, Δt)
    How much of pattern q is still there after a delay Δt: 1, all of it; 0, gone.
    Hydrodynamic radius
    The radius of a sphere that would diffuse as the particle or protein does (Stokes-Einstein relation).
    Self and collective diffusion
    Self: how one particle wanders among the others. Collective: how ripples in the number of particles even out.
    Mean squared displacement
    The average of the squared distance the particles travel in a given time.
    Storage and loss moduli G', G''
    How elastic and how viscous a material is, at an angular frequency ω (rad/s; the frequency in hertz is ω/2π).
    Molar mass M
    The mass of one mole of a protein, in g/mol; a protein of 148 kDa has M = 148 000 g/mol.
    Second virial coefficient
    How two molecules interact, on balance: B2 per pair of molecules (a volume), A2 = B2NA/M2 per gram (mol mL/g2), with NA Avogadro's number. Positive: they keep apart; negative: they attract.
    Diffusion interaction parameter kD
    How fast collective diffusion changes with the concentration: D = D0(1 + kDc). It holds the interactions and the drag of neighbours through the liquid.

    About this tool

    This page is a simple tool, generated with Claude Opus 5.5, that simulates a realistic rheo-microscopy experiment in which echo-DDM is used to see how a soft material rearranges under oscillatory shear. The microscope, light source and camera are modelled mostly on the instruments of our SoMeX lab; the shear cell is a parallel-plate cell like the one of Edera et al. (2021). The material itself is not simulated: the beads follow the affine shear exactly and wander by a diffusion whose strength depends on the strain, set from published measurements. The aim is not to produce research-quality data, but to give anyone thinking of using DDM under shear an idea of what it can measure, and of what limits it.

    If you find something that looks wrong or does not work, please let us know through the contact page.

    To cite this page: R. Cerbino, DDM, hands on: sheared materials, rcerbino.github.io/ddm/shear/ (2026), with the date you used it.

    Go further