Analysis Modes¶
Learning Objectives
By the end of this section you will understand:
The two analysis modes (static and laminar_flow) and when to use each
The model equations and free parameters for each mode
How to choose the right mode for your experiment
What per-angle scaling is and when it matters
Example YAML configurations for each mode
—
Overview¶
Homodyne provides two analysis modes, corresponding to two different physical models for the dynamics:
Mode |
Parameters |
Physical System |
Key Equation Feature |
|---|---|---|---|
|
3 |
Brownian/anomalous diffusion; no flow |
Purely diffusive decay |
|
7 |
Diffusion + laminar shear (Couette) |
Sinc factor from shear advection |
—
Static Mode¶
When to use static mode:
Equilibrium samples (no applied shear or flow)
Gels, glasses, concentrated suspensions aging under gravity
Any experiment where the dominant dynamics are diffusive
When you want to characterize \(D_0\) and check for anomalous diffusion
Quick initial characterization of an unknown sample
Model equation:
where \(J(t)\) is the transport coefficient — the instantaneous rate of growth of mean-squared displacement — and the integral \(\int J\,dt'\) equals the variance of particle displacement over the interval \([t_1, t_2]\). Homodyne evaluates this integral numerically using cumulative trapezoidal integration (see Transport Coefficient J(t)).
Free parameters (3): \(D_0\), \(\alpha\), \(D_\text{offset}\)
Parameter |
Symbol |
Units |
Description |
|---|---|---|---|
|
\(D_0\) |
Ų/s |
Reference diffusion coefficient |
|
\(\alpha\) |
dimensionless |
Diffusion time-dependence exponent |
|
\(D_\text{offset}\) |
Ų/s |
Baseline (constant) diffusion rate |
See Parameter Interpretation Guide for physical interpretation, typical ranges, and default bounds.
Example YAML configuration for static mode:
analysis:
mode: "static"
parameter_space:
D0:
initial: 1.0
bounds: [0.01, 100.0]
alpha:
initial: -0.5
bounds: [-2.0, 0.0]
D_offset:
initial: 0.01
bounds: [0.0, 10.0]
Generating a static template:
homodyne-config --mode static --output config_static.yaml
—
Laminar Flow Mode¶
When to use laminar flow mode:
Samples in Couette (concentric cylinder) or cone-plate shear cells
Any experiment where velocity gradients create an angular dependence in \(C_2\)
When you observe characteristic oscillations in the azimuthal \(q\)-dependence
Flow characterization: measuring shear rate profiles, velocity gradients
Physical setup:
In a Taylor-Couette geometry, the sample is sheared between concentric cylinders. The velocity field creates a displacement of scatterers that depends on both the lag time \((t_2 - t_1)\) and the azimuthal angle \(\phi\) between the scattering vector and the flow direction.
The accumulated shear strain over the interval \([t_1, t_2]\) is:
where \(\dot\gamma(t)\) is the time-dependent shear rate. Like the diffusion integral, this is evaluated numerically by homodyne.
Model equation:
where \(h\) is the gap distance (stator-rotor separation in Å), \(J(t)\) is the transport coefficient (same as in static mode), \(\Gamma(t_1, t_2)\) is the accumulated strain integral, and \(\mathrm{sinc}(x) = \sin(\pi x)/(\pi x)\) (normalized sinc; NumPy/JAX convention). See Homodyne Scattering: Laminar Flow Model for the full derivation.
Free parameters (7):
Parameter |
Symbol |
Units |
Description |
|---|---|---|---|
|
\(D_0\) |
Ų/s |
Reference diffusion coefficient |
|
\(\alpha\) |
dimensionless |
Diffusion time-dependence exponent |
|
\(D_\text{offset}\) |
Ų/s |
Baseline diffusion |
|
\(\dot\gamma_0\) |
s⁻¹ |
Reference shear rate |
|
\(\beta\) |
dimensionless |
Shear rate time-dependence exponent |
|
\(\dot\gamma_\text{offset}\) |
s⁻¹ |
Baseline shear rate |
|
\(\phi_0\) |
degrees |
Angular offset (flow direction) |
See Parameter Interpretation Guide for physical interpretation, typical ranges, and default bounds.
Example YAML configuration for laminar flow mode:
data:
file_path: "shear_data.h5"
q_value: 0.054 # Å⁻¹
gap_distance: 500.0 # µm → stored as Å internally (x10⁴)
dt: 0.1 # s
analysis:
mode: "laminar_flow"
optimization:
method: "nlsq"
nlsq:
anti_degeneracy:
per_angle_mode: "auto" # CRITICAL: prevents parameter absorption
parameter_space:
D0:
initial: 1.0
bounds: [0.01, 100.0]
alpha:
initial: -0.5
bounds: [-2.0, 0.0]
D_offset:
initial: 0.01
bounds: [0.0, 10.0]
gamma_dot_0:
initial: 0.01
bounds: [1.0e-6, 10.0]
beta:
initial: -0.5
bounds: [-2.0, 0.0]
gamma_dot_t_offset:
initial: 0.001
bounds: [0.0, 1.0]
phi_0:
initial: 0.0
bounds: [-180.0, 180.0]
Generating a laminar flow template:
homodyne-config --mode laminar_flow --output config_flow.yaml
—
Choosing Between Modes¶
The choice of mode should be guided by the physics of your experiment, not by which mode gives a better fit. Here is a decision guide:
Use static mode if:
No shear cell or flow cell is present
The \(C_2\) data shows no angular dependence (all \(\phi\) give identical correlation functions)
You are characterizing equilibrium dynamics (aging, gelation, etc.)
You want a 3-parameter baseline before adding complexity
Use laminar flow mode if:
The sample is in a Couette or cone-plate shear cell
You observe a clear angular dependence: \(C_2\) varies with \(\phi\)
The decay timescale is short compared to \(1/\dot\gamma\) (shear advection is visible in the correlation)
You want to separate diffusion from advection contributions
Warning
Do not use laminar_flow mode on equilibrium data “to be safe.”
The extra parameters (\(\dot\gamma_0\), \(\beta\), etc.) can absorb
fitting degrees of freedom and produce spurious results. Use the simplest
model consistent with your physical setup.
Note
A good diagnostic: plot \(C_2\) for several azimuthal angles on the same axes. If the curves overlap, use static mode. If they diverge systematically with \(\phi\), use laminar_flow mode.
—
Per-Angle Scaling¶
For experiments with multiple azimuthal angles (\(n_\phi \geq 3\)),
homodyne supports per-angle corrections to the speckle contrast and incoherent
background. This is controlled by per_angle_mode in the configuration.
Why per-angle scaling matters:
In practice, the speckle contrast \(\beta(\phi)\) and background offset can vary with azimuthal angle due to:
Spatial variations in detector sensitivity
Angle-dependent multiple scattering
Variations in the coherent flux footprint across detector segments
Without per-angle correction, these effects are absorbed into the physical parameters, biasing \(D_0\) and \(\dot\gamma_0\).
Available modes:
Mode |
Behavior |
Extra Params |
When to Use |
|---|---|---|---|
|
When n_phi ≥ 3: estimates per-angle values, averages them, optimizes 2 averaged values alongside physical params |
+2 |
Default; always recommended |
|
Per-angle contrast/offset from quantile estimation; fixed (not optimized) |
0 |
Very fast runs; when scaling is well-known a priori |
|
Independent contrast + offset per angle; all optimized |
+2×n_phi |
When angles are truly independent (rarely needed) |
|
Angular variation modeled as truncated Fourier series (K=2) |
+10 |
Smooth angular dependence; physical smoothness constraints |
Tip
Always use per_angle_mode: "auto" unless you have a specific reason to
deviate. The auto mode prevents the most common degeneracy: contrast
or offset absorbing \(D_0\) or \(\dot\gamma_0\).
Configuration example:
optimization:
nlsq:
anti_degeneracy:
per_angle_mode: "auto" # Recommended for laminar_flow with n_phi >= 3
cmc:
per_angle_mode: "auto" # Should match NLSQ setting
—
Mode-Specific Parameter Counts¶
The total number of free parameters depends on mode and per-angle setting:
Mode |
per_angle_mode |
n_phi = 1 |
n_phi = 23 |
|---|---|---|---|
|
|
3 |
3 |
|
|
3 |
5 (3 + 2 avg) |
|
|
7 |
7 |
|
|
7 |
9 (7 + 2 avg) |
|
|
7 |
53 (7 + 46) |
—
See Also¶
Parameter Interpretation Guide — Detailed interpretation of each parameter
NLSQ Fitting Guide — Running NLSQ fits
Per-Angle Scaling Modes — Deep dive into per-angle scaling
Laminar Flow Analysis Guide — Complete laminar flow guide
YAML Configuration Reference — Full YAML configuration reference