Files
thesis/julia/test/inner_loop/propagator.jl

25 lines
734 B
Julia

@testset "Propagator" begin
println("Testing propagator")
using Thesis: prop_one
# Set up
start_mass = 10_000.
start = gen_orbit(rand(.5year : hour : 2year), start_mass)
stepsize = rand(hour : second : 6hour)
# 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 mass is reduced properly
state = prop_one([1., 0., 0.], start, bepi, stepsize)
@test state[7] == start_mass - bepi.mass_flow_rate*stepsize
# Test that a bad ΔV throws an error
@test_throws Thesis.PropOne_Error prop_one([1.5, 0., 0.], start, bepi, stepsize)
end