Coder Social home page Coder Social logo

amotornenko / tovsolver Goto Github PK

View Code? Open in Web Editor NEW
32.0 4.0 9.0 537 KB

Python package for solving TOV equation and calculating tidal properties

Jupyter Notebook 93.71% Python 6.29%
python neutron-star tov tov-solver jupyter-notebook tidal-deformabilities

tovsolver's Introduction


Python for TOV solver

About

Python package to solve Tolman-Oppenheimer-Volkoff equation. Allows to study properties of static neutron stars with given equation of state. Additionally is able to calculate tidal properties of neutron stars. The package can become quite handy by using from jupyter noebook.

Documentation

To install use:

pip3 install .

Or if you do not have root access, then to install locally:

pip3 install . --user

See an example jupyter notebook in the example folder.

Functionality

Solves TOV equation, calculates mass and radius of static neutron star at given central density. Calculates tidal properties of neutron star.

Literature

License

Copyright 2019-2022 Anton Motornenko (FIAS)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

tovsolver's People

Contributors

amotornenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tovsolver's Issues

Run tov.py code

Hello,
I have installed the TOVsolver code as instructed.

Now I want to use my EoS to solve the TOV equation and calculate Mass, radius, etc.
Where do I need to save my EoS and how do I then run tov.py

Please respond back.
I will be waiting

about the central density

Hello,
When I used my own EOS for calculation, I found that there was an exception in it, as shown in the figure, but I did not quite understand this exception and was not clear about its impact on the calculation results. I hope I can get your help.
Thank you.
X$%I_EGT@ B(GS70_$QEB)E

Gettting more mass if the central density is fixed either for maximum mass star or canonical star profiles

  1. I have compiled your codes using these lines

m_arr = []
R_arr = []

for dens_c in np.logspace(-0,3.7,350):
R, M, prof = tov_s.solve(dens_c, rmax=50e5, dr=100)
m_arr.append(M)
R_arr.append(R)
print(R, M, dens_c)
# extra I have written to check which central density gives the maximum mass of the neutron star.

I found that the radius and central density corresponded to the maximum mass 2.1498973233892715 M_sun are

12.004 km 1076.692506643068 MeV/fm^3

  1. Now, I have fixed only this central density to check whether i am getting the same or not. But it gives me wrong values.

R, M, prof = tov_s.solve(1076.692506643068, rmax=50e5, dr=100) # 2.1498973233892715 M_sun, 12.004 km

12.004 km 4.274931084233547 M_sun

If you compare the masses there is huge differences 4.274931084233547-2.1498973233892715 = 2.125033761 M_sun. But the radius is same.

  1. For arbitrary star say mass 1.3820322317287081 M_sun, the radius and central density are 13.144 km and 386.20641587213856 Mev/fm^3

R, M, prof = tov_s.solve(386.20641587213856, rmax=50e5, dr=100) # 1.3820322317287081, 13.144

print(max(prof[0]/1e5), max(prof[3]/1e33)) gives

13.144 km 2.748081260697474 M_sun

Please help me in this regard.

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.