Skip to content

Commit c156b26

Browse files
authored
Merge pull request #8 from CuberYyc808/generic_plunge
add kerr_geo_emri
2 parents 0401bc8 + 5641195 commit c156b26

File tree

2 files changed

+34
-21
lines changed

2 files changed

+34
-21
lines changed

src/KerrGeoOrbit.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ function kerr_geo_orbit_circular(a::Float64, p::Float64, e::Float64=0.0, x::Floa
6464
"Frequencies" => Dict("ϒt" => ϒt, "ϒr" => ϒr, "ϒθ" => ϒθ, "ϒϕ" => ϒϕ),
6565
"Trajectory" => [t, r, θ, ϕ],
6666
"FourVelocity" => velocity,
67+
"CrossFunction" => nothing,
68+
"DerivativesCrossFunction" => nothing,
6769
"a" => a,
6870
"p" => p,
6971
"e" => e,

src/KerrGeodesics.jl

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Orbit_Type(a::Real, p::Real, e::Real, x::Real) = kerr_geo_orbit_type(a, p, e, x)
6363

6464
Kerr_Geodesics(a::Real, p::Real, e::Real, x::Real; initPhases = (0.0, 0.0, 0.0, 0.0)) = kerr_geo_orbit(a, p, e, x; initPhases = initPhases)
6565

66-
6766
struct KerrGeoEMRI
6867
OrbitalType::Vector{String}
6968
OrbitalParameters::NamedTuple
@@ -79,13 +78,13 @@ end
7978

8079
function Base.show(io::IO, ::MIME"text/plain", kg::KerrGeoEMRI)
8180
println(io, "KerrGeoEMRI(")
82-
print(io, " OrbitalType="); show(io, kg.OrbitalType); println(io, ",")
83-
print(io, " OrbitalParameters="); show(io, kg.OrbitalParameters); println(io, ",")
84-
print(io, " ConstantsOfMotion="); show(io, kg.ConstantsOfMotion); println(io, ",")
85-
print(io, " Parametrization="); show(io, kg.Parametrization); println(io, ",")
86-
print(io, " Trajectory="); show(io, kg.Trajectory); println(io, ",")
87-
print(io, " InitialPhases="); show(io, kg.InitialPhases); println(io, ",")
88-
print(io, " Frequencies="); show(io, kg.Frequencies); println(io, ",")
81+
print(io, " OrbitalParameters = "); show(io, kg.OrbitalParameters); println(io, ",")
82+
print(io, " ConstantsOfMotion = "); show(io, kg.ConstantsOfMotion); println(io, ",")
83+
print(io, " OrbitalType = "); show(io, kg.OrbitalType); println(io, ",")
84+
print(io, " Frequencies = "); show(io, kg.Frequencies); println(io, ",")
85+
print(io, " Parametrization = "); show(io, kg.Parametrization); println(io, ",")
86+
print(io, " Trajectory = (t = t(λ), r = r(λ), θ = θ(λ), ϕ = ϕ(λ))"); println(io, ",")
87+
print(io, " InitialPhases = "); show(io, kg.InitialPhases); println(io, ",")
8988
print(io, ")")
9089
end
9190

@@ -109,32 +108,44 @@ function kerr_geo_emri(a::Real, p::Real, e::Real, x::Real; initPhases = (0.0, 0.
109108
ϒθ = freqs["ϒθ"]
110109
ϒϕ = freqs["ϒϕ"]
111110
# Cross functions
112-
Δtr = KG["CrossFunction"][1]
113-
Δtθ = KG["CrossFunction"][2]
114-
Δϕr = KG["CrossFunction"][3]
115-
Δϕθ = KG["CrossFunction"][4]
111+
if KG["CrossFunction"] !== nothing
112+
Δtr = KG["CrossFunction"][1]
113+
Δtθ = KG["CrossFunction"][2]
114+
Δϕr = KG["CrossFunction"][3]
115+
Δϕθ = KG["CrossFunction"][4]
116+
else
117+
Δtr = nothing
118+
Δtθ = nothing
119+
Δϕr = nothing
120+
Δϕθ = nothing
121+
end
116122
# Derivatives of cross functions
117-
dtr = KG["DerivativesCrossFunction"][1]
118-
dtθ = KG["DerivativesCrossFunction"][2]
119-
dϕr = KG["DerivativesCrossFunction"][3]
120-
dϕθ = KG["DerivativesCrossFunction"][4]
123+
if KG["DerivativesCrossFunction"] !== nothing
124+
dtr = KG["DerivativesCrossFunction"][1]
125+
dtθ = KG["DerivativesCrossFunction"][2]
126+
dϕr = KG["DerivativesCrossFunction"][3]
127+
dϕθ = KG["DerivativesCrossFunction"][4]
128+
else
129+
dtr = nothing
130+
dtθ = nothing
131+
dϕr = nothing
132+
dϕθ = nothing
133+
end
121134
# Four-velocity
122-
velocity = Four_Velocity(a, p, e, x; initPhases=initPhases, Covariant=false, Parametrization="Mino")
135+
ut, ur, uθ, uϕ = KG["FourVelocity"]
123136

124137
return KerrGeoEMRI(
125138
otype,
126139
(a=a, p=p, e=e, x=x),
127140
(E=En, Lz=L, Q=Q),
128141
"Mino",
129142
(t=t, r=r, θ=θ, ϕ=ϕ),
130-
(qr0=initPhases[1], qθ0=initPhases[2]),
131-
(ut=velocity[1], ur=velocity[2], uθ=velocity[3], uϕ=velocity[4]),
143+
(qt0 = initPhases[1], qr0=initPhases[2], qθ0=initPhases[3], qϕ0=initPhases[4]),
144+
(ut=ut, ur=ur, uθ=, uϕ=),
132145
(ϒt=ϒt, ϒr=ϒr, ϒθ=ϒθ, ϒϕ=ϒϕ),
133146
(Δtr=Δtr, Δtθ=Δtθ, Δϕr=Δϕr, Δϕθ=Δϕθ),
134147
(dtr=dtr, dtθ=dtθ, dϕr=dϕr, dϕθ=dϕθ)
135148
)
136149
end
137150

138-
139-
140151
end

0 commit comments

Comments
 (0)