Seems like a lot changed...
This commit is contained in:
@@ -1,21 +1,27 @@
|
||||
@testset "Propagator" begin
|
||||
|
||||
println("Testing propagator")
|
||||
using PlotlyJS: savefig
|
||||
|
||||
using Thesis: prop_one
|
||||
println("Testing Propagator")
|
||||
|
||||
# Set up
|
||||
start_mass = 10_000.
|
||||
start = gen_orbit(rand(.5year : hour : 2year), start_mass)
|
||||
stepsize = rand(hour : second : 6hour)
|
||||
time = rand(0.2year : second : 0.5year)
|
||||
n = 1_000
|
||||
|
||||
# Test that Laguerre-Conway is the default propagator for spacecrafts
|
||||
state = prop_one([0., 0., 0.], start, no_thrust, stepsize)
|
||||
@test laguerre_conway(start, stepsize) ≈ state[1:6]
|
||||
@test state[7] == start_mass
|
||||
# Test that Propagation works
|
||||
states = prop(zeros(n,3), start, no_thrust, time)
|
||||
@test states[1,:] != states[end,:]
|
||||
|
||||
# Test that mass is reduced properly
|
||||
state = prop_one([1., 0., 0.], start, bepi, stepsize)
|
||||
@test state[7] == start_mass - mfr(bepi)*stepsize
|
||||
|
||||
states = prop(ones(n,3)/√3, start, bepi, time)
|
||||
@test states[end,7] ≈ start_mass - mfr(bepi)*time
|
||||
|
||||
# Test that the propagator works backwards
|
||||
backwards = prop(ones(n,3)/√3, states[end,:], bepi, -time)
|
||||
p = plot([states, backwards])
|
||||
savefig(p,"../plots/prop_back.html")
|
||||
@test backwards[end,:] ≈ start
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user