I think I'm pretty much at 2b now
This commit is contained in:
@@ -47,23 +47,28 @@ function inner_loop(launch_date::DateTime,
|
||||
|
||||
time = utc2et(Dates.format(launch_date,"yyyy-mm-ddTHH:MM:SS"))
|
||||
thrust_profiles = []
|
||||
for phase in phases
|
||||
planet1_state = spkssb(ids[phase.from_planet], time, "J2000")
|
||||
time += phase.time_of_flight
|
||||
planet2_state = spkssb(ids[phase.to_planet], time, "J2000")
|
||||
# TODO: Come up with improved method of calculating "n"
|
||||
start = planet1_state + [0., 0., 0., phase.v∞_outgoing...]
|
||||
final = planet2_state + [0., 0., 0., phase.v∞_incoming...]
|
||||
if mbh_specs == nothing
|
||||
best = mbh(start, final, craft, μs["Sun"], 0.0, phase.time_of_flight, 10,
|
||||
verbose=verbose)[1]
|
||||
else
|
||||
best = mbh(start, final, craft, μs["Sun"], 0.0, phase.time_of_flight, 10,
|
||||
verbose=verbose, num_iters=mbh_specs[1], patience_level=mbh_specs[2])[1]
|
||||
try
|
||||
for phase in phases
|
||||
planet1_state = spkssb(ids[phase.from_planet], time, "J2000")
|
||||
time += phase.time_of_flight
|
||||
planet2_state = spkssb(ids[phase.to_planet], time, "J2000")
|
||||
# TODO: Come up with improved method of calculating "n"
|
||||
start = planet1_state + [0., 0., 0., phase.v∞_outgoing...]
|
||||
final = planet2_state + [0., 0., 0., phase.v∞_incoming...]
|
||||
if mbh_specs === nothing
|
||||
best = mbh(start, final, craft, μs["Sun"], 0.0, phase.time_of_flight, 10,
|
||||
verbose=verbose)[1]
|
||||
else
|
||||
num_iters, sil, dil = mbh_specs
|
||||
best = mbh(start, final, craft, μs["Sun"], 0.0, phase.time_of_flight, 10,
|
||||
verbose=verbose, num_iters=num_iters, search_patience_lim=sil,
|
||||
drill_patience_lim=dil)
|
||||
end
|
||||
push!(thrust_profiles, best)
|
||||
craft.mass = prop(tanh.(best.zero), planet1_state, sc, μs["Sun"], prop_time)[2][end]
|
||||
end
|
||||
push!(thrust_profiles, best)
|
||||
craft.mass = prop(tanh.(best.zero), planet1_state, sc, μs["Sun"], prop_time)[2][end]
|
||||
return craft.mass, thrust_profiles
|
||||
catch
|
||||
return "One path did not converge"
|
||||
end
|
||||
|
||||
return craft.mass, thrust_profiles
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user