Seems like a lot changed...

This commit is contained in:
Connor
2022-02-19 12:30:54 -07:00
parent 5d5c79c909
commit 329a2990c5
16 changed files with 532 additions and 273 deletions

View File

@@ -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