Giter Club home page Giter Club logo

mspbh's Introduction

MSPBH (Motion of Spinning Particles around Black Holes)

This code calculates the trajectory of a spinning particle around a black hole with an arbitrary metric tensor. The user can use the configuration file to adapt the code for a specific situation.

Dependencies

The code uses symbolic algebra to calculate necessary quantities, such as the Riemann tensor and partial derivatives. Also uses Odeint to integrate equations of motion. To run this code, you need Sympy, Scipy, Einsteinpy, Numpy, and Matplotlib. Use

pip install -r requirements.txt

to install the dependencies. Make sure you are using Python3.

Usage

If you execute the code like this

python3 MSPBH.py

The execution will stop, and you'll see a message with instructions. At the same time, a file called template.txt will be created. If the file already exists, it will be overwritten. On template.txt, you can find all the variables that the program needs. Make sure to use a copy of that file, otherwise, you can lose your configuration. If the variables User_tensor and User_metric are set to False, the program will use a premade Schwarzschild metric from the library Einsteinpy. If User_tensor is True, the program will use the components of the tensors given by the user on the configuration file. This option has precedence over User_metric. If User_metric is True and User_tensor is False, the program will use the function Create_User_Metric_Tensor to create a metric tensor with the library Einsteinpy. Then, it will compute the Riemann tensor and perform the calculations. The extension of the file doesn't matter.

When you finish editing your configuration file, type

python3 MSPBH.py file_name.txt

The program will check for any missing variables and notify them. If this happens, template.txt will be overwritten. If User_metric is False, you don't have to keep the Riemann and metric tensor components of the template. They are only necessary when that option is activated. The same happens with the function Create_User_Metric_Tensor.

If you manage to execute the program successfully, you will see 2 output files, log.out and data.csv. The first one has information about all the variables read from the configuration file. The second one is a CSV file where you will find the time, coordinate, coordinate, energy, and angular momentum of the particle. This calculation is performed assuming that the particle is on the equatorial plane of the black hole ().

Reference

For a complete explanation and derivation of the equations of motion, check the book "A Guide to Black Holes" from Nova Science Publishers (which hasn't been published yet).

When the book is published, I'll leave the reference here.

mspbh's People

Contributors

cdelv avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.