Update for meeting with Bosanac

This commit is contained in:
Connor
2021-10-07 15:56:11 -06:00
parent cd1806058d
commit f83d73449f
12 changed files with 2313 additions and 141 deletions

View File

@@ -0,0 +1,36 @@
@testset "Phase" begin
println("Testing NLP solver")
# We'll start by testing the mission_guess -> vector function
vec = Vector(test_mg)
@test typeof(vec) == Vector{Float64}
# Now we go in the other direction
flybys = [ p.planet for p in test_mg.phases ]
guess = Mission_Guess(vec, test_mg.sc, test_mg.start_mass, flybys)
@test typeof(guess) == Mission_Guess
@test guess.sc == test_mg.sc
@test guess.start_mass == test_mg.start_mass
@test guess.launch_date == test_mg.launch_date
@test guess.launch_v∞ == test_mg.launch_v∞
@test guess.converged == test_mg.converged
for i in 1:length(guess.phases)
@test guess.phases[i].planet == test_mg.phases[i].planet
@test guess.phases[i].v∞_in == test_mg.phases[i].v∞_in
@test guess.phases[i].v∞_out == test_mg.phases[i].v∞_out
@test guess.phases[i].tof == test_mg.phases[i].tof
@test guess.phases[i].thrust_profile == test_mg.phases[i].thrust_profile
end
# Now we test an example run of the basic "inner function"
leave, arrive = DateTime(1992,11,19), DateTime(1993,4,1)
earth_state = state(Earth, leave)
venus_state = state(Venus, arrive)
v∞_out, v∞_in, tof = Thesis.lamberts(Earth, Venus, leave, arrive)
phase = Phase(Venus, v∞_in, v∞_in, tof, zeros(20,3))
guess = Mission_Guess(bepi, 12_000., leave, v∞_out, [phase])
g = solve_mission(guess)
println(g)
end