I THINK that the single shooter is ok. I can always improve it later
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
function laguerre_conway(state::Vector{Float64}, μ::Float64, time::Float64)
|
||||
function laguerre_conway(state::Vector{T}, μ::Float64, time::Float64) where T <: Real
|
||||
|
||||
n = 5 # Choose LaGuerre-Conway "n"
|
||||
i = 0
|
||||
@@ -14,7 +14,7 @@ function laguerre_conway(state::Vector{Float64}, μ::Float64, time::Float64)
|
||||
if a > 0 # Elliptical
|
||||
ΔM = ΔE_new = √(μ) / sqrt(a^3) * time
|
||||
ΔE = 1000
|
||||
while abs(ΔE - ΔE_new) > 1e-12
|
||||
while abs(ΔE - ΔE_new) > 1e-10
|
||||
ΔE = ΔE_new
|
||||
F = ΔE - ΔM + σ0 / √(a) * (1-cos(ΔE)) - coeff * sin(ΔE)
|
||||
dF = 1 + σ0 / √(a) * sin(ΔE) - coeff * cos(ΔE)
|
||||
@@ -32,7 +32,7 @@ function laguerre_conway(state::Vector{Float64}, μ::Float64, time::Float64)
|
||||
ΔN = √(μ) / sqrt(-a^3) * time
|
||||
ΔH = 0
|
||||
ΔH_new = time < 0 ? -1 : 1
|
||||
while abs(ΔH - ΔH_new) > 1e-12
|
||||
while abs(ΔH - ΔH_new) > 1e-10
|
||||
ΔH = ΔH_new
|
||||
F = -ΔN - ΔH + σ0 / √(-a) * (cos(ΔH)-1) + coeff * sin(ΔH)
|
||||
dF = -1 + σ0 / √(-a) * sin(ΔH) + coeff * cos(ΔH)
|
||||
|
||||
Reference in New Issue
Block a user