lujiajing1126 / tov-solver

A high performance Python C extension to solve TOV equation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TOV Solver

This is a high performance Python C extension to solve TOV equation

Requirements

  • Python 3
  • numpy
  • gsl

Install

$ pip install git+https://github.com/lujiajing1126/tov-solver.git@master

Use

from tov import solve
# rho(numpy.ndarray): baryon density
# pressure(numpy.ndarray): pressure of the beta-equilibrium matter at specfic baryon density
# eps(numpy.ndarray): total energy density at specfic baryon density
# Every array should be in reverse order, and with the same dimension
# Pressure should be monotonically decreasing
solve(rho, pressure, eps)

Refs

LICENSE

MIT

About

A high performance Python C extension to solve TOV equation


Languages

Language:C 87.8%Language:C++ 6.2%Language:Python 6.0%