I think I'm pretty much at 2b now

This commit is contained in:
Connor
2021-09-12 19:25:40 -06:00
parent 9de9af2dde
commit e83a705e77
8 changed files with 81 additions and 60 deletions

View File

@@ -24,28 +24,32 @@ function nlp_solve(start::Vector{Float64},
t0::Float64,
tf::Float64,
x0::Matrix{Float64};
tol=1e-6)
tol=1e-6,
num_iters=1_000)
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)
p = addprocs(1)
response = Channel(1)
@async put!(response, remotecall_fetch(nlsolve, 2, f!, atanh.(x0), ftol=tol, autodiff=:forward, iterations=1_000))
# return nlsolve(f!, atanh.(x0), ftol=tol, autodiff=:forward, iterations=num_iters)
start=time()
while !isready(response) && (time() - start) < 30.
sleep(0.1)
end
return nlsolve(f!, atanh.(x0), ftol=tol, iterations=num_iters)
if isready(response)
return fetch(response)
else
rmprocs(p);
return "error"
end
# 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