Skip to content

Commit

Permalink
Merge pull request #44 from Space-Systems/dlu/fix_third_body_covarian…
Browse files Browse the repository at this point in the history
…ce_propagation

Dlu/fix third body covariance propagation
  • Loading branch information
danlueck authored Apr 10, 2024
2 parents 6d1b34b + a87e7db commit f16b6fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/thirdbody.f90
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ end function constructor
!! @details This routine computes the acceleration in the GCRF due to third body
!! gravity perturbations. It is based on SPICE routine SPKPOS to compute the
!! position in the GCRF frame (called J2000 in SPICE) for the given time. However
!! the data is interpolated using chebyshev polynomials.
!! the data is interpolated using chebyshev polynomials.
!! Based on Vallado 4th version, chapter 8.6.3 (p. 574, eq. 8-34).
!!
!! \par Overview
!!
Expand Down Expand Up @@ -317,6 +318,9 @@ end function getThirdBodyCovFlag
!> @param[in] time_mjd MJD
!> @param[in] body_id third body identifier (e.g. SUN = 1 or MOON = 2)
!!
!! @details This routine computes the partial derivatives in the GCRF due to third body
!! gravity perturbations. Based on Vallado 4th version, chapter 8.6.3 (p. 578)
!!
!!------------------------------------------------------------------------------------------------
function getThirdBodyCovariance( this, &
solarsystem_model, &
Expand Down Expand Up @@ -393,7 +397,7 @@ function getThirdBodyCovariance( this, &

! 2) part with r**5
!cov = cov + 3.d0*(temp/rabs**2.d0*outerproduct(r_gcrf, r_gcrf) + mu3*outerproduct(rdiff, rdiff)/(mag(rdiff))**5.d0)
cov = cov - 3.d0*mu3*outerproduct(rdiff, rdiff)/(mag(rdiff))**5.d0
cov = cov + 3.d0*mu3*outerproduct(rdiff, rdiff)/(mag(rdiff))**5.d0

!write(*,*) "mu3 = ", mu3
!write(*,*) "rdiff = ", rdiff
Expand Down

0 comments on commit f16b6fb

Please sign in to comment.