Skip to content

Commit

Permalink
Merge branch 'master' into feature/solar-orbiter
Browse files Browse the repository at this point in the history
  • Loading branch information
mlooz committed Oct 1, 2021
2 parents 115601b + ad1fa0a commit f138a4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace kep_toolbox
// mean to eccentric
inline double m2e(const double &M, const double &e)
{
double E = M + e * cos(M);
double E = M + e * sin(M);
newton_raphson(E, boost::bind(kepE, _1, M, e), boost::bind(d_kepE, _1, e), 100, ASTRO_TOLERANCE);
return (E);
}
Expand Down
14 changes: 7 additions & 7 deletions include/keplerian_toolbox/sims_flanagan/leg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ class KEP_TOOLBOX_DLL_PUBLIC leg
for (decltype(n_seg_fwd) i = 0u; i < n_seg_fwd; ++i) {
double thrust_duration
= (throttles[i].get_end().mjd2000() - throttles[i].get_start().mjd2000()) * ASTRO_DAY2SEC;
double manouver_time
double maneuver_time
= (throttles[i].get_start().mjd2000() + throttles[i].get_end().mjd2000()) / 2. * ASTRO_DAY2SEC;
propagate_lagrangian(rfwd, vfwd, manouver_time - current_time_fwd, m_mu);
current_time_fwd = manouver_time;
propagate_lagrangian(rfwd, vfwd, maneuver_time - current_time_fwd, m_mu);
current_time_fwd = maneuver_time;

for (unsigned j = 0u; j < 3; j++) {
dv[j] = max_thrust / mfwd * thrust_duration * throttles[i].get_value()[j];
Expand All @@ -508,12 +508,12 @@ class KEP_TOOLBOX_DLL_PUBLIC leg
double thrust_duration = (throttles[throttles.size() - i - 1].get_end().mjd2000()
- throttles[throttles.size() - i - 1].get_start().mjd2000())
* ASTRO_DAY2SEC;
double manouver_time = (throttles[throttles.size() - i - 1].get_start().mjd2000()
double maneuver_time = (throttles[throttles.size() - i - 1].get_start().mjd2000()
+ throttles[throttles.size() - i - 1].get_end().mjd2000())
/ 2. * ASTRO_DAY2SEC;
// manouver_time - current_time_back is negative, so this should propagate backwards
propagate_lagrangian(rback, vback, manouver_time - current_time_back, m_mu);
current_time_back = manouver_time;
// maneuver_time - current_time_back is negative, so this should propagate backwards
propagate_lagrangian(rback, vback, maneuver_time - current_time_back, m_mu);
current_time_back = maneuver_time;

for (int j = 0; j < 3; j++) {
dv[j] = -max_thrust / mback * thrust_duration * throttles[throttles.size() - i - 1].get_value()[j];
Expand Down

0 comments on commit f138a4b

Please sign in to comment.