Engee documentation
Notebook

We simulate charged rotating black holes

This calculation allows for a quantitative analysis of the geometry of space-time in the vicinity of relativistic objects with nonzero multipole moments, which is necessary to verify the predictions of general relativity in strong gravitational fields. The obtained tensor invariants are used to study the singular structure of space-time and analyze the stability of geodetic trajectories under extreme gravitational conditions.

Job description

The calculation of four-vectors and curvature tensors for charged rotating black holes (Kerr-Newman metric) is a critically important task in modern astrophysics and the theory of gravity.

These calculations make it possible to quantify the curvature of space-time in the vicinity of massive rotating objects with an electric charge.

The practical significance of such calculations lies in the possibility of modeling particle trajectories, predicting the shapes of accretion disks, and analyzing the stability of orbits around relativistic objects.

To implement the algorithms, we only need a library of linear algebra functions.:

In [ ]:
using LinearAlgebra

The theoretical basis of the algorithm

In the engineering interpretation, the Kerr-Newman metric is a mathematical model describing the "geometry" of space-time in the presence of a massive rotating charged body. In this context, the Riemann curvature tensor can be considered as an analog of the strain tensor in continuum mechanics, characterizing the degree and nature of curvature of the space-time continuum. Four-vectors describe physical quantities (momentum, velocity) in a curved space-time.

Kerr-Newman metric in Boyer-Lindqvist coordinates:

Components of the metric tensor:

In [ ]:
function kerr_newman_metric(M, a, Q, r, θ)
    ρ² = r^2 + a^2*cos(θ)^2     # The horizon and singularity function
    Δ = r^2 - 2M*r + a^2 + Q^2  # Discriminant for event horizons
    
    g = zeros(4,4)
    g[1,1] = -(Δ - a^2*sin(θ)^2)/ρ²                      # g_tt - temporary component
    g[1,4] = g[4,1] = -a*sin(θ)^2*(2M*r - Q^2)/ρ²        # g_tϕ - rotation component
    g[2,2] = ρ²/Δ                                        # g_rr - radial component
    g[3,3] = ρ²                                          # g_θθ - angular component
    g[4,4] = ((r^2+a^2)^2 - Δ*a^2*sin(θ)^2)*sin(θ)^2/ρ²  # g_ϕϕ - azimuthal component
    
    return g
end
Out[0]:
kerr_newman_metric (generic function with 1 method)

The curvature tensor shows how strongly space-time is curved at each point. The curvature scalar provides a simple numerical measure of the curvature of space for visualization.

We have combined the rest of the operations into one function.:

  1. Normalization of the four-vector speed:

where the initial condition is ( u^t = 1 ), the remaining components are zero.

  1. Simplified calculation of curvature (finite difference approximation of the second derivative):

This is a discrete analog of the Laplace operator for the component (g_{tt} ).

Our final goal is a four—vector velocity, which describes the motion of an observer in a curved space-time.

In [ ]:
function compute_everything(M, a, Q, r, θ)
    # All in one function
    g = kerr_newman_metric(M, a, Q, r, θ)  # The metric tensor
    
    # Four-vector speed for a static observer
    u = zeros(4); u[4] = 1.0  # Initial condition: dt/dt = 1
    
    # Normalization: g_μν u^μ u^v = -1 (for a time-like vector)
    norm_squared = dot(u, g, u)  # This should be negative for a time-like vector.
    if norm_squared >= 0
        # If the vector is spatially similar, this is a problem - we use safe normalization.
        u ./= sqrt(abs(norm_squared))
    else
        u ./= sqrt(-norm_squared)  # The root of a positive number
    end
    
    # A simple calculation of the curvature through the second derivative
    h = 1e-6  # A step for numerical differentiation
    g_rp = kerr_newman_metric(M, a, Q, r+h, θ)  # The metric at the point r+h
    g_rm = kerr_newman_metric(M, a, Q, r-h, θ)  # The metric at the r-h point
    R_simple = (g_rp[1,1] - 2g[1,1] + g_rm[1,1]) / h^2  # The final difference of the second derivative of g_tt
    
    return g, u, R_simple
end
Out[0]:
compute_everything (generic function with 1 method)

Using the algorithm

We use this code:

In [ ]:
# Parameters of the black hole and coordinates of the observation point
M = 1.0    # The mass of the black hole in natural units
a = 0.5    # Rotation parameter (a = J/M)
Q = 0.3    # The electric charge of a black hole
r = 2.0    # Radial coordinate (distance from the center)
θ = π/4    # Angular coordinate (π/4 = 45°)

# Calculation of all values at a given point
g, u, R = compute_everything(M, a, Q, r, θ)

# Output of results
println("Kerr-Newman metric at the point (r=$r, θ=):")
display(g)
println("\The four speed vector of the static observer:")
println("u = $u")  # Components: [u^r, u^θ, u^ϕ, u^t]
println("Simplified measure of curvature (second derivative of g_tt):")
println("R ≈ $R")
Метрика Керра-Ньюмена в точке (r=2.0, θ=0.7853981633974483):
4×4 Matrix{Float64}:
 -0.0521212   0.0     0.0    -0.23697
  0.0        12.1324  0.0     0.0
  0.0         0.0     4.125   0.0
 -0.23697     0.0     0.0     2.18424
Четырехвектор скорости статического наблюдателя:
u = [0.0, 0.0, 0.0, 0.6766274006347055]

Упрощенная мера кривизны (вторая производная g_tt):
R ≈ 0.38258285428582894

Let's build heat maps of metrics and curvature:

In [ ]:
using Plots.PlotMeasures

# Creating a grid for visualization
r_range = range(1.5, 5.0, length=50)  # Radius from 1.5 to 5 (avoiding the singularity)
θ_range = range(0.1, π-0.1, length=50)  # Angle from 0.1 to π-0.1 (avoiding the pole)

# Calculating the metric and curvature components on the grid
g_tt_values = [kerr_newman_metric(M, a, Q, r, θ)[1,1] for r in r_range, θ in θ_range]
g_rr_values = [kerr_newman_metric(M, a, Q, r, θ)[2,2] for r in r_range, θ in θ_range]
curvature_values = [compute_everything(M, a, Q, r, θ)[3] for r in r_range, θ in θ_range]

p1 = heatmap(r_range, θ_range, g_tt_values', 
            title="The time component of the g_tt metric",
            ylabel="Angle θ",
            color=:viridis, clim=(-2, 0), titlefont=font(12), topmargin=2mm, titlelocation=:left)

p2 = heatmap(r_range, θ_range, g_rr_values', 
            title="The radial component of the g_rr metric", 
            ylabel="Angle θ",
            color=:plasma, clim=(0, 10), titlefont=font(12), topmargin=2mm, titlelocation=:left)

p3 = heatmap(r_range, θ_range, curvature_values',
            title="A simplified measure of curvature",
            xlabel="Radius r", ylabel="Angle θ", 
            color=:hot, clim=(-1, 1), titlefont=font(12), topmargin=2mm, titlelocation=:left)

# Displaying all the graphs together
plot(p1, p2, p3, layout=(3,1), size=(800, 900))
Out[0]:

This map shows how the curvature of space-time decreases as you move away from a charged rotating black hole.

Conclusion

The code presented here allows numerical calculations of the geometric characteristics of space-time around charged rotating black holes for various values of mass, angular momentum and electric charge. The results obtained can be used for further analysis of gravitational effects in strong fields and modeling of astrophysical processes in the vicinity of relativistic objects.