earth_moon_frame_matrices Subroutine

public subroutine earth_moon_frame_matrices(seg, et, m, mdot, n, ndot)

The Moon-centered Earth-Moon rotating frame transformations at et (and their time derivatives), consistent with the toolkit's two_body_rotating_frame as used in set_segment_inputs and propagate_segment. Requires the splined ephemeris (for the time derivatives).

Arguments

Type IntentOptional Attributes Name
class(segment), intent(inout) :: seg
real(kind=wp), intent(in) :: et

ephemeris time [sec]

real(kind=wp), intent(out), optional, dimension(6,6) :: m

inertial to rotating

real(kind=wp), intent(out), optional, dimension(6,6) :: mdot

dm/dt

real(kind=wp), intent(out), optional, dimension(6,6) :: n

rotating to inertial

real(kind=wp), intent(out), optional, dimension(6,6) :: ndot

dn/dt


Calls

proc~~earth_moon_frame_matrices~~CallsGraph proc~earth_moon_frame_matrices earth_moon_frame_matrices get_rv get_rv proc~earth_moon_frame_matrices->get_rv get_rv_derivative get_rv_derivative proc~earth_moon_frame_matrices->get_rv_derivative proc~two_body_rotating_frame_matrices two_body_rotating_frame_matrices proc~earth_moon_frame_matrices->proc~two_body_rotating_frame_matrices proc~cross cross proc~two_body_rotating_frame_matrices->proc~cross proc~cross_matrix cross_matrix proc~two_body_rotating_frame_matrices->proc~cross_matrix

Called by

proc~~earth_moon_frame_matrices~~CalledByGraph proc~earth_moon_frame_matrices earth_moon_frame_matrices proc~compute_jacobian_stm mission_type%compute_jacobian_stm proc~compute_jacobian_stm->proc~earth_moon_frame_matrices proc~propagate_segment_stm segment%propagate_segment_stm proc~compute_jacobian_stm->proc~propagate_segment_stm proc~propagate_segment_stm->proc~earth_moon_frame_matrices proc~equilibrate equilibrate proc~equilibrate->proc~compute_jacobian_stm proc~equilibrate_scales mission_type%equilibrate_scales proc~equilibrate_scales->proc~compute_jacobian_stm proc~eclipse_optimize eclipse_optimize proc~eclipse_optimize->proc~equilibrate proc~initialize_the_mission mission_type%initialize_the_mission proc~initialize_the_mission->proc~equilibrate_scales interface~eclipse_optimize my_solver_type%eclipse_optimize interface~eclipse_optimize->proc~eclipse_optimize proc~initialize_the_solver my_solver_type%initialize_the_solver proc~initialize_the_solver->proc~initialize_the_mission proc~halo_solver_main halo_solver_main proc~halo_solver_main->interface~eclipse_optimize proc~halo_solver_main->proc~initialize_the_solver

Source Code

    subroutine earth_moon_frame_matrices(seg, et, m, mdot, n, ndot)

    implicit none

    class(segment),intent(inout) :: seg
    real(wp),intent(in) :: et  !! ephemeris time [sec]
    real(wp),dimension(6,6),intent(out),optional :: m     !! inertial to rotating
    real(wp),dimension(6,6),intent(out),optional :: mdot  !! dm/dt
    real(wp),dimension(6,6),intent(out),optional :: n     !! rotating to inertial
    real(wp),dimension(6,6),intent(out),optional :: ndot  !! dn/dt

    real(wp),dimension(6) :: rv, rvdot
    logical :: status_ok

    select type (eph => seg%eph)
    class is (jpl_ephemeris_splined)
        call eph%get_rv(et,body_moon,body_earth,rv,status_ok)  ! (secondary w.r.t. primary)
        if (status_ok) call eph%get_rv_derivative(et,body_moon,body_earth,rvdot,status_ok)
    class default
        error stop 'error: earth_moon_frame_matrices requires the splined ephemeris'
    end select
    if (.not. status_ok) error stop 'ephemeris error in earth_moon_frame_matrices'

    call two_body_rotating_frame_matrices(rv, rvdot(1:3), rvdot(4:6), m, mdot, n, ndot)

    end subroutine earth_moon_frame_matrices