Skip to content

Commit

Permalink
Merge pull request #29 from dpad/dev/STM-convenience-functions
Browse files Browse the repository at this point in the history
Add some minor convenience functions for extracting STMs from Dual Trajectories.
  • Loading branch information
dpad authored May 5, 2021
2 parents 1ce6e96 + 978c90f commit 4f1cf33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/dynamics/sensitivities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ end
end

# TODO: Better functions for extracting STMs and stability index from Dual numbers
function extract_STMs(sol::Trajectory, t)
extract_STMs(sol(t))
end
function extract_STMs(sol::Trajectory)
extract_STMs(sol.u)
end
function extract_STMs(state::State)
extract_STMs([state.u0])[1]
end
function extract_STMs(u)
[hcat([Array(t.partials) for t in ut]...)' for ut in u]
end
Expand Down

0 comments on commit 4f1cf33

Please sign in to comment.