Let the ruler follow the expansion
Write physical position as and comoving position, with length units, as . The scale factor records expansion relative to a reference epoch. For a comoving box of length , define dimensionless position . Its displayed coordinates run from zero to one.
Matter following perfectly uniform expansion keeps the same as its physical position changes. Comoving coordinates remove that shared expansion, exposing the migration relative to the average flow. A megaparsec is a length unit; the displayed box uses comoving lengths.
Reading: Springel (2005), The cosmological simulation code GADGET-2, astro-ph/0505010v1 · Original finite-mesh calculations and independent small-wave Python replay
Two contributions to velocity
Differentiating physical position gives a term from the growing ruler and a term from motion along it. Define , with a dot denoting a cosmic-time derivative. The second term is the peculiar velocity , measured relative to the average expansion.
A particle can move inward in comoving coordinates and still move physically away from the chosen origin. Inward peculiar motion must overcome outward expansion before the physical separation starts shrinking. The same distinction applies to neighbouring pieces of matter.
Reading: Springel (2005), The cosmological simulation code GADGET-2, astro-ph/0505010v1
Why the saved momentum is not a speed
The saved is dimensionless. Begin with canonical momentum per unit mass, , then divide by the fixed velocity scale . Canonical momentum is defined with the chosen coordinates and helps organise their equations of motion.
Our adopted and box length give . The star marks a model reference value. Retaining both and is enough to recover peculiar velocity at each epoch.
The extra factor of has a useful consequence. In the uniform-background limit with no peculiar gravitational force, peculiar velocity declines as , but stays constant. The variable has absorbed the expansion-dependent part of that change.
Reading: Springel (2005), The cosmological simulation code GADGET-2, astro-ph/0505010v1 · Original finite-mesh calculations and independent small-wave Python replay
Work through an inward-moving example
Consider a specified state at : and along a chosen axis. The negative sign points peculiar motion towards the origin. These are specified values for a conversion exercise.
The comoving distance is . Multiplying by gives a physical distance of . Peculiar velocity is .
In the flat matter-only Einstein–de Sitter (EdS) background adopted here, . At this epoch it is about , giving an outward expansion term near . The sum is approximately : the physical distance to the origin is shrinking.
Reading: Original finite-mesh calculations and independent small-wave Python replay
Use expansion as the clock
The model keeps expanding, so its monotonic can serve as an integration clock. Let be the physical peculiar potential, with units of speed squared, and define . The vector lists its rates of change along the three comoving directions; gravity points opposite to it.
Use to change time derivatives into derivatives with respect to in Newton’s equation. This gives the following pair. Expansion is already accounted for by the canonical momentum variable.
Reading: Springel (2005), The cosmological simulation code GADGET-2, astro-ph/0505010v1 · Original finite-mesh calculations and independent small-wave Python replay
A periodic face keeps the same particle
Opposite box faces connect. For display, subtract an integer from to put it back between zero and one. Exports retain continuous positions for following a particle across that face. Coordinates separated by an integer describe periodic copies.
Crossing the displayed boundary loses no mass and is not escape from gravity. Shell crossing, in the next chapter, instead means that different material streams overlap at one location.
Reading: Original finite-mesh calculations and independent small-wave Python replay