From 7b161defee933af717dd671e1aa52a6c2cf5b3a0 Mon Sep 17 00:00:00 2001 From: Andy Goldschmidt Date: Wed, 8 Nov 2023 15:32:03 -0600 Subject: [PATCH] min time unequal step fix --- src/objectives.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/objectives.jl b/src/objectives.jl index 7f3247a5..6d972049 100644 --- a/src/objectives.jl +++ b/src/objectives.jl @@ -637,11 +637,11 @@ function MinimumTimeObjective(; ) # TODO: amend this for case of no TimeStepsAllEqualConstraint - L(Z⃗::AbstractVector, Z::NamedTrajectory) = D * Z⃗[Δt_indices][end] + L(Z⃗::AbstractVector, Z::NamedTrajectory) = D * sum(Z⃗[Δt_indices]) ∇L = (Z⃗::AbstractVector, Z::NamedTrajectory) -> begin ∇ = zeros(typeof(Z⃗[1]), length(Z⃗)) - ∇[Δt_indices[end]] = D + ∇[Δt_indices] .= D return ∇ end