Forward and inverse modes#
Forward simulation and inverse emulation share the spheroidal cell state in Cells as spheroidal agents and provide purpose-built dynamics. Coordinates, radii, timesteps, and coefficients are model-scale values. External calibration maps them to SI or biological scales when an application requires that interpretation.
Forward mode: prescribed case study#
waxmorph.simulator implements a polarized epithelial-mesenchymal
aggregate with type-dependent mechanics, activator-inhibitor chemistry, growth,
and division. The case study defines a prescribed model; application-specific
calibration connects it to a biological system.
With \(a=A/(V+\epsilon)\), \(i=I/(V+\epsilon)\), and contact fluxes \(\ell_A=\sum_j(a_j-a_i)\) and \(\ell_I=\sum_j(i_j-i_i)\), one chemistry step is
Optional cell-type masking selects the cells that receive reaction and damping. The remaining cells follow an explicit diffusion path, and every output stays within the clamp bounds. The reacting-cell update includes the production cap and semi-implicit damping.
Physical radii below their targets grow monotonically up to those targets;
radii at or above target remain unchanged. Mesenchymal equilibrium radii are capped
at R_max. Epithelial equilibrium radii copy through while physical radii
approach R_ref. Division uses bounded atomic slot reservation, so the active
count remains within preallocated capacity. Both daughters split chemical
abundance; mesenchymal daughters rescale radius for half volume, while
epithelial daughters retain the parent radius.
Inverse mode: learned emulator with a fixed agent count#
The emulator infers a local rollout rule from source and target point clouds.
It combines GNS updates with its own sticky-sphere mechanics and graph diffusion
for a fixed particle population. The top-level API uses PyTorch;
waxmorph.jax provides a counterpart with backend-specific graph tuples,
loss families, PRNG, checkpoint, and runtime contracts.
Each model-evaluation step:
Builds a learned contact graph from the current state.
Predicts local position, polarity, and concentration increments with the GNS.
Applies the learned increments.
Applies configured differentiable mechanics and diffusion corrections.
Accumulates shape loss at selected target frames.