temporary point on the inner loop wrapper

This commit is contained in:
Connor
2021-09-02 21:40:19 -06:00
parent 4d180f577a
commit 9298a7a6f3
19 changed files with 96 additions and 23 deletions

View File

@@ -0,0 +1,30 @@
using NLsolve
export nlp_solve, mass_est
function mass_est(T)
ans = 0
n = Int(length(T)/3)
for i in 1:n
ans += norm(T[i,:])
end
return ans/n
end
function nlp_solve(start::Vector{Float64},
final::Vector{Float64},
craft::Sc,
μ::Float64,
t0::Float64,
tf::Float64,
x0::Matrix{Float64};
tol=1e-6)
function f!(F,x)
F .= 0.0
F[1:6, 1] .= prop_nlsolve(tanh.(x), start, craft, μ, tf-t0) .- final
end
return nlsolve(f!, atanh.(x0), ftol=tol, autodiff=:forward, iterations=1_000)
end