Giter Site home page Giter Site logo

blackholesimulator's Introduction

Kerr Black Hole Simulator

Example video

installation

install the rust toolchain. info here

to run it, go to the root folder of this project, and run:

cargo run --release

In src/main.rs, the different components can be activated,
in src/test_setups.rs, the parameters of the simulation can be tweaked,

overview

This is hobby project which implements a general relativistic ray tracer in rust.

The core of the raytracer is in src/curved_space.rs. Here, a trait (class) is provided for different metrics togheter with a trait for the objects living in the corresponding space. The numerical stepping procedures, conversion between contra and covariant vectors, spawning objects from cartesian representation etc are implemented here.

src/ray_tracer takes as input objects such as an accretion disk and a background picture and a discription of the camera object. The light rays are propageted until they collide and then the color is deduced. It also provides methods to generate output image and plots in python.

src/test_setup is a predefined set of input argumets for the ray_tracer.

internals

The rays are propagated with a runge kutta stepping sheme.

For the schwarzschild metric, the contraviriant momenta are updated with the gedesic equition (with christffel symbols). It uses 2 coordinate patches to avoid difficulties at the poles. The stepping is done with RK4 and an specific error estimate and a adaptive step size based on the current coordinates and momenta.

For the kerr metric, the covariant momenta are updated using embedded rk5 algoritm and the update equation from this paper.

pictures

In kerr spacetime, the simultion needs about 40s for a full HD picture on a i7-4700MQ CPU @ 2.40GHz (released in 2013).

Some example pictures: Image description Image description Image description

blackholesimulator's People

Contributors

daviddevoogdt avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  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.