Files
thesis/julia/test/laguerre-conway.jl
2021-10-29 19:36:44 -06:00

35 lines
817 B
Julia

@testset "Laguerre-Conway" begin
println("Testing LaGuerre-Conway")
using Thesis: laguerre_conway
# Test that the propagator produces good periodic orbits (forwards and backwards)
μ = Earth.μ
for T in rand(3600*1.5:3600*4, 5)
e = rand(0.0:0.01:0.75)
i = rand(0.0:0.01:0.499π)
start = [ oe_to_xyz([ (μ*(T/(2π))^2)^(1/3), e, i, 0., 0., 1. ], μ); 12_000. ]
orbit = start
for _ in 1:5
i = 0.
while i < T
orbit = laguerre_conway(orbit, 1., Earth)
i += 1
end
@test i T
@test norm(orbit[1:6] - start[1:6]) < 1e-2
end
for _ in 1:5
i = 0.
while i > -T
orbit = laguerre_conway(orbit, -1., Earth)
i -= 1
end
@test i -T
@test norm(orbit[1:6] - start[1:6]) < 1e-2
end
end
end