NLP seems to be doing pretty well

This commit is contained in:
Connor
2021-10-10 20:53:14 -06:00
parent f83d73449f
commit b29afbce04
13 changed files with 524 additions and 198 deletions

View File

@@ -56,7 +56,20 @@ function prop(ΔVs::Matrix{T},
for k in 1:7 push!(states[k], interpolated_state[k]) end
end
end
state = prop_one(ΔVs[i,:], state, craft, time/n, primary)
try
state = prop_one(ΔVs[i,:], state, craft, time/n, primary)
catch e
if isa(e,PropOne_Error)
for val in e.ΔV_unit
# If this isn't true, then we just let it slide
if abs(val) > 1.0001
rethrow()
end
end
else
rethrow()
end
end
for j in 1:7 push!(states[j], state[j]) end
state[7] >= craft.dry_mass || throw(Mass_Error(state[7]))
end
@@ -68,4 +81,4 @@ end
"""
Convenience function for propagating a state with no thrust
"""
prop(x::Vector{Float64}, t::Float64, p::Body=Sun) = prop(zeros(1000,3), [x;1e10], no_thrust, t, p)[1]
prop(x::Vector{Float64}, t::Float64, p::Body=Sun) = prop(zeros(1000,3), [x;1.], no_thrust, t, p)[1]