Skip to main content
Sandbox Physics
From ripples to the cosmic web

From ripples to the cosmic web · L2

Measuring Motion with an Expanding Ruler

Putting the average expansion into the coordinate ruler lets us calculate motion relative to that ruler. A box can keep its displayed size as the physical distance it represents grows. Deciding whether matter approaches requires both changes.

Let the ruler follow the expansion

Write physical position as r\boldsymbol r and comoving position, with length units, as x\boldsymbol x. The scale factor aa records expansion relative to a reference epoch. For a comoving box of length L=20 MpcL=20\,\mathrm{Mpc}, define dimensionless position y=x/L\boldsymbol y=\boldsymbol x/L. Its displayed coordinates run from zero to one.

Matter following perfectly uniform expansion keeps the same y\boldsymbol y 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.

x=Ly,r=aLy\boldsymbol x=L\boldsymbol y,\qquad\boldsymbol r=aL\boldsymbol y
Doubling the scale factor doubles the physical separation represented by a fixed comoving interval. The reference epoch fixes this teaching model’s units independently of a fit to today’s universe.

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 H=a˙/aH=\dot a/a, with a dot denoting a cosmic-time derivative. The second term is the peculiar velocity vpec\boldsymbol v_{\rm pec}, 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.

r˙=Hr+vpec,vpec=aLy˙\dot{\boldsymbol r}=H\boldsymbol r+\boldsymbol v_{\rm pec},\qquad\boldsymbol v_{\rm pec}=aL\dot{\boldsymbol y}
The origin follows the average expansion. These velocities are defined relative to it in a Newtonian box much smaller than the Hubble scale.

Reading: Springel (2005), The cosmological simulation code GADGET-2, astro-ph/0505010v1

Why the saved momentum is not a speed

The saved u\boldsymbol u is dimensionless. Begin with canonical momentum per unit mass, p=a2x˙=avpec\boldsymbol p=a^2\dot{\boldsymbol x}=a\boldsymbol v_{\rm pec}, then divide by the fixed velocity scale H⋆LH_\star L. Canonical momentum is defined with the chosen coordinates and helps organise their equations of motion.

Our adopted H⋆=70 km s−1 Mpc−1H_\star=70\,\mathrm{km}\,\mathrm{s}^{-1}\,\mathrm{Mpc}^{-1} and box length give H⋆L=1400 km s−1H_\star L=1400\,\mathrm{km}\,\mathrm{s}^{-1}. The star marks a model reference value. Retaining both aa and u\boldsymbol u is enough to recover peculiar velocity at each epoch.

The extra factor of aa has a useful consequence. In the uniform-background limit with no peculiar gravitational force, peculiar velocity declines as 1/a1/a, but u\boldsymbol u stays constant. The variable has absorbed the expansion-dependent part of that change.

u=avpecH⋆L,vpec=H⋆Lau\boldsymbol u=\frac{a\boldsymbol v_{\rm pec}}{H_\star L},\qquad\boldsymbol v_{\rm pec}=\frac{H_\star L}{a}\boldsymbol u
Multiplying the stored momentum by the velocity scale is insufficient: divide by the current scale factor too. Momentum per unit mass is also distinct from the momentum obtained after multiplying by the particle mass.

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 a=0.5a=0.5: yx=0.25y_x=0.25 and ux=−0.2u_x=-0.2 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 20×0.25=5 Mpc20\times0.25=5\,\mathrm{Mpc}. Multiplying by 0.50.5 gives a physical distance of 2.5 Mpc2.5\,\mathrm{Mpc}. Peculiar velocity is 1400×(−0.2)/0.5=−560 km s−11400\times(-0.2)/0.5=-560\,\mathrm{km}\,\mathrm{s}^{-1}.

In the flat matter-only Einstein–de Sitter (EdS) background adopted here, H(a)=H⋆a−3/2H(a)=H_\star a^{-3/2}. At this epoch it is about 198 km s−1 Mpc−1198\,\mathrm{km}\,\mathrm{s}^{-1}\,\mathrm{Mpc}^{-1}, giving an outward expansion term near 495 km s−1495\,\mathrm{km}\,\mathrm{s}^{-1}. The sum is approximately −65 km s−1-65\,\mathrm{km}\,\mathrm{s}^{-1}: the physical distance to the origin is shrinking.

r˙x≃(198)(2.5)−560=−65km s−1\dot r_x\simeq(198)(2.5)-560=-65\quad\mathrm{km}\,\mathrm{s}^{-1}
The first term uses physical distance times the Hubble rate. The second is peculiar velocity. Their sum determines whether physical separation grows or shrinks.

Reading: Original finite-mesh calculations and independent small-wave Python replay

Use expansion as the clock

The model keeps expanding, so its monotonic aa can serve as an integration clock. Let ϕ\phi be the physical peculiar potential, with units of speed squared, and define U=aϕ/(H⋆2L2)U=a\phi/(H_\star^2L^2). The vector ∇yU\nabla_yU lists its rates of change along the three comoving directions; gravity points opposite to it.

Use a˙=aH=H⋆a−1/2\dot a=aH=H_\star a^{-1/2} to change time derivatives into derivatives with respect to aa in Newton’s equation. This gives the following pair. Expansion is already accounted for by the canonical momentum variable.

dyda=a−3/2u,duda=a−1/2(−∇yU)\frac{d\boldsymbol y}{da}=a^{-3/2}\boldsymbol u,\qquad\frac{d\boldsymbol u}{da}=a^{-1/2}(-\nabla_yU)
These equations accompany an updated gravitational potential at every step. They assume the matter-only background, subhorizon Newtonian dynamics and collisionless particles.

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 yxy_x 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

Exercises and explained answers

  1. If y\boldsymbol y stays fixed and aa doubles, what happens to physical separation and peculiar velocity?

    Read the explanation

    Physical separation r=aLy\boldsymbol r=aL\boldsymbol y doubles. Peculiar velocity is zero because y˙=0\dot{\boldsymbol y}=0. All the changing physical separation comes from the average expansion.

  2. With no peculiar gravitational force, u\boldsymbol u is constant. What happens to peculiar velocity between a=0.5a=0.5 and a=1a=1?

    Read the explanation

    It halves, since vpec=H⋆Lu/a\boldsymbol v_{\rm pec}=H_\star L\boldsymbol u/a. Canonical momentum remains constant as peculiar speed declines.

  3. Would the worked particle still physically approach the origin if ux=−0.1u_x=-0.1?

    Read the explanation

    Its peculiar velocity becomes −280 km s−1-280\,\mathrm{km}\,\mathrm{s}^{-1}. Adding expansion near 495 km s−1495\,\mathrm{km}\,\mathrm{s}^{-1} gives outward motion near 215 km s−1215\,\mathrm{km}\,\mathrm{s}^{-1}, slower than pure expansion but still separating.

Try the prediction

Convert an exported state into physical quantities

  1. Select an expansion factor near 0.50.5, export the state and read its exact aa rather than treating the slider approximation as exact.
  2. Choose one particle and convert its position and momentum with r=aLy\boldsymbol r=aL\boldsymbol y and vpec=1400u/a\boldsymbol v_{\rm pec}=1400\boldsymbol u/a, obtaining megaparsecs and kilometres per second.
  3. Inspect a particle near a periodic face and explain why its continuous and displayed positions can differ by one box length.

Sources and calculation scope

  1. Springel (2005), The cosmological simulation code GADGET-2, astro-ph/0505010v1

    Focused reading: Section 2.1, equations 1–3; Section 3.2/3.2.1, equations 20–23; Section 4.1, equations 26–31, with original pages 3 and 11 viewed. Supplies cosmological momentum, PM windows and time-integration context. The teaching calculation specifies its own cutoff and finite gradient and adds no short-range tree force.

  2. Original finite-mesh calculations and independent small-wave Python replay

    Original accepted kernel/linear, nonlinear and five-preset F64 calculations support the teaching figures and calibration. This small public ZIP contains only an exact current-state small-wave fixture, an independent NumPy/SciPy trajectory replay and expected output. The fixture was generated through the frozen model and canonical serializer in Node, not downloaded in a browser. Large raw preset archives remain separately retained; no Engine or source paper is included.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy