Made the switch to SNOW. Working well
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user