Re-packaged

This commit is contained in:
Connor
2021-08-25 15:33:44 -06:00
parent e25d6ff9f4
commit fe627515dc
20 changed files with 584 additions and 137 deletions

View File

@@ -1,4 +1,4 @@
@testset "Single Shooting" begin
@testset "Find Closest" begin
# Initial Setup
sc = Sc("test")
@@ -17,7 +17,7 @@
# This should be close enough to 0.6
x0 = repeat([0.59, 0., 0.], n)
result = single_shoot2(start, final, sc, μs["Earth"], 0.0, prop_time, x0)
result = Thesis.single_shoot(start, final, sc, μs["Earth"], 0.0, prop_time, x0)
# Test and plot
@test result[3] == :XTOL_REACHED
@@ -28,7 +28,7 @@
savefig(plot_orbits([path1, path2, path3, path4],
labels=["inital", "transit", "after transit", "final"],
colors=["#FFFFFF","#FF4444","#44FF44","#4444FF"]),
"single_shoot_test.html")
"plots/find_closest_test.html")
if result[3] == :XTOL_REACHED
@test norm(path2[end,:] - final) < 1e-6
end

View File

@@ -1,4 +1,5 @@
@testset "Laguerre-Conway" begin
using Thesis: laguerre_conway
# Test that the propagator produces good periodic orbits (forwards and backwards)
for T in rand(3600*1.5:3600*4, (5))

View File

@@ -1,5 +1,7 @@
@testset "Plotting" begin
using PlotlyJS
# First some setup
sc = Sc("test")
T = rand(3600*2:0.01:3600*4)
@@ -13,7 +15,7 @@
ΔVs = repeat([0.5, 0., 0.]', outer=(n,1))
path = prop(ΔVs, start, sc, μs["Earth"], 3T)[1]
p = plot_orbits([path])
savefig(p,"plot_test.html")
savefig(p,"../plots/plot_test.html")
@test typeof(p) == PlotlyJS.SyncPlot
end

View File

@@ -1,5 +1,7 @@
@testset "Propagator" begin
using Thesis: prop_one
# Set up
start = oe_to_xyz([ (μs["Earth"]*(rand(3600*1.5:0.01:3600*4)/(2π))^2)^(1/3),
rand(0.01:0.01:0.5),

View File

@@ -1,16 +0,0 @@
@testset "Result Construction" begin
# Test that the standard results can be created
result = Result("test_converged")
@test result.converged == true
@test length(result.ΔVs) == 0
@test length(result.start) == 0
@test length(result.final) == 0
result = Result("test_unconverged")
@test result.converged == false
@test length(result.ΔVs) == 0
@test length(result.start) == 0
@test length(result.final) == 0
end

View File

@@ -1,8 +1,8 @@
using Test
using Random
using LinearAlgebra
using Thesis
include("../main.jl")
# Tests
@testset "All Tests" begin
@@ -10,8 +10,7 @@ include("../main.jl")
include("laguerre-conway.jl")
include("propagator.jl")
include("plotting.jl")
include("result.jl")
include("single_shoot.jl")
include("find_closest.jl")
end
print()