No progress made really...

This commit is contained in:
Connor
2021-08-25 10:10:22 -06:00
parent 966f954528
commit e25d6ff9f4
5 changed files with 95 additions and 35 deletions

View File

@@ -27,9 +27,9 @@
@test craft.mass == start_mass - craft.mass_flow_rate*stepsize
# Test that a bad ΔV throws an error
craft = Sc("test")
start_mass = craft.mass
@test_throws ErrorException prop_one([1.5, 0., 0.], start, craft, μs["Earth"], stepsize)
# craft = Sc("test")
# start_mass = craft.mass
# @test_throws ErrorException prop_one([1.5, 0., 0.], start, craft, μs["Earth"], stepsize)
# Test that a full propagation doesn't take too long

View File

@@ -6,26 +6,31 @@
e = rand(0.01:0.01:0.5)
i = rand(0.01:0.01:π/6)
T = 2π*(a^3/μs["Earth"])
prop_time = 2T
n = 50
# A simple orbit raising
start = oe_to_xyz([ a, e, i, 0., 0., 0. ], μs["Earth"])
ΔVs = repeat([0.6, 0., 0.]', outer=(n,1))
final = prop(ΔVs, start, sc, μs["Earth"], T)[1][end,:]
final = prop(ΔVs, start, sc, μs["Earth"], prop_time)[1][end,:]
new_T = 2π*(xyz_to_oe(final, μs["Earth"])[1]^3/μs["Earth"])
# This should be close enough to 0.6
x0 = repeat([atanh((0.4-0.5)/0.5), 0., 0.], n)
result = single_shoot(start, final, sc, μs["Earth"], 0.0, T, n, x0)
x0 = repeat([0.59, 0., 0.], n)
result = single_shoot2(start, final, sc, μs["Earth"], 0.0, prop_time, x0)
# Test and plot
@test converged(result)
@test result[3] == :XTOL_REACHED
path1 = prop(zeros((100,3)), start, sc, μs["Earth"], T)[1]
path2, mass = prop(treat_inputs(result.zero, n), start, sc, μs["Earth"], T)
path3 = prop(zeros((100,3)), path2[end,:], sc, μs["Earth"], T)[1]
savefig(plot_orbits([path1, path2, path3]), "single_shoot_test.html")
if converged(result)
@test norm(path2[end,:] - final) < 2e-2
sc = Sc("test")
path2, mass = prop(treat_inputs(result[2]), start, sc, μs["Earth"], prop_time)
path3 = prop(zeros((100,3)), path2[end,:], sc, μs["Earth"], new_T)[1]
path4 = prop(zeros((100,3)), final, sc, μs["Earth"], new_T)[1]
savefig(plot_orbits([path1, path2, path3, path4],
labels=["inital", "transit", "after transit", "final"],
colors=["#FFFFFF","#FF4444","#44FF44","#4444FF"]),
"single_shoot_test.html")
if result[3] == :XTOL_REACHED
@test norm(path2[end,:] - final) < 1e-6
end
end