Flux tutorial#
Load pybhpt.flux#
from pybhpt.teuk import TeukolskyMode
from pybhpt.flux import FluxMode
from pybhpt.geo import KerrGeodesic
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
Solving the inhomogeneous radial Teukolsky equation in Kerr spacetime#
The TeukolskyMode class constructs modes of the so-called extended homogeneous solutions to the radial Teukolsky equation for a point-particle source on a bound periodic geodesic,
The class is instantiated with the input parameters
\(s\) : spin-weight of the perturbation
\(j\) : the spheroidal polar mode number
\(m\) : the azimuthal mode number
\(k\) : the polar mode number
\(n\) : the radial mode number
along with an instance of the KerrGeodesic class that captures the motion of the source.
a, p, e, x = 0.99, 5, 0.6, 0.4
geo = KerrGeodesic(a, p, e, x)
s, j, m, k, n = -2, 12, 3, 1, 2
Psis = TeukolskyMode(s, j, m, k, n, geo)
We solve for the mode solutions and the Teukolsky amplitudes with the solve() method
Psis.solve(geo)
Generating flux contribution from each Teukolsky mode#
The time-averaged rate of change of the orbital energy \(\langle \dot{E}\rangle\), angular momentum \(\langle \dot{L}_z\rangle\), and Carter constant \(\langle \dot{Q}\rangle\) can be expressed in terms of the Teukolsky amplitudes \(Z^\mathrm{Up/In}_{sjmkn}\),
The FluxMode class takes as input an instances of the Kerr geodesic class and the Teukolsky class for a mode \((s,j,m,k,n)\), and produces the flux contribution for that given mode.
flux = FluxMode(geo, Psis)
Then we can access the horizon fluxes, infinity fluxes, and total fluxes, which are stored in lists with the order of \(\mathcal{J} = (E, L_z, Q)\)
print(flux.horizonfluxes)
print(flux.infinityfluxes)
print(flux.totalfluxes)
[-3.606222842872166e-36, -3.5075219557527026e-35, -1.979059439027494e-34]
[6.753687090778148e-25, 6.56884135710292e-24, 3.7063566971910574e-23]
[6.753687090742086e-25, 6.568841357067845e-24, 3.706356697171267e-23]
Example: Circular Kerr fluxes#
As a quick example, we compute the total fluxes for a particle on a circular Kerr geodesic
a, p, e, x = 0.99, 5, 0., 1.
geo = KerrGeodesic(a, p, e, x, nsamples=2**2)
jmax = 18
total_fluxes = np.zeros(3)
horizon_fluxes = np.zeros(3)
infinity_fluxes = np.zeros(3)
total_fluxes_jmodes = np.zeros((jmax - 1, 3))
for j in range(2, jmax+1):
for m in range(1, j+1):
Psis = TeukolskyMode(-2, j, m, 0, 0, geo, auto_solve=True)
flux = FluxMode(geo, Psis)
total_fluxes += flux.totalfluxes
total_fluxes_jmodes[j-2] += flux.totalfluxes
horizon_fluxes += flux.horizonfluxes
infinity_fluxes += flux.infinityfluxes
total_fluxes *= 2
horizon_fluxes *= 2
infinity_fluxes *= 2
total_fluxes_jmodes *= 2
print("Total fluxes (E, Lz, Q): ", total_fluxes)
Total fluxes (E, Lz, Q): [0.00122957 0.01496423 0. ]
We can also plot the convergence of the mode-sum, which we see falls-off exponentially
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.size'] = 16
plt.plot(range(2, jmax+1), total_fluxes_jmodes[:, 0], 'o-')
plt.yscale('log')
plt.xlabel('$j$')
plt.ylabel('$\dot{E}_{j}$')
plt.title('Energy flux contribution from each $j$ mode')
plt.grid()
plt.show()