Skip to content

Commit

Permalink
fix small
Browse files Browse the repository at this point in the history
  • Loading branch information
YuseiAlexS committed Sep 24, 2024
1 parent 17d324b commit 280b6ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 236 deletions.
3 changes: 2 additions & 1 deletion src/dynamics/orbit/relative_orbit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <math_physics/math/ordinary_differential_equation.hpp>
#include <math_physics/orbit/relative_orbit_models.hpp>
#include <math_physics/orbit/relative_orbit_yamanaka_ankersen.hpp>
#include <math_physics/orbit/relative_orbit_carter.hpp>
#include <simulation/multiple_spacecraft/relative_information.hpp>
#include <string>

Expand Down Expand Up @@ -87,7 +88,7 @@ class RelativeOrbit : public Orbit, public math::OrdinaryDifferentialEquation<6>
orbit::StmModel stm_model_type_; //!< State Transition Matrix model type
RelativeInformation* relative_information_; //!< Relative information
orbit::RelativeOrbitYamanakaAnkersen* relative_orbit_yamanaka_ankersen_; //!< Relative Orbit Calcilater with Yamanaka-Ankersen's STM
orbit::RelativeOrbitYamanakaCarter* relative_orbit_carter_; //!< Relative Orbit Calcilater with Carter's STM
orbit::RelativeOrbitCarter* relative_orbit_carter_; //!< Relative Orbit Calcilater with Carter's STM

/**
* @fn InitializeState
Expand Down
226 changes: 0 additions & 226 deletions src/library/orbit/relative_orbit_models.cpp

This file was deleted.

10 changes: 5 additions & 5 deletions src/math_physics/orbit/relative_orbit_carter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file relative_orbit_models.cpp
* @brief Functions to calculate Yamanaka-ANkersen STM for relative orbit
* @file relative_orbit_carter.cpp
* @brief Functions to calculate Carter's STM for relative orbit
*/
#include "relative_orbit_carter.hpp"

Expand All @@ -16,17 +16,17 @@ RelativeOrbitCarter::~RelativeOrbitCarter() {}

void RelativeOrbitCarter::CalculateInitialInverseMatrix(double orbit_radius_m, double gravity_constant_m3_s2, double f_ref_rad,
OrbitalElements* reference_oe) {
double n = sqrt(gravity_constant_m3_s2 / pow(orbit_radius_m, 3));
// double n = sqrt(gravity_constant_m3_s2 / pow(orbit_radius_m, 3));
double e = reference_oe->GetEccentricity();
double E_rad = 2 * atan(sqrt((1 - e) / (1 + e)) * tan(f_ref_rad / 2));
double k = e * cos(f_ref_rad) + 1;
double K1 = pow(1 - e * e, -2.5) * (-1.5 * e * E_rad + (1 + e * e) * sin(E_rad) - e * sin(2. * E_rad) / 4.);
// double K1 = pow(1 - e * e, -2.5) * (-1.5 * e * E_rad + (1 + e * e) * sin(E_rad) - e * sin(2. * E_rad) / 4.);
double K2 = pow(1 - e * e, -2.5) * (0.5 * E_rad - 0.25 * sin(2 * E_rad) - e * pow(sin(E_rad), 3) / 3.);
double phi1 = sin(f_ref_rad) * k;
double phi2 = 2 * e * phi1 * (sin(f_ref_rad) / pow(k, 3) - K2) - cos(f_ref_rad) / k;
double phi3 = (6 * e * phi1 * K2 - (2 * pow(sin(f_ref_rad), 2) / pow(k, 2)) - (pow(cos(f_ref_rad), 2) / k) - pow(cos(f_ref_rad), 2));
double phi1_prime = cos(f_ref_rad) * k - e * pow(sin(f_ref_rad), 2);
double sigma4 = atan(tan(f_ref_rad / 2) * sqrt(-(e - 1) / (e + 1)));
// double sigma4 = atan(tan(f_ref_rad / 2) * sqrt(-(e - 1) / (e + 1)));
double term1_phi2_prime = sin(f_ref_rad) / k;
double term2_phi2_prime = 2 * e * sin(f_ref_rad) * k * (cos(f_ref_rad) / pow(k, 3)) - (cos(f_ref_rad) / pow(1 - pow(e, 2), 5.0 / 2.0));
double phi2_prime = term1_phi2_prime + term2_phi2_prime;
Expand Down
8 changes: 4 additions & 4 deletions src/math_physics/orbit/relative_orbit_carter.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* @file relative_orbit_yamanaka_ankersen.hpp
* @brief Functions to calculate Yamanaka-ANkersen STM for relative orbit
* @file relative_orbit_carter.hpp
* @brief Functions to calculate Carter's STM for relative orbit
*/

#ifndef S2E_LIBRARY_ORBIT_RELATIVE_ORBIT_YAMANAKA_ANKERSEN_HPP_
#define S2E_LIBRARY_ORBIT_RELATIVE_ORBIT_YAMANAKA_ANKERSEN_HPP_
#ifndef S2E_LIBRARY_ORBIT_RELATIVE_ORBIT_CARTER_HPP_
#define S2E_LIBRARY_ORBIT_RELATIVE_ORBIT_CARTER_HPP_

#include "../math/matrix.hpp"
#include "./orbital_elements.hpp"
Expand Down

0 comments on commit 280b6ea

Please sign in to comment.