Currently working on refactor, much work to do
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
function laguerre_conway(state::Vector{<:Real}, μ::Float64, time::Float64)
|
||||
function laguerre_conway(state::Vector{<:Real}, time::Float64, primary::Body=Sun)
|
||||
|
||||
μ = primary.μ
|
||||
n = 5 # Choose LaGuerre-Conway "n"
|
||||
i = 0
|
||||
|
||||
@@ -22,7 +23,7 @@ function laguerre_conway(state::Vector{<:Real}, μ::Float64, time::Float64)
|
||||
sign = dF >= 0 ? 1 : -1
|
||||
ΔE_new = ΔE - n*F / ( dF + sign * √(abs((n-1)^2*dF^2 - n*(n-1)*F*d2F )))
|
||||
i += 1
|
||||
if i > 100 throw(ErrorException("LaGuerre-Conway did not converge!")) end
|
||||
if i > 100 throw(LaGuerreConway_Error("LaGuerre-Conway did not converge!")) end
|
||||
end
|
||||
F = 1 - a/r0_mag * (1-cos(ΔE))
|
||||
G = a * σ0/ √(μ) * (1-cos(ΔE)) + r0_mag * √(a) / √(μ) * sin(ΔE)
|
||||
@@ -41,7 +42,7 @@ function laguerre_conway(state::Vector{<:Real}, μ::Float64, time::Float64)
|
||||
sign = dF >= 0 ? 1 : -1
|
||||
ΔH_new = ΔH - n*F / ( dF + sign * √(abs((n-1)^2*dF^2 - n*(n-1)*F*d2F )))
|
||||
i += 1
|
||||
if i > 100 throw(ErrorException("LaGuerre-Conway did not converge!")) end
|
||||
if i > 100 throw(LaGuerreConway_Error("LaGuerre-Conway did not converge!")) end
|
||||
end
|
||||
F = 1 - a/r0_mag * (1-cos(ΔH))
|
||||
G = a * σ0/ √(μ) * (1-cos(ΔH)) + r0_mag * √(-a) / √(μ) * sin(ΔH)
|
||||
|
||||
Reference in New Issue
Block a user