Currently working on refactor, much work to do

This commit is contained in:
Connor
2021-09-25 16:10:02 -06:00
parent 7d0037f38d
commit af545ba1a7
23 changed files with 286 additions and 353 deletions

View File

@@ -4,21 +4,32 @@
using PlotlyJS
# First some setup
sc = Sc("test")
T = rand(3600*2:0.01:3600*4)
start = [oe_to_xyz([ (μs["Earth"]*(T/(2π))^2)^(1/3),
0.1,
π/4,
0.,
0.,
1. ], μs["Earth"]); 10_000.]
# Plot an earth plot
T = rand(2hour : 1 : 4hour)
revs = 30
n = revs*100
ΔVs = repeat([0.9, 0., 0.]', outer=(n,1))
path = prop(ΔVs, start, copy(sc), μs["Earth"], revs*T)[1]
p = plot_orbits([path])
savefig(p,"../plots/plot_test.html")
start = gen_orbit(T, 12_000., Earth)
thrust = spiral(0.9, n, start, test_sc, revs*T, Earth)
path = prop(thrust, start, test_sc, revs*T, Earth)[1]
p = plot_orbits([path], Earth)
savefig(p,"../plots/plot_test_earth.html")
@test typeof(p) == PlotlyJS.SyncPlot
# Now change a little bit and plot around the Sun
# This also checks that the spacecraft are configured right:
# They really shouldn't run out of fuel in 4 years
T = rand(year : hour : 4year)
tof = 4year
start = gen_orbit(T, 12_000.)
thrust = spiral(0.9, n, start, bepi, tof)
sun_paths = Vector{Vector{Vector{Float64}}}()
push!(sun_paths, prop(zeros(100,3), start, bepi, tof)[1])
push!(sun_paths, prop(thrust, start, bepi, tof)[1])
p = plot_orbits(sun_paths)
savefig(p,"../plots/plot_test_sun.html")
@test typeof(p) == PlotlyJS.SyncPlot
end