https://github.com/aneeshnaik/smoggy

smoggy is a restricted N-body code, simulating the formation of stellar streams under chameleon gravity

https://github.com/aneeshnaik/smoggy

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

smoggy is a restricted N-body code, simulating the formation of stellar streams under chameleon gravity

Basic Info
  • Host: GitHub
  • Owner: aneeshnaik
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 115 KB
Statistics
  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Archived
Created about 7 years ago · Last pushed almost 6 years ago
Metadata Files
Readme License

README.md

smoggy

smoggy is a restricted N-body code written in python-3. Its primary purpose, at the time of writing, is to understand the impact of chameleon fifth forces on stellar streams arising from dark matter dominated dwarfs around the Milky Way.

This code was used to generate the results in Naik et al., (2020). More details about the science can be found there. Please direct any comments/questions to the author, Aneesh Naik, at an485@[Cambridge University]

Prerequisites

This code was written and implemented with python 3.6, and requires the following external packages (the version numbers in parentheses indicate the versions employed at time of writing, not particular dependencies):

  • h5py (2.9.0)
  • numpy (1.16.2)
  • emcee (2.2.1)

Usage

Setting up and running a simulation all done via the 'SmogSimulation' object, while all post-analysis is done via the 'SmogOutput' object, which reads a saved simulation output file and loads up all of the data.

The following examples should cover all of the basic use cases. More examples can be found at insert link here, which contains all the runscripts and plotting scripts used for Naik et al., (2020).

Example 1: 1-body, standard gravity

While there are a great deal of arguments SmogSimulation will accept, the only ones it needs are ones which tell it where the satellite start, its initial velocity, its scale radius, and its mass. Then, after initialising, one only needs to use the self-explanatory run and save methods.

So setting up, running, and saving such a simulation takes the following code: ```python import smoggy import numpy as np from smoggy.constants import kpc, M_sun

sim = smoggy.SmogSimulation(satx0=np.array([50*kpc, 0, 0]), satv0=np.array([0, 200000, 0]), satradius=0.1*kpc, satmass=5e+8*Msun) sim.run(tmax=1e+17, Nsnapshots=500) sim.save("example1") `` The simulation data can all then be found inexample_1.hdf5`.

As a default, the gravity is 'standard', i.e. fifth forces are switched off, and there are no tracer particles, i.e. the simulation is a simply 1-body problem, with a single satellite 'particle' moving in the Milky Way potential. The default Milky Way potential is a NFW halo (virial mass 1012 Msun and concentration 12), plus a Miyamoto-Nagai disc and Hernquist bulge, both using parameter values from Law and Majewski (2010). However, the Milky Way potential is very customisable through the various keyword arguments fed to SmogSimulation.

Example 2: Restricted N-body, standard gravity

To add tracer particles, set the tracers flag to True, and add specify the numbers of type 1 (dark matter) and type 2 (stars) particles via N1 and N2. The only difference between the two particle types is whether they couple to the fifth force (stars don't), so they are indistinguishable in the standard gravity case. python sim = smoggy.SmogSimulation(sat_x0=np.array([50*kpc, 0, 0]), sat_v0=np.array([0, 200000, 0]), sat_radius=0.1*kpc, sat_mass=5e+8*M_sun, tracers=True, N1=1000, N2=1000)

Example 3: Restricted N-body, modified gravity

To switch on fifth forces, set the modgrav flag to True, specify the fifth force coupling strength via beta, and the Milky Way and satellite screening radii via MW_r_screen and sat_r_screen respectively. python sim = smoggy.SmogSimulation(sat_x0=np.array([50*kpc, 0, 0]), sat_v0=np.array([0, 200000, 0]), sat_radius=0.1*kpc, sat_mass=5e+8*M_sun, tracers=True, N1=1000, N2=1000, modgrav=True, beta=0.1, MW_r_screen=10*kpc, sat_r_screen=0.5*kpc)

Example 4: Plotting a stream image

To load a saved simulation file and create a stream image: ```python import smoggy from smoggy.constants import kpc import matplotlib.pyplot as plt

load data

d = smoggy.SmogOutput("saved_simulation.hdf5")

get particle positions

x0 = d.p0positions[-1]/kpc v0 = d.p0velocities[-1] x1 = d.p1positions[-1]/kpc v1 = d.p1velocities[-1] x2 = d.p2positions[-1]/kpc v2 = d.p2velocities[-1]

set up axes

ax = plt.subplot() ax.set_aspect('equal')

plot particles

ax.scatter(x1[:, 0], x1[:, 2], s=3, alpha=0.5, rasterized=True, c='red') ax.scatter(x2[:, 0], x2[:, 2], s=3, alpha=0.5, rasterized=True, c='green') plt.show() ```

Authors

This code was written by Aneesh Naik (website). The research was performed in collaboration with the co-authors of Naik et al. (2019):

License

Copyright (2020) Aneesh Naik.

smoggy is free software made available under the MIT license. For details see LICENSE.

If you make use of smoggy in your work, please cite our paper (arXiv, ADS).

Acknowledgments

Please see the acknowledgments in the paper for a list of the many people and institutions I and my co-authors indebted!

Owner

  • Name: Aneesh Naik
  • Login: aneeshnaik
  • Kind: user

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels