Skip to content

Commit

Permalink
Fix boundary_projection
Browse files Browse the repository at this point in the history
  • Loading branch information
LuEdRaMo committed Jan 2, 2024
1 parent 0860144 commit af451b6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/orbit_determination/tooshortarc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,15 @@ function boundary_projection(A::AdmissibleRegion{T}, ρ::T, v_ρ::T) where {T <:
# Project range
ρ = clamp(ρ, A.ρ_domain[1], A.ρ_domain[2])
# Project range-rate
y_min, y_max = range_rate(A, ρ)
v_ρ = clamp(v_ρ, y_min, y_max)

y_domain = range_rate(A, ρ)
if iszero(length(y_domain))
v_ρ = sum(A.v_ρ_domain) / 2
elseif isone(length(y_domain))
v_ρ = y_domain[1]
else
v_ρ = clamp(v_ρ, y_domain[1], y_domain[2])
end

return ρ, v_ρ
end

Expand Down

0 comments on commit af451b6

Please sign in to comment.