Still not working. Up to the loop though.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
@testset "Find Closest" begin
|
||||
|
||||
using JuMP
|
||||
using Thesis: treat_inputs
|
||||
|
||||
# Initial Setup
|
||||
sc = Sc("test")
|
||||
@@ -14,12 +13,17 @@
|
||||
|
||||
# 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"], prop_time)[3]
|
||||
Tx, Ty, Tz = conv_T(repeat([0.6], n), repeat([0.], n), repeat([0.], n),
|
||||
start,
|
||||
sc.mass,
|
||||
sc,
|
||||
prop_time,
|
||||
μs["Earth"])
|
||||
final = prop(hcat(Tx, Ty, Tz), start, sc, μs["Earth"], prop_time)[3]
|
||||
new_T = 2π*√(xyz_to_oe(final, μs["Earth"])[1]^3/μs["Earth"])
|
||||
|
||||
# This should be close enough to 0.6
|
||||
Tr, TΘ, Th = conv_T(repeat([0.6], n), repeat([0.], n), repeat([0.], n),
|
||||
Tx, Ty, Tz = conv_T(repeat([0.6], n), repeat([0.], n), repeat([0.], n),
|
||||
start,
|
||||
sc.mass,
|
||||
sc,
|
||||
@@ -31,9 +35,10 @@
|
||||
μs["Earth"],
|
||||
0.0,
|
||||
prop_time,
|
||||
Tr,
|
||||
TΘ,
|
||||
Th)
|
||||
Tx,
|
||||
Ty,
|
||||
Tz)
|
||||
# solver_options=("max_cpu_time" => 30.))
|
||||
|
||||
# Test and plot
|
||||
@test JuMP.termination_status(result) == MOI.OPTIMAL
|
||||
@@ -44,7 +49,7 @@
|
||||
savefig(plot_orbits([path1, path2, path3, path4],
|
||||
labels=["initial", "transit", "after transit", "final"],
|
||||
colors=["#FFFFFF","#FF4444","#44FF44","#4444FF"]),
|
||||
"../plots/find_closest_test.html")
|
||||
"../plots/find_closest_test.html")
|
||||
# if termination_status(result) == :OPTIMAL
|
||||
# @test norm(calc_final - final) < 1e-4
|
||||
# end
|
||||
|
||||
Reference in New Issue
Block a user