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

24
julia/src/find_closest.jl Normal file
View File

@@ -0,0 +1,24 @@
using NLsolve
function treat_inputs(x::AbstractVector)
n::Int = length(x)/3
reshape(x,(3,n))'
end
function single_shoot(start::Vector{Float64},
final::Vector{Float64},
craft::Sc,
μ::Float64,
t0::Float64,
tf::Float64,
x0::AbstractVector,
tol=1e-2)
function f!(F,x)
F[1:6] .= prop(treat_inputs(x), start, craft, μ, tf-t0)[1][end,:] - final
F[7:3n] .= 0.
end
return nlsolve(f!, x0, ftol=tol, autodiff=:forward, iterations=10_000)
end