N-Body ICs
From Eric's Wiki
Contents |
N-Body Codes
- Simulate the evolution of matter subject to gravitational forces only
- Move lots of little bits of matter (particles) around
Initial Conditions
- The initial distribution of particle positions
- Laid out to emulate a density distribution, ρ(x)
- Good for a given time (redshift, zinit) at which the simulation is to start
- A series of delta functions trying to emulate a continuous function.
Zel'dovich Approximation
- Generates cosmological ICs from a given density distribution
- Uses the simplification that growth is linear for small perturbations
- Displaces uniformly distributed particles (zinit = ∞) and gives them a velocity
- The velocity is proportional to the displacement.
Expectations
In an Ideal World
- zinit can be very very large
- N-body code will evolve particle positions accurately and quickly
In an Almost Ideal World
- N-body code takes time
- Zel'dovich approximation saves us time by doing the evolving the particles through the linear growth phase
In the World I Thought I Lived In
- Bad things happen if Zel'dovich approximation is pushed too far: end up in non-linear growth regime using linear growth
- Bad things happen if Zel'dovich approximation is not pushed far enough: numerical precision cannot resolve displacements
- There's exists a happy sweet spot in the middle
The World I Find Myself
- There is no happy place
The problem
Enzo
First there was a problem with generating ICs for Enzo. I needed at 10Mpc volume and had a couple of prescriptions as to what zinit should be. Unfortunately the results at z=12 (when I wanted to turn my radiation source on) weren't even close.
A simple test
Push the initial conditions generator to the limits to find the sweet spot.
Expectation
- At low zinit, Zel'dovich pancakes will be forming (shell crossing)
- At high zinit, numerical errors will eliminate small-scale structure.
- In the middle will be a swath of zinit's that produce the same final distribution: The sweet spot
PM
I suspected my zinit prescriptions were wrong. So I tried a test with Martin White's PM code: Evolve to the redshift of z=10 from initial conditions generated at zinit = 10, 20, 50, 100, 200, 500.
With every increment in zinit:
- there is an increase in the amount of small-scale substructure
- large-scale structure is increasingly distorted.
Note, a further test showed the results to be independent of precision: double compared with single.
Hydra
Not knowing if the problem was with PM, I tried the tests with hydra (Couchman, Thomas, & Pearce).
- Again too much small-scale structure.
- Regular small-scale clumping.
- Large-scale structure fine.
The two overdensity figures chart the:
- Maximum overdensity in the ICs as a function of the zinit
- Maximum overdensity in the final evolved z=10 state, as a function of the zinit of the IC.
The IC overdensity figure show that the ZA is pushed into the non-linear regime by zinit < 100.
The final overdensity figure illustrates the growth of small-scale structure for zinit > 10000.
The results of the overdensity figures might lead one to think that 100 < zinit < 10000 is a valid range. But the actual particle distribution would seem to still suffer enhanced small-scale structure (on a disturbingly regular grid) all the way down to zinit < 100.
25 Mpc volume
After discussions with Frazer Pearce and Chris Power, we agreed to try the simulations with the common parameters:
- 25Mpc volume
- σ8 = 0.9
- Powerlaw spectrum with n=-1
We couldn't seem to agree on the number of particles, but there you go. All my results are with 1283.
At a first, and second glance, there doesn't seem to be any problem with hydra running these conditions, with good agreement for 50 < zinit < 20000, and only a hint of the enhanced growth of small-scale structure from zinit > 20000.
10 Mpc volume revisited
Confused by why hydra magically seemed to work after just talking to Frazer (he must have a magic touch), I returned to the 10 Mpc volume which originally led me to believe there was a problem. But this time I used exactly the same IC parameter file as used in the 25 Mpc tests, varying only the volume size.
First thing to note was that the runs were unable to evolve to z=10 in a reasonable time (5 hours), so I looked only at the z=20 dumps.
Again: No apparent problem. Clearly for too low zinit the ZA has gone well beyond its limits. But for 100 < zinit < 50000 the results are quite reasonable.
That we couldn't evolve to z=10 gives us a hint: the power normalisation is much larger.
10 Mpc volume, low σ8
So let's lower the power. In the following, σ8=0.09.
Back to the problems, but not quite as seriously so. Visually, the happy zone is 50 < zinit < 200, not particularly wide.
Note that the power, as illustrated in the IC max overdensity figure, is still not as low as in the original 10 Mpc run. In the original, the power spectrum used was createcosmo's "CDM". Apparently it has very low power. and it is at low power that the happy zone is pinched between the non-linear regime and a the domain where hydra creates artificial forces that lead to clumping on a regular grid.
The max IC overdensity figure shows the ICs aren't safely in the linear regime until zinit > 200, by which point small-scale structure is starting to be enhanced. So the happy zone is limited to zinit ≃ 200. Any lower the power normalisation, and the zone would be pinched out of existence, as has happened for the CDM 10 Mpc volume tested originally.
Of course, my description of the "pinching" makes no sense, since power can always be boosted by moving to lower zinit.
Gadget
Volker Springel's Gadget produces some interesting results.
For the generation of the IC's, I used createcosmo, which is the IC generator for hydra, and N-GenIC, made available by Volker via the DEISA Benchmark Suite.
Let's concentrate on N-GenIC, since there were interesting problems with createcosmo's ICs.
The input parameters to N-GenIC are not quite exactly the fiducial: h=0.65 instead of 0.7, and the input spectrum is Eisenstein & Hu, since powerlaw is not an option to N-GenIC.
Quite differently from hydra, there is an increasing lack of growth of power at all scales as zinit is increased. The power in the ICs is low to begin with. However, if we consider that ICs for zinit < 100 are too far into the non-linear regime, then we do see a small increase in growth of power as zinit increases, but there is a sweet spot between 200 < zinit < 500. Is the gradual decline in the final power for 500 < zinit < 20000 an error due to the ZA being pushed further into the linear regime, or is it an indication that other errors are being overcome as the ZA is allowed to evolve into it's regime of validity?
I don't understand why IC's with ZA pushed to too low zinit produce less substructure in Gadget but more in hydra. Could it be simply a function of the form of the initial power spectrum? We aren't comparing apples and oranges: a power-law vs Eisenstein & Hu.
Gadget with createcosmo
Gadget was run on a 10 Mpc volume with IC's generated using createcosmo, the tool used to generate IC files for hydra. The IC's weren't quite fiducial, instead matching the N-GenIC parameters (notably, h=0.65 instead of 0.7). The spectrum was </tt>createcosmos</tt> "CDM", which, similarly to N-GenIC's spectrum, has much less power than a power-law with n=0.9.
The results are comparable to the N-GenIC runs, with decreased structure growth from larger zinit, but growing amounts of structure growth as zinit gets very large. The apparent "sweet spot" is in the range 100 < zinit < 104 .
But again, why is there less structure as zinit increases compared with the hydra results?
For comparison, this is what hydra does with the same IC's (though without the velocities scaled by 100-1.
From where did this velocity scaling come? I compared the velocity distributions of the ICs generated by N-GenIC with those produced by createcosmos. They differed by a factor of approximately 100 times. For example, at zinit = 20000:
| method | mean(v) | σ(v) | max(v) (all km s-1) |
|---|---|---|---|
| createcosmos | 1.0x104 | 1.21x104 | 4x104 |
| N-GenIC | 100 | 110 | 400 |
Note that the spectra are not the same, so it is not obvious that these are comparable numbers.
Ack! Gadget scales it's internal velocities by &sqrt;a. That wasn't included in createcosmo. Here are the results of the patched version of createcosmo:

