Coder Social home page Coder Social logo

umg-kmr / ns_moi Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 215 KB

Codes related to solution of the stellar structure, moment of inertia and tidal deformability of neutron stars

License: GNU General Public License v3.0

Python 10.15% Jupyter Notebook 89.85%
equations-of-state moment-of-inertia neutron-star tidal-deformabilities tov-solver

ns_moi's Introduction

NS_MoI

NS_MoI is a python code to solve the stellar structure equations for a slowly rotating Neutron Star. It gives the mass, radius, moment of inertia and the dimensionless tidal deformability parameter ($\Lambda$).

The main code is contained in the 'code' directory and is divided into two parts, driver has the methods to calculate the required quantities and the main module implements them with multiprocessor support.

There is no need for installation but the code requires a working python 3 installation and few other packages which can be easily installed by the pip command:

  1. Numpy
  2. Scipy
  3. Pandas
  4. Matplotlib (only for the plots)

After cloning the repository, go to the params.py file and change the paramters according to your use case and specify the equation of state. Sample code for 'ALF2' is provided.

Run the code using the following command:

python MI_Main.py

The code will output a 'EOS_Name.dat' file in the output directory and the execution time on the screen. The output file structure is as follows:

Mass ($M_\odot$), Radius(Km), $\Lambda$, Moment of Inertia ($kg \ m^2$)

You can now either write your own code to visualise the data or use the provided jupyter notebooks in the 'notebooks' directory.

Example with Anaconda

If you have a working anaconda install, you can create a new environment and use the code inside that.

Create a new python 3 environment and activate it with:

conda create -n NS_MoI python=3.11
conda activate NS_MoI

Install the required packages:

conda install -c conda-forge numpy scipy pandas matplotlib

Optionally install jupyter notebook:

conda install -c anaconda jupyter

Run the code with the following commands:

git clone https://github.com/umg-kmr/NS_MoI.git
cd NS_MoI/code/
python MI_Main.py

Acknowledgments

We would like to acknowledge the Ashoka High Performance Computing Cluster (The Chanakya@Ashoka) for providing computational resources and support. The program was tested and all calculations were computed on the Chanakya@Ashoka.

Contact

For any inquiries or questions, please contact [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.