5th May 2025
IIT Kharagpur, Kharagpur
N Body Simulation In
Cosmology
Final Defense
Advisor Student
Prof. Somnath Bharadwaj Mr. Aurobinda Majhi
5th May 2025
I Flowchart For a Nbody simulation
• We Use Poisson equation to transform the
density to potential
2
∇ 𝜙= 𝛿
This equation assumes instantaneous property of
gravity.
Modify the poisson equation,
2
𝜕 𝜙 𝜕𝜙 2
+ 2𝜅 − 𝑐𝑔 ∇ 𝜙 = −𝑐𝑔 𝛿
𝜕𝑡 2 𝜕𝑡
2
2
5th May 2025
I N body program
There is no publicly available Program to simulate structures using Telegraph Equations.
AIM: To create a Program to simulate the structure for Poisson equation and to extend it
to support Telegraph equation.
Before simulating the program with the Telegraph equation i need to verify the rest of the
program with existing result for a Λ𝐶𝐷𝑀 Model.
Parameters of the simulation:
• Ω𝑚 = 0.315 • Ω𝑏 = 0.0493 • 𝑛𝑠 = 0.965
• Ω𝑘 = 0 • Ω𝑟 = 9.24𝑒 − 5 • 𝜎8 = 0.811
• ΩΛ = 0.685 • ℎ = 0.674
2
3
5th May 2025
I Power Spectrum Validation
Power spectrum calculation uses a semi-
analytic approach based on the linear theory.
𝑛𝑠 2
𝑃 𝑘 = 𝐴𝑘 𝑇 𝑘
P(k)
Where,
• A is the Amplitude Factor
• 𝑛𝑠 is called spectral index
• T(k) is called Transfer function
k
I have used the BBKS + Sugiyama correction Transfer function T(K).
2
4
5th May 2025
II Mass assign schemes
Two different mass assign schemes :
NGP and CIC
Window function in Fourier space:
𝑘
𝑊𝑁𝐺𝑃 = 𝑠𝑖𝑛𝑐( )
2
𝑘
𝑊𝐶𝐼𝐶 = 𝑠𝑖𝑛𝑐 2
2
CIC follows the theoretical curve closely while NGP doesn’t Because of Aliasing effect.
Δ 𝑘 = Δ 𝑇𝑟𝑢𝑒 𝑘 𝑊(𝑘)
2
5
5th May 2025
II Force accuracy Test
At Low distance the Force deviates a lot from
the ewald’s summation.
ln(𝐹𝑟 )
From this we see that NGP Fluctuates a lot.
All the mass assignment schemes gives correct
Result accurately above 1.5 unit grid cell.
ln(r) in grid units
Since TSC is more computationally expensive we use CIC method for mass asignment
2
6
5th May 2025
II Energy Conservation Test
Layzer-Irvine equation
𝑑 𝑎4 𝑇 𝑑𝑈
+𝑎 =0
𝑑𝑡 𝑑𝑡
Integrating it we get two equations,
𝑎4 𝑇 + 𝑎𝑈 − ∫ 𝑈𝑑𝑎 = 𝐶 From the figure energy decrease rapidly, its because of PM
method is not a good energy conservation method
3 2
𝑎 𝑇 + 𝑈 − ∫ 𝑎 𝑇𝑑𝑎 = 𝐶′ 2
7
5th May 2025
III Perturbation of particles from intial position
• Perturbation from grid points given by equation
𝐴 𝑘
𝑥 =𝑞+ cos(2𝜋𝑘. 𝑞
Ԧ + 𝜙𝑘 )
2𝜋 𝑘 2
Scale factor a = 0.5
Structure shows strong clustering at large
separation. Scale factor a = 1 2
8
5th May 2025
IV Two point Correlation function comparison
From existing simulation From my simulation
Two point Correlation function gives the excess probability of findiding two objects separated by a
distance r, compared to the random distribution.
𝐷𝐷 𝑟 − 2𝐷𝑅 𝑟 + 𝑅𝑅(𝑟)
dP = 𝑛ത 1 + 𝜁 𝑟 𝑑𝑉1 𝑑𝑉2 𝜁 𝑟 =
𝑅𝑅(𝑟)
29
Slow decaying 𝜁 𝑟 ⇒ Long range Power in P(k) ⇒ strong clustering at large separation.
5th May 2025
IV Static density test for Telegraph equation
Generate a gaussian density of unit variance given by the equation-
𝑥 − 𝑥0
𝛿 = 𝛿0 exp(− 2
)
2𝜎
Exact potential for this solution is given by,
𝜌 2𝜋 1.5 𝜎 3 − 𝑥 − 𝑥0
𝜙=− erf( )
𝑥 − 𝑥0 2𝜎
compare the potential due to telegraph equation potential with the exact potential.
The result gives,
Errors Compared with Exact potential
L2 2.128
MAX 0.893
Time taken(in seconds for 100 iterations) 0.0034 2
10
5th May 2025
V Topological Data analysis
Traditional power spectrum method to distinguish Structure formation fails to distinguish
between Two structure if they have same P(K).
So we Apply Toplogical data anlaysis to find the structure. We focus mainly on homology.
Homology captures numbers of voids, filaments and clusters given by betti numbers
𝛽0 , 𝛽1 𝑎𝑛𝑑 𝛽2 Respectively.
We apply Persistent Homology on the density contrast to see how the structures appear
and disappear as we change the threshold i.e. how structure evolve with scale.
Persistance diagrams are invariant under coordinate transformation i.e. they are
diffeomorphism.
2
11
5th May 2025
V TOPOLGICAL DATA ANALYSIS
This figure shows values of betti numbers across different density thresholds at scale factor
a = 1.
2
12
5th May 2025
IIT Kharagpur,
Kharagpur
Thank you
for listening!
Final Defense
Advisor Student
Prof. Somnath Bharadwaj Aurobinda Majhi