Skip to content

Commit

Permalink
Merge pull request #42 from open-space-collective/users/robin/j4
Browse files Browse the repository at this point in the history
Implement J4 propagation
  • Loading branch information
robinpdm authored Apr 13, 2021
2 parents e7a5a33 + 33f7b2d commit 81b76d7
Show file tree
Hide file tree
Showing 39 changed files with 21,731 additions and 115 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export jupyter_notebook_port := 9005
export open_space_toolkit_core_version := 0.4.3
export open_space_toolkit_io_version := 0.4.3
export open_space_toolkit_mathematics_version := 0.4.1
export open_space_toolkit_physics_version := 0.5.6
export open_space_toolkit_physics_version := 0.5.7

export open_space_toolkit_core_directory := $(project_directory)/../open-space-toolkit-core
export open_space_toolkit_io_directory := $(project_directory)/../open-space-toolkit-io
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

################################################################################################################################################################

open-space-toolkit-physics==0.5.6
open-space-toolkit-physics==0.5.7

################################################################################################################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_Orbit

class_<Kepler, ostk::astro::trajectory::orbit::Model> kepler_class(aModule, "Kepler") ;

kepler_class.def(init<const COE&, const Instant&, const Derived&, const Length&, const Real&, const Kepler::PerturbationType&>())
kepler_class.def(init<const COE&, const Instant&, const Derived&, const Length&, const Real&, const Real&, const Kepler::PerturbationType&>())

.def(init<const COE&, const Instant&, const Celestial&, const Kepler::PerturbationType&>())
.def(init<const COE&, const Instant&, const Celestial&, const Kepler::PerturbationType&, const bool>())
Expand All @@ -51,6 +51,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_Orbit
.def("get_gravitational_parameter", &Kepler::getGravitationalParameter)
.def("get_equatorial_radius", &Kepler::getEquatorialRadius)
.def("get_j2", &Kepler::getJ2)
.def("get_j4", &Kepler::getJ4)
.def("get_perturbation_type", &Kepler::getPerturbationType)
.def("calculate_state_at", &Kepler::calculateStateAt)
.def("calculate_revolution_number_at", &Kepler::calculateRevolutionNumberAt)
Expand All @@ -63,6 +64,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_Orbit

.value("No", Kepler::PerturbationType::None)
.value("J2", Kepler::PerturbationType::J2)
.value("J4", Kepler::PerturbationType::J4)

;

Expand Down
4 changes: 4 additions & 0 deletions bindings/python/test/trajectory/orbit/models/test_kepler.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def test_trajectory_orbit_models_kepler_getters ():

assert kepler.get_j2() is not None

# get_j4()

assert kepler.get_j4() is not None

# get_perturbation_type()

assert kepler.get_perturbation_type() is not None
Expand Down
2 changes: 1 addition & 1 deletion docker/development/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ RUN mkdir -p /tmp/open-space-toolkit-mathematics \

## Open Space Toolkit ▸ Physics

ARG OSTK_PHYSICS_VERSION=0.5.6
ARG OSTK_PHYSICS_VERSION=0.5.7

RUN mkdir -p /tmp/open-space-toolkit-physics \
&& cd /tmp/open-space-toolkit-physics \
Expand Down
2 changes: 1 addition & 1 deletion docker/development/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ RUN mkdir -p /tmp/open-space-toolkit-mathematics \

## Open Space Toolkit ▸ Physics

ARG OSTK_PHYSICS_VERSION=0.5.6
ARG OSTK_PHYSICS_VERSION=0.5.7

RUN mkdir -p /tmp/open-space-toolkit-physics \
&& cd /tmp/open-space-toolkit-physics \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class Kepler : public ostk::astro::trajectory::orbit::Model
{

None,
J2
J2,
J4

} ;

Expand All @@ -70,6 +71,7 @@ class Kepler : public ostk::astro::trajectory::orbit::Model
const Derived& aGravitationalParameter,
const Length& anEquatorialRadius,
const Real& aJ2,
const Real& aJ4,
const Kepler::PerturbationType& aPerturbationType ) ;

Kepler ( const COE& aClassicalOrbitalElementSet,
Expand Down Expand Up @@ -101,6 +103,8 @@ class Kepler : public ostk::astro::trajectory::orbit::Model

Real getJ2 ( ) const ;

Real getJ4 ( ) const ;

Kepler::PerturbationType getPerturbationType ( ) const ;

virtual State calculateStateAt ( const Instant& anInstant ) const override ;
Expand All @@ -125,6 +129,7 @@ class Kepler : public ostk::astro::trajectory::orbit::Model
Derived gravitationalParameter_ ;
Length equatorialRadius_ ;
Real j2_ ;
Real j4_ ;
Kepler::PerturbationType perturbationType_ ;

static COE InertialCoeFromFixedCoe ( const COE& aClassicalOrbitalElementSet,
Expand Down Expand Up @@ -155,6 +160,22 @@ class Kepler : public ostk::astro::trajectory::orbit::Model
const Length& anEquatorialRadius,
const Real& aJ2 ) ;

static State CalculateJ4StateAt ( const COE& aClassicalOrbitalElementSet,
const Instant& anEpoch,
const Derived& aGravitationalParameter,
const Instant& anInstant,
const Length& anEquatorialRadius,
const Real& aJ2,
const Real& aJ4 ) ;

static Integer CalculateJ4RevolutionNumberAt ( const COE& aClassicalOrbitalElementSet,
const Instant& anEpoch,
const Derived& aGravitationalParameter,
const Instant& anInstant,
const Length& anEquatorialRadius,
const Real& aJ2,
const Real& aJ4 ) ;

} ;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 81b76d7

Please sign in to comment.