NLP seems to be doing pretty well

This commit is contained in:
Connor
2021-10-10 20:53:14 -06:00
parent f83d73449f
commit b29afbce04
13 changed files with 524 additions and 198 deletions

View File

@@ -2,34 +2,55 @@
println("Testing plotting features")
using PlotlyJS
using PlotlyJS: savefig, SyncPlot
# Plot an earth plot
T = rand(2hour : 1 : 4hour)
revs = 30
n = revs*100
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
# Generate a couple of useful paths
T = rand(year : hour : 4year)
tof = 4year
n = 4_000
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
spiral_path = prop(thrust, start, bepi, tof)[1]
no_thrust_path = prop(zeros(n,3), start, bepi, tof)[1]
paths = [ spiral_path, no_thrust_path ]
# First let's plot a single basic path
p = plot(spiral_path)
savefig(p,"../plots/plot_test_path.html")
@test typeof(p) == SyncPlot
# Next I just want to plot a planet both not moving...
p = plot(Jupiter, Dates.now(), title="Jupiter")
savefig(p,"../plots/plot_test_planet_nomove.html")
@test typeof(p) == SyncPlot
# ...and moving
p = plot(Venus, Dates.now(), 0.95period(Venus), title="Venus")
savefig(p,"../plots/plot_test_planet_move.html")
@test typeof(p) == SyncPlot
# Next I want to plot the entire solar system
p = plot([Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto],
Dates.now(),
title="The Solar System")
savefig(p,"../plots/plot_test_solar_system.html")
@test typeof(p) == SyncPlot
# Next I want to plot a vector of states
p = plot(paths,
labels = ["No Thrust Orbit","Thrust Spiral"],
title = "Vector of Paths Plot Test")
savefig(p,"../plots/plot_test_paths.html")
@test typeof(p) == SyncPlot
# And finally, I'd like to plot a mission guess...
p = plot(test_mg)
savefig(p,"../plots/plot_test_mission_guess.html")
@test typeof(p) == SyncPlot
# ...and a mission
p = plot(Mission(test_mg))
savefig(p,"../plots/plot_test_mission.html")
@test typeof(p) == SyncPlot
end