Black Hole Raytracing
I've sorta become addicted to building out a proper black hole raytracer to do an updated version of my 360 video showing what it looks like to fall into a black hole. I started with code from this page as a reference http://www.madore.org/~david/math/kerr.htmlbut since then I've added a bunch of features I'm going to need, like 360 cameras and intelligent interpolation so I don't waste time computing light rays which are similar to their neighbours. (see: https://twitter.com/DJSnM/status/1225309502146088960?s=20 )
My original 360 black hole video was made in Space Engine and it's not accurate in many ways, for a start the observer isn't really falling, they're a static camera moving towards the hole, the motion is important because it changes the view. Also the Black hole is a simple non-rotating black hole and real black holes all have rotation. This last part is really important and forces me to use a raytracer that propagates photons backwards using an iterative solution rather than simply solving a bunch of equations.
I use a Runge-Kutta integrator to move the light ray through the curved space-time around the black hole. Non-rotating black holes use the Schwarzschild metric which is a solution to Einstein's field equations. The field equations are at the core of general relativity and were published in 1915, Schwarzschild's solution followed in 1916. But the solution for a rotating black hole would take until 1963 when Roy Kerr developed the Kerr Metric.
One of the fun things about rotating black holes (and indeed any rotating mass) is that they drag spacetime along with them - you can see this effect when I adjust the angular momentum of a test metric:
https://twitter.com/DJSnM/status/1221301237783515137?s=20
This is a side project that's taking a lot of my spare time, and I'll publish the code to patrons once I finish 'improving' it.
Orbiting Black Hole at Innermost Stable Circular Orbit (YouTube)
Comments (4)
I yield to a clearly more current trained professional. I decline to admit how long ago was the work I did, but the computer should give a big hint! So where or what is your $DAYJOB?
A note about R-K integration: once upon a long time ago, I worked on a continuous system modeling program (hint hint) that ran on an IBM 1130. As such, it needed every cycle one could find hiding. A decision we made was to replace the R-K integrators with Adams-Moulton integrators. That is also a predictor-corrector but in exchange for a bit more hair, it can get precision better than the R-K with many fewer time-steps. It made a huge difference in the running time of messy models, and at the same time, kept the numerical blue meanies (ie, 32-bit floating point) under control. For what it's worth.... Nice work, btw! (grin)
Yep, I've been working with integrators for most of my academic life, I'm considering trying Bulirsch-Stoer since the derivatives calculation is the most expensive part. The main thing I've found is that my stepsize heuristic is at least as good as full adaptive stepsize control.
Can't wait for the final product. Especially because I need the explanation. Currently I have no idea what I am looking at, or where to look (since this is a 360 video).
