@@ -444,3 +444,57 @@ def miyamoto_nagai_galaxy(
444444 particles .append ((x , y , z , vx , vy , vz , M_halo / N_halo , 1 ))
445445
446446 return particles
447+
448+ def NewBigBang (N = 40000 , base_mass = 8.5e9 ,
449+ scatter = 0.0 , dm_fraction = 0.0 ,
450+ dm_N = 12000 , max_dist = 20.0 ):
451+ """
452+ Big Bang initial conditions.
453+ type=0 baryons, type=1 DM
454+ """
455+ particles = []
456+
457+ # Visible matter
458+ for _ in range (N ):
459+ angle = 2 * math .pi * random .random ()
460+ r = math .sqrt (random .random ()) * max_dist + 1.0
461+
462+ x = r * math .cos (angle ) + random .uniform (- 15 , 15 )
463+ y = r * math .sin (angle ) + random .uniform (- 15 , 15 )
464+ z = 0.0
465+
466+ dx , dy = x , y
467+ norm = math .sqrt (dx * dx + dy * dy )
468+ nx , ny = dx / norm , dy / norm
469+
470+ speed = 300.0 * (r / 35.0 )
471+ vx , vy , vz = nx * speed , ny * speed , 0.0
472+
473+ rand_mass = 1.0 + (random .random () * 2.0 - 1.0 ) * scatter
474+ m = (base_mass / N ) * rand_mass
475+
476+ particles .append ((x , y , z , vx , vy , vz , m , 0 ))
477+
478+ # Dark matter
479+ if dm_fraction > 0.0 :
480+ for _ in range (dm_N ):
481+ angle = 2 * math .pi * random .random ()
482+ r = math .sqrt (random .random ()) * max_dist + 1.0
483+
484+ x = r * math .cos (angle ) + random .uniform (- 15 , 15 )
485+ y = r * math .sin (angle ) + random .uniform (- 15 , 15 )
486+ z = 0.0
487+
488+ dx , dy = x , y
489+ norm = math .sqrt (dx * dx + dy * dy )
490+ nx , ny = dx / norm , dy / norm
491+
492+ speed = 300.0 * (r / 35.0 )
493+ vx , vy , vz = nx * speed , ny * speed , 0.0
494+
495+ rand_mass = 1.0 + (random .random () * 2.0 - 1.0 ) * scatter
496+ m = (1.416e11 / dm_N ) * rand_mass
497+
498+ particles .append ((x , y , z , vx , vy , vz , m , 1 ))
499+
500+ return particles
0 commit comments