I think tests are passing again
This commit is contained in:
		| @@ -7,4 +7,5 @@ unit-test-job: | |||||||
|     - apt-get update |     - apt-get update | ||||||
|     - apt-get -y upgrade |     - apt-get -y upgrade | ||||||
|     - apt-get install -y unzip |     - apt-get install -y unzip | ||||||
|  |     - mkdir julia/plots | ||||||
|     - julia --project=julia/Project.toml -E 'using Pkg; Pkg.test()' |     - julia --project=julia/Project.toml -E 'using Pkg; Pkg.test()' | ||||||
|   | |||||||
| @@ -12,8 +12,9 @@ function single_shoot(start::Vector{Float64}, | |||||||
|                       t0::Float64, |                       t0::Float64, | ||||||
|                       tf::Float64, |                       tf::Float64, | ||||||
|                       x0::AbstractVector, |                       x0::AbstractVector, | ||||||
|                       tol=1e-2) |                       tol=1e-8) | ||||||
|  |  | ||||||
|  |   n::Int = length(x0)/3 | ||||||
|   function f!(F,x) |   function f!(F,x) | ||||||
|     F[1:6] .= prop(treat_inputs(x), start, craft, μ, tf-t0)[1][end,:] - final |     F[1:6] .= prop(treat_inputs(x), start, craft, μ, tf-t0)[1][end,:] - final | ||||||
|     F[7:3n] .= 0. |     F[7:3n] .= 0. | ||||||
|   | |||||||
| @@ -1,5 +1,8 @@ | |||||||
| @testset "Find Closest" begin | @testset "Find Closest" begin | ||||||
|  |  | ||||||
|  |    using NLsolve | ||||||
|  |    using Thesis: treat_inputs | ||||||
|  |  | ||||||
|   # Initial Setup |   # Initial Setup | ||||||
|   sc = Sc("test") |   sc = Sc("test") | ||||||
|   a = rand(15000:1.:40000) |   a = rand(15000:1.:40000) | ||||||
| @@ -20,16 +23,16 @@ | |||||||
|   result = Thesis.single_shoot(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 and plot | ||||||
|   @test result[3] == :XTOL_REACHED |   @test converged(result) | ||||||
|   path1 = prop(zeros((100,3)), start, sc, μs["Earth"], T)[1] |   path1 = prop(zeros((100,3)), start, sc, μs["Earth"], T)[1] | ||||||
|   path2, mass = prop(treat_inputs(result[2]), start, sc, μs["Earth"], prop_time) |   path2, mass = prop(treat_inputs(result.zero), start, sc, μs["Earth"], prop_time) | ||||||
|   path3 = prop(zeros((100,3)), path2[end,:], sc, μs["Earth"], new_T)[1] |   path3 = prop(zeros((100,3)), path2[end,:], sc, μs["Earth"], new_T)[1] | ||||||
|   path4 = prop(zeros((100,3)), final, sc, μs["Earth"], new_T)[1] |   path4 = prop(zeros((100,3)), final, sc, μs["Earth"], new_T)[1] | ||||||
|   savefig(plot_orbits([path1, path2, path3, path4], |   savefig(plot_orbits([path1, path2, path3, path4], | ||||||
|                       labels=["inital", "transit", "after transit", "final"], |                       labels=["inital", "transit", "after transit", "final"], | ||||||
|                       colors=["#FFFFFF","#FF4444","#44FF44","#4444FF"]), |                       colors=["#FFFFFF","#FF4444","#44FF44","#4444FF"]), | ||||||
|           "plots/find_closest_test.html") |           "../plots/find_closest_test.html") | ||||||
|   if result[3] == :XTOL_REACHED |   if converged(result) | ||||||
|     @test norm(path2[end,:] - final) < 1e-6 |     @test norm(path2[end,:] - final) < 1e-6 | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Connor
					Connor