This set practises Chapter 4 of Ignacio Ferreras's Fundamentals of Dark Matter (UCL Press, 2025, licensed CC BY-NC 4.0): simulating galaxy formation and galaxies in halos, with spherical collapse, the virial theorem and the power spectrum from 8.902. The four problems are the book's Exercises 4.1 to 4.4, in the book's order, rewritten in our own words. The book prints no solutions to its exercises, so the hints and the solutions here are ours.
Several things differ from the book. Its four exercises are short, so each problem has one or two parts of our own, marked "(our addition)"; every answer box is ours too. Where the book leaves a number open, we choose one and say so ("our choice"). Exercise 4.2 refers to a small sketch in the book: we describe the arrangement in words instead. Exercise 4.4 refers to the author's other book for the Fourier pair of the power spectrum and the correlation function, and to a figure of measured power spectra that the book takes from the Planck collaboration; neither is used here. We state what is needed from the 8.902 lessons, and the slopes of the spectrum are the ones the exercise quotes.
How to answer#
Work each problem on paper first. Then type your result in the answer box and press Check. A number box accepts any value within the tolerance written next to it; type decimals, for example 0.25 or 1.2e5, in the unit the box names. A formula box accepts any formula equal to the right one: type it with *, /, ^ and brackets, for example a*b/c or (x + 1)^2/sqrt(x). A choice box takes one click.
The book gives no points. The points are ours: 26 for Problem 1, 24 each for Problems 2 and 3 and 26 for Problem 4, 100 points in all, and every split between parts is ours too. Parts that ask you to show something have no box: open the solution and mark yourself. If you are stuck, open the hints one at a time. Each part ends with its full solution. Try before you open it: an answer given after its solution was opened earns no points. Your score is kept in this browser only.
Constants and units: m³ kg⁻¹ s⁻² (CODATA 2018), kg (the IAU 2015 nominal solar mass parameter divided by ), 1 Mpc m.
Problem 1#
How finely can a simulation resolve forces?
A simulation follows the dark matter of a flat ΛCDM universe with and (so km/s/Mpc), both the book's values. Each synthetic particle has the mass . Close encounters are tamed by the softened (Plummer) potential, with softening length :
In words
capital phi (r; epsilon ) equals minus capital G m one over the square root of r squared plus epsilon squared, end of root
The book asks for a rough estimate of the force resolution that suits the average density of a halo, as the spherical collapse model gives it (Exercise 4.1, p. 78). For that density the book quotes (p. 71) a mean density inside a halo of times the background matter density for halos that formed at the redshifts where most galaxies formed, and for halos forming today.
(A)4 points
What is the mean matter density of this universe today? Give it in units of per Mpc³ (tolerance 2%).
Hint
The matter density is the fraction of the critical density . Convert to s⁻¹ before you start.
Solution
The idea. The critical density follows from alone; the matter is 30% of it.
The critical density
km/s/Mpc s⁻¹, so kg/m³. One Mpc³ is m³, so per Mpc³.
The matter density
per Mpc³.
Check
A handy form to remember is per Mpc³; with it gives the same . The same number appears in the worked example of the lesson dark matter halos.
(B)8 points
Take a halo that is forming today, with mean density times . On average, how far apart are neighbouring synthetic particles inside it? Use the mean spacing , where is the halo's mean density. Give in kpc (tolerance 2%).
Hint
Each particle has, on average, a volume to itself. A cube of that volume has the side .
Solution
The idea. The halo is times denser than the mean, so its particles are times closer together than on average.
The halo density
In words
rho h equals capital delta rho m bar (z) equals capital delta rho m nought bar the quantity 1 plus z, all cubed
Today (): per Mpc³.
The spacing
In words
d equals ( m one over rho h ) to the power one third
Mpc Mpc Mpc kpc.
Check
The mean spacing in the whole universe is Mpc kpc, and kpc. A halo of , like the Milky Way's, holds particles at this mass resolution, and its radius at this density is kpc: its radius is about 29 spacings.
(C)5 points
Which softening length suits this mass resolution and this halo density?
Solution
The idea. A synthetic particle stands for an enormous number of real dark matter particles, which do not scatter off each other. Any force that the simulation computes on scales below the particle spacing comes from the graininess of the model, not from the real dark matter.
Why not far smaller
Inside a halo, a particle has neighbours about kpc away. Below that distance the force on it is dominated by its nearest neighbour, and close passages between two synthetic particles would kick them around: two-body relaxation that the real, collisionless dark matter does not have. The softening is there to switch this off, so must not be many orders of magnitude below . A parsec-sized would only make the time steps tiny and the noise worse.
Why not much larger
The force must still follow the structure of the halo, which is resolved by the particles down to scales of order . With of tens of kpc (or the box-average spacing, 62.6 kpc), a Milky-Way halo of radius 261 kpc would be blurred over a large fraction of its radius, and smaller halos would be smeared out altogether.
The estimate
So is a fraction of : of order 1 to 3 kpc, a few to ten times below kpc, for . It sits below the spacing of a typical halo because halos are denser in their centres, where the spacing is smaller, and halos that formed early are denser still (part D). The best force resolution quoted in the book, about 100 pc (p. 78), needs smaller particle masses or zoom-in runs: .
(D)5 points
(Our addition.) A halo that virialised at (our choice), with the book's times the background density at that redshift, keeps its density afterwards. What is the mean particle spacing inside it, as a physical distance? Give in kpc (tolerance 2%).
Hint
The background matter density was higher at . By what factor?
Solution
The idea. The background was times denser at , which more than makes up for the smaller .
The density
per Mpc³: 14.6 times the density of the halo of part B.
The spacing
Mpc Mpc kpc.
Check
The ratio to part B is , and kpc. Halos that formed early, which host most galaxies, are the densest, and they set how small must be. (The spacing in comoving units would be 3 times larger; the softening of a simulation is usually fixed in comoving units at early times and in physical units later on.)
(E)4 points
(Our addition.) The lesson's example is a box 100 Mpc on a side (comoving). How many particles of mass are needed to fill it at the mean matter density? Give the number of particles along one side of the cube, (tolerance 1%).
Hint
The total mass in the box is times its comoving volume.
Solution
The idea. Mass in the box divided by mass per particle.
The count
, so : a run with about particles.
Check
kpc Mpc: the number along a side times the mean spacing is the side of the box. With direct summation such a run would need pair forces per time step, which is why the tree codes of the next problem are used.
Problem 2#
How wrong is the monopole approximation?
A tree code replaces the pull of a distant group of particles by that of a single particle with the group's total mass at the group's centre of mass: the monopole approximation, the lowest term of a multipole expansion. The book asks for its error in a simple arrangement, which we describe in words (the book shows it in a sketch). Four particles, each of mass , sit at the corners of a square whose diagonals lie along the and axes: two at and two at , with . Their centre of mass is the point . A test particle of mass sits at the origin, a distance below the centre of the square. (The book calls the half-diagonal ; we write , because Problem 1 uses for the density contrast. All four particles lie in one plane, but the forces are those of ordinary three-dimensional gravity, which falls off as the inverse square of the distance.)
In the monopole approximation the test particle feels the pull of a mass at the distance :
In words
capital F mono equals 4 capital G m m t over y squared
(A)8 points
Find the exact force on the test particle, in units of : that is, find as a function of and . (By symmetry the total force points along .)
Hint
The two particles on the axis are at the distances and , and pull straight along .
Hint
Each of the two side particles is at the distance . Only part of its pull is along : which fraction?
Solution
The idea. Add the four pulls as vectors. The -components cancel in pairs; the -components add.
The particles on the axis
They are at the distances and , straight above the test particle: along .
The side particles
Each is at the distance , and its pull makes an angle with the axis whose cosine is . Together they give along .
The total
In words
capital F exact over the quantity capital G m m t, equals 1 over the quantity y minus s, all squared plus 1 over the quantity y plus s, all squared plus 2 y over the quantity the quantity y squared plus s squared, all to the power three halves
Check
For the four terms become each, : the monopole force, as it must be when the four particles merge. The units are those of , as for .
(B)7 points
For a distant group, , expand the relative error in powers of . Show that there is no term linear in , and find the coefficient of the leading term:
In words
the quantity capital F exact minus capital F mono, all over capital F mono is approximately capital C ( s over y ) squared
Give (tolerance 1%).
Hint
Write each term with and expand: and to second order in .
Solution
The idea. Factor out and use the binomial series.
The expansions
With : plus terms in and higher, since the odd terms cancel. And , again plus terms in and higher. So
In words
capital F exact over the quantity capital G m m t, equals 1 over y squared, times the quantity 4 plus 3 ( s over y ) squared plus and so on
and the relative error is : .
Why there is no linear term
A term linear in would be the dipole term. A dipole moment measured from the centre of mass is zero by the definition of the centre of mass, for any group of particles. Expanding about the centre of mass is what makes the monopole approximation good to second order: the leading error is the quadrupole term.
Check
The sign makes sense: on the axis, the near particle's pull grows by and the far one's changes by , so the axis pair pulls harder than by ; the side pair, farther away and pulling at an angle, pulls less than by . The net is : the monopole slightly underestimates the force here.
(C)5 points
How large is the exact relative error, , when the group is at (our choice)? Give it in percent (tolerance 1%).
Hint
Use the exact force of part A with and , not the expansion.
Solution
The idea. Put the numbers into the exact force.
The terms
With , : , , . The sum is , while .
The error
: 3.57%.
Check
The leading term of part B gives , or 3.0%: close, and a little lower, because the next term, of order , is positive here. At the group spans an angle of about radian (23°) as seen from the test particle, and the monopole is already wrong by a few percent.
(D)4 points
(Our addition.) A tree code "opens" a group, summing its particles one by one, when the monopole would be too inaccurate. Here, for which smallest is the exact relative error 1%? Give (tolerance 1%).
Hint
The leading term of part B gives a first guess. The error of part C shows which way the exact answer lies from it; then solve with the exact force, for example by trying values.
Solution
The idea. Start from the expansion, then refine with the exact force.
First guess
gives .
Refine
At the exact error is 1.06%, a little too large, so the group must be farther away. Solving numerically gives (at the exact error is 1.00%).
Check
The group then spans about radian (13°). Tree codes use exactly this kind of rule: a cell is accepted as one particle when its size divided by its distance is below an opening angle of a few tenths of a radian, and the error falls as the square of that angle when the expansion is about the centre of mass.
Problem 3#
Puffing up a galaxy by blowing out its gas
One way to make a galaxy larger is to throw out a large part of its gas, for example by the energy of an active nucleus (AGN): "puffing up". Model the galaxy as a self-gravitating system of mass and size in virial equilibrium, which loses gas until its mass is , and then settles into a new equilibrium of size . Write . Simple arguments (the book's words) are enough: take the potential energy as , where the constant depends only on the shape of the mass distribution, and assume that the shape stays the same, so that the gas is lost evenly from the whole galaxy.
(A)6 points
Show that if the gas is lost much faster than a dynamical time (the time a star takes to cross the galaxy), then . What happens if ?
Hint
Just after a sudden loss, the remaining stars are still where they were and still move as fast as before. What are their kinetic and potential energies then?
Hint
The new equilibrium has the same total energy as the system just after the loss, and obeys the virial theorem , so its energy is .
Solution
The idea. A sudden loss keeps the positions and velocities, but removes mass: the remaining system has the old kinetic energy per unit mass in a shallower potential, so it is less bound and expands.
Before
By the virial theorem, , the kinetic energy per unit mass is .
Just after the loss
The mass remains, with the same kinetic energy per unit mass and the same size: and . Its energy is
In words
E equals capital K prime plus W prime equals c capital G capital M sub f over capital R sub i, times the quantity capital M sub i over 2 minus capital M sub f
The new equilibrium
After it has settled, , with the same . Dividing both sides by :
In words
minus 1 over the quantity 2 capital R sub f, equals 1 over capital R sub i, times the quantity alpha over 2 minus 1, which gives capital R sub i over capital R sub f equals 2 minus alpha
Check
With no loss, , the size stays the same. If , that is if half the mass or more is lost at once, : the remaining system is no longer bound and flies apart. Losing a third of the mass () already doubles the size.
(B)5 points
Show that if the gas is lost slowly, over many dynamical times, then . Which kind of loss puffs a galaxy up more?
Hint
When the potential changes slowly, the orbits change slowly too, and some quantities of each orbit stay constant (adiabatic invariants). For a star on a circular orbit, which conserved quantity can you use?
Solution
The idea. In a slow change each orbit adjusts gradually, keeping its adiabatic invariants. For a circular orbit, the angular momentum per unit mass is conserved, since the force stays central (true for a loss at any rate; what slowness adds is that each orbit stays circular, so still holds at the end).
Circular orbits
On a circular orbit of radius around a mass , , so . Constant means constant for every star, and so for the galaxy as a whole:
In words
capital M sub i capital R sub i equals capital M sub f capital R sub f which gives capital R sub i over capital R sub f equals capital M sub f over capital M sub i equals 1 over alpha
Comparing the two
For , , because . So the sudden loss always puffs the galaxy up more. For a small loss, , the fast case gives and the slow case also : they differ only at second order. For large losses they differ greatly: the slow case gives a finite size for any , the fast case unbinds the galaxy at .
Check
A slow loss can never unbind the galaxy: every star stays on a (wider) bound orbit. The two cases bracket what real outflows do, which last for a time that may be similar to the dynamical time.
(C)5 points
(Our addition.) Let be the fraction of the mass that is lost. For a sudden loss, find as a function of .
Hint
Write in terms of first, then use part A.
Solution
The idea. .
Substitute
, so
In words
capital R sub f over capital R sub i equals the quantity 1 minus f, all over the quantity 1 minus 2 f
Check
For the size is unchanged; as the size grows without limit, the unbinding of part A. For small , , the same as the slow case to first order.
(D)8 points
(Our addition.) Now let dark matter in. Inside the galaxy's radius, dark matter makes up 60% of the mass and stars and gas 40% (our choice). The AGN blows out half of these baryons; the dark matter stays. Treat stars, gas and dark matter as one system as above (a rough model: in reality the halo responds on its own time scale). Find for a sudden loss and for a slow loss (tolerance 1% each).
Hint
What fraction of the total mass is lost?
Solution
The idea. The dark matter adds to the mass that holds the galaxy together but is not blown out, so the same outflow is a smaller fraction of the total.
The fraction lost
Half of 40%: , so .
The sizes
Sudden: . Slow: .
The role of dark matter
Without the dark matter, losing half the baryons is , : a sudden loss would unbind what is left, and even a slow one would double the size. With the dark matter, the galaxy grows by only a third, or a quarter. The dark matter dominates the potential and anchors the galaxy, so puffing-up works best where baryons dominate the mass, as in the centres of compact galaxies, for which it has been proposed as one way to grow in size.
Problem 4#
Galaxy bias and the slope of the correlation function
The density contrast of a component is , and the book defines the bias of galaxies through it, as the ratio of the galaxies' density contrast to that of the dark matter:
In words
b(r) is defined as delta sub g (r) over the quantity delta sub D M (r)
The two-point correlation function of a component is the average over all positions (the power spectrum). The power spectrum and are a Fourier pair: for an isotropic field, with the convention of that lesson,
In words
xi (r) equals 1 over the quantity 2 pi squared, times the integral from 0 to infinity of P(k) sine k r over the quantity k r, times k squared d k
Galaxies are observed to have a power-law correlation function:
In words
xi (r) equals ( r over r nought ) to the power minus gamma
(A)4 points
Show that the definition of through the density contrast gives the relation between bias and the correlation functions that the book uses (eq. 4.15, p. 97): . What must you assume about ?
Hint
Put into the average that defines .
Solution
The idea. The correlation function is quadratic in , so a factor in becomes in .
The step
If with the same at and at , then
In words
xi sub g (r) equals the average of b delta sub D M ( vector x ) b delta sub D M the quantity vector x plus vector r, equals b squared xi sub D M (r) which gives b equals ( xi sub g over xi sub D M ) to the power one half
The assumption
must be a constant (or vary only slowly with scale), the same everywhere, so that it can be taken out of the average. This "linear, deterministic" bias holds well on large scales; on small scales, inside halos (the 1-halo term), it fails, and then depends on . The positive square root is taken because galaxies sit where the dark matter is dense: has the sign of .
(B)6 points
Let the power spectrum be a power law, . Find the slope of the correlation function, , in terms of .
Hint
In the integral, change the variable to . Which power of comes out in front?
Solution
The idea. A power law has no scale of its own, so the only length is , and the integral gives a power of times a pure number.
Change of variable
With and , and :
In words
xi (r) equals A over the quantity 2 pi squared, times r to the power minus the quantity n plus 3, end of power, the integral from 0 to infinity of u to the power n plus 1, end of power, sine u d u is proportional to r to the power minus the quantity n plus 3, end of power
so .
When it holds
The integral converges only for (at small it behaves like , at large it oscillates with the amplitude , which must fall). For , for instance, it is , and . Outside that range the pure power law is not a consistent spectrum on all scales, and the shape of depends on where the spectrum bends.
Check
The dimensions agree: in three dimensions is dimensionless (it is the variance per logarithmic interval of ), so scales like .
(C)5 points
Which slope of the power spectrum corresponds to the observed ? Give (tolerance 1%).
Solution
The idea. Invert part B.
Invert
.
Check
lies in the range where the relation of part B holds, so the inversion is consistent.
(D)5 points
(Our addition.) A sample of red galaxies has the correlation length Mpc, while the dark matter, on the same scales, follows a power law with the same and Mpc (our numbers). What is the bias of these galaxies (tolerance 1%)?
Hint
With the same slope, the ratio is the same at every . Write it with the two correlation lengths.
Solution
The idea. The ratio of two power laws with the same slope is a constant.
The ratio
, the same at every .
The bias
.
Check
The galaxies are more clustered than the dark matter ( larger), so , as expected for red galaxies, which formed in the rarer, higher peaks of the density field. Without the square root one would get 1.494, which is .
(E)6 points
The book quotes that the measured dark-matter power spectrum has on very large scales and turns over to on smaller scales. How do those slopes compare with the galaxies' , measured on scales of a few Mpc?
Solution
The idea. Each slope of the spectrum maps onto a slope of on the matching scales, ; the observed slope tells us where on the spectrum galaxy clustering sits.
The two limits
With : the small-scale slope gives , flatter than observed. The large-scale slope would formally give , but it lies outside the range where part B holds: on the largest scales is not a power law at all (it becomes small and even changes sign). Neither limit gives 1.8.
The reading
The observed corresponds to an effective slope (part C), between the two limits. The peak of the spectrum, where it turns over, lies near the horizon scale at matter–radiation equality (the power spectrum lesson), wavelengths of hundreds of Mpc, far above the few Mpc probed here. On few-Mpc scales the cold dark matter spectrum is past its peak but still curving slowly towards , and nonlinear growth makes it shallower still, so its effective slope there is intermediate. A pure power-law fit on these scales is an approximation. The match is not exact for two more reasons: on scales below 1 to 2 Mpc the clustering of galaxies is set by galaxies within one halo, not by the linear spectrum, and on all scales galaxies are biased tracers whose bias may change with scale. These are the effects that halo occupation models are built to describe.