temp
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module Thesis
|
||||
|
||||
using LinearAlgebra, ForwardDiff, PlotlyJS, SPICE
|
||||
using LinearAlgebra, ForwardDiff, PlotlyJS, SPICE, Distributed
|
||||
|
||||
try
|
||||
furnsh("../../SPICE/naif0012.tls")
|
||||
|
||||
@@ -11,6 +11,12 @@ function mass_est(T)
|
||||
return ans/n
|
||||
end
|
||||
|
||||
converged(x) = NLsolve.converged(x)
|
||||
|
||||
function converged(_::String)
|
||||
return false
|
||||
end
|
||||
|
||||
function nlp_solve(start::Vector{Float64},
|
||||
final::Vector{Float64},
|
||||
craft::Sc,
|
||||
@@ -25,6 +31,21 @@ function nlp_solve(start::Vector{Float64},
|
||||
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)
|
||||
# return nlsolve(f!, atanh.(x0), ftol=tol, autodiff=:forward, iterations=1_000)
|
||||
p = addprocs(1)
|
||||
response = Channel(1)
|
||||
@async put!(response, remotecall_fetch(nlsolve, 2, f!, atanh.(x0), ftol=tol, autodiff=:forward, iterations=1_000))
|
||||
|
||||
start=time()
|
||||
while !isready(response) && (time() - start) < 30.
|
||||
sleep(0.1)
|
||||
end
|
||||
|
||||
if isready(response)
|
||||
return fetch(response)
|
||||
else
|
||||
rmprocs(p);
|
||||
return "error"
|
||||
end
|
||||
|
||||
end
|
||||
@@ -40,9 +40,7 @@ function mbh(start::AbstractVector,
|
||||
if verbose print("\r",i) end
|
||||
# TODO: Should this be two separate "impatience" values?
|
||||
impatience = 0
|
||||
println("HERE")
|
||||
x_star = nlp_solve(start, final, craft, μ, t0, tf, new_x(n), tol=tol)
|
||||
println("THERE")
|
||||
while converged(x_star) == false && impatience < patience_level
|
||||
impatience += 1
|
||||
x_star = nlp_solve(start, final, craft, μ, t0, tf, new_x(n), tol=tol)
|
||||
|
||||
Reference in New Issue
Block a user