Member-only story
Visualizing the Schwarzschild Black Hole: A Journey through Space, Time, and Code
Introduction
Visualizing black holes can be quite an intriguing project. For this task, we’ll create a simple script to visualize the Schwarzschild black hole, which is a non-rotating black hole. The key feature around a black hole we might be interested in visualizing is the event horizon, the boundary beyond which nothing, not even light, can escape from the black hole’s gravitational pull.
The Schwarzschild radius (rs) defines the size of the event horizon and can be calculated for a black hole of mass M using the formula:
where:
- G is the gravitational constant (6.674×10−11 m3kg−1s−26.674×10−11m3kg−1s−2),
- M is the mass of the black hole,
- c is the speed of light in vacuum (3.00×108 m/s3.00×108m/s).
To bring this concept to life, we will employ Python and Plotly, alongside Dash for creating an interactive web-based visualization. Let’s dive into the script that allows users to dynamically update the black hole’s mass and immediately see the effects on its Schwarzschild radius and visualization.