Made the switch to SNOW. Working well
This commit is contained in:
@@ -37,9 +37,10 @@
|
||||
earth_state = [spkssb(Earth.id, time_leave, "ECLIPJ2000"); 0.0]
|
||||
venus_state = [spkssb(Venus.id, time_arrive, "ECLIPJ2000"); 0.0]
|
||||
v∞_out, v∞_in, tof = Thesis.lamberts(Earth, Venus, leave, arrive)
|
||||
phase = Phase(Venus, 1.0001v∞_in, 0.2, tof, 0.0*ones(20,3))
|
||||
phase = Phase(Venus, 1.01v∞_in, 0.2, tof, 0.01*ones(20,3))
|
||||
mission_guess = Mission_Guess(bepi, 12_000., leave, v∞_out, [phase])
|
||||
mission = Thesis.inner_loop_solve(mission_guess)
|
||||
@test mission.converged
|
||||
if !mission.converged println(mission.message) end
|
||||
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
println("Testing NLP solver")
|
||||
|
||||
using NLsolve, PlotlyJS
|
||||
using SNOW, PlotlyJS
|
||||
|
||||
# First we'll test an Earth case
|
||||
# Initial Setup
|
||||
@@ -19,12 +19,14 @@
|
||||
|
||||
# This should be close enough to converge, but Earth orbits are picky
|
||||
thrust_guess = spiral(0.89, n, start, test_sc, revs*T, Earth)
|
||||
result = solve_phase(start, final, test_sc, revs*T, thrust_guess, Earth)
|
||||
calc_path, calc_final = prop(result.zero, start, test_sc, revs*T, Earth, interpolate=true)
|
||||
guess_final = prop(thrust_guess, start, test_sc, revs*T, Earth)[2]
|
||||
result = solve_phase(start, final, test_sc, revs*T, thrust_guess, Earth, verbose=true)
|
||||
calc_path, calc_final = prop(result.sol, start, test_sc, revs*T, Earth, interpolate=true)
|
||||
|
||||
# Test
|
||||
@test converged(result)
|
||||
@test norm(calc_final[1:6] - final[1:6]) < 1e-5
|
||||
@test norm(guess_final[1:6] - final[1:6]) > 1e-4
|
||||
@test result.converged
|
||||
@test norm(calc_final[1:6] - final[1:6]) < 1e-4
|
||||
|
||||
# Plot
|
||||
paths = Pathlist()
|
||||
@@ -51,12 +53,14 @@
|
||||
|
||||
# This should be close enough to converge
|
||||
thrust_guess = spiral(0.55, n, start, bepi, tof)
|
||||
result = solve_phase(start, final, bepi, tof, thrust_guess)
|
||||
calc_path, calc_final = prop(result.zero, start, bepi, tof, interpolate=true)
|
||||
guess_final = prop(thrust_guess, start, bepi, tof)[2]
|
||||
result = solve_phase(start, final, bepi, tof, thrust_guess, verbose=true)
|
||||
calc_path, calc_final = prop(result.sol, start, bepi, tof, interpolate=true)
|
||||
|
||||
# Test
|
||||
@test converged(result)
|
||||
@test norm(calc_final[1:6] - final[1:6]) < 1e-5
|
||||
@test norm(guess_final[1:6] - final[1:6]) > 1e-4
|
||||
@test result.converged
|
||||
@test norm(calc_final[1:6] - final[1:6]) < 1e-4
|
||||
|
||||
# Plot
|
||||
paths = Pathlist()
|
||||
|
||||
@@ -13,9 +13,9 @@ catch
|
||||
end
|
||||
|
||||
@testset "All Tests" begin
|
||||
# include("plotting.jl")
|
||||
# include("inner_loop/laguerre-conway.jl")
|
||||
# include("inner_loop/propagator.jl")
|
||||
# include("inner_loop/phase.jl")
|
||||
include("plotting.jl")
|
||||
include("inner_loop/laguerre-conway.jl")
|
||||
include("inner_loop/propagator.jl")
|
||||
include("inner_loop/phase.jl")
|
||||
include("inner_loop/monotonic_basin_hopping.jl")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user