GithubHelp home page GithubHelp logo

nsheat.jl's Introduction

NSHeat

Nuetron star cooling and heating code.

The code solves temperature evolution of spherically symmetric and isothermal NS, along with the evolution of the imbalance among chemical potentials.

The imbalance causes the internal heating.

The code can also incorporate the heating caused by dark matter accretion.

Julia installation

See the official site.

The code is tested on Julia 1.3.1.

For mac homebrew user

$ brew cask install julia

Package installation

Please install gfortran in advance.

From GitHub

$ julia
julia> ]
(v1.3) pkg> add https://github.com/yng87/NSHeat.jl.git

Then in your julia code, you can use NSHeat by

using NSHeat

The dependent modules are automatically installed.

If the automatic installation fails, please install them manually:

pkg> add [package name]

When you encounter error in building NSHeat, try pkg> resolve.

Manual installation

If you build it by yourself, just download zip. In your julia code, specify the path explicitly:

push!(LOAD_PATH, "path/to/NSHeat")
using NSHeat

You may need to install other packages by add [package name].

How to run

Please take a look at test/test.ipynb.

Set Model parameters

One can set the parameters of a neutron star by the following ways:

  1. From input cards: You can pass paramter card by
model, core, env, var = setup("path/to/ini/file/")

These four variables are basic objects in NSHeat, corresponding to the following four structs respectively:

  • ModelParams: model specification such as EOS or superfluid gap models.

  • StarCoreParams: T=0 quantities given by EOS such as Fermi momenta or critical temperatures of nucleons.

  • EnvelopeParams: envelope paramters govering the surface photon emission

  • StarVariables: temperature and chemical potentials which change by time

  1. Directly in the code: See e.g., scripts/test_cool.jl

Solve ODE

Then you can solve cooling/heating ODE by

sol = cooling(model, core, env, var)

or

sol = heating(model, core, env, var)

sol stores the solution of ODE.

The results are placed in the directory you specified in model.output_dir

write_ini(sol, model) # save the model parameters
output_T(sol, model, core, env, var) # save temperature and chemical potential
output_LC(sol, model, core, env, var) # save luminosities and heat capacities

ODE Solver

Julia DifferentialEquation.jl offers a lot of solvers for an ODE problem. Among them, radau is the best for this NS evolution, in particular for late time heating problem.

nsheat.jl's People

Contributors

yng87 avatar

Watchers

 avatar

Forkers

wangq1h

nsheat.jl's Issues

About EOS and TOV files.

Hello, I would like to ask if I want to change a model, do I need to use the EOS and TOV equations in the same format?
Do I need to change more files? I just started to learn these, some things are not very familiar.

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.