relative_motion_test Subroutine

public subroutine relative_motion_test()

Unit tests for the relative_motion_module.

Arguments

None

Calls

proc~~relative_motion_test~~CallsGraph proc~relative_motion_test relative_motion_module::relative_motion_test interface~from_ijk_to_lvlh relative_motion_module::from_ijk_to_lvlh proc~relative_motion_test->interface~from_ijk_to_lvlh interface~from_ijk_to_rsw relative_motion_module::from_ijk_to_rsw proc~relative_motion_test->interface~from_ijk_to_rsw proc~from_ijk_to_lvlh_mat relative_motion_module::from_ijk_to_lvlh_mat interface~from_ijk_to_lvlh->proc~from_ijk_to_lvlh_mat proc~from_ijk_to_lvlh_rv relative_motion_module::from_ijk_to_lvlh_rv interface~from_ijk_to_lvlh->proc~from_ijk_to_lvlh_rv proc~from_ijk_to_rsw_mat relative_motion_module::from_ijk_to_rsw_mat interface~from_ijk_to_rsw->proc~from_ijk_to_rsw_mat proc~from_ijk_to_rsw_rv relative_motion_module::from_ijk_to_rsw_rv interface~from_ijk_to_rsw->proc~from_ijk_to_rsw_rv proc~cross vector_module::cross proc~from_ijk_to_lvlh_mat->proc~cross proc~uhat_dot vector_module::uhat_dot proc~from_ijk_to_lvlh_mat->proc~uhat_dot proc~unit vector_module::unit proc~from_ijk_to_lvlh_mat->proc~unit proc~from_ijk_to_lvlh_rv->interface~from_ijk_to_lvlh proc~from_ijk_to_rsw_mat->proc~cross proc~from_ijk_to_rsw_mat->proc~uhat_dot proc~from_ijk_to_rsw_mat->proc~unit proc~from_ijk_to_rsw_rv->interface~from_ijk_to_rsw

Source Code

    subroutine relative_motion_test()

    implicit none

    real(wp),dimension(6),parameter :: target_eci_state = [-2301672.24489839_wp, &
                                                           -5371076.10250925_wp, &
                                                           -3421146.71530212_wp, &
                                                            6133.8624555516_wp,  &
                                                            306.265184163608_wp, &
                                                           -4597.13439017524_wp  ]

    real(wp),dimension(6),parameter :: chaser_eci_state = [-2255213.51862763_wp, &
                                                           -5366553.94133467_wp, &
                                                           -3453871.15040494_wp, &
                                                            6156.89588163809_wp, &
                                                            356.79933181917_wp,  &
                                                           -4565.88915429063_wp  ]

    real(wp),dimension(3) :: r_12_I, r1_I, r2_I
    real(wp),dimension(3) :: v_12_I, v1_I, v2_I
    real(wp),dimension(3) :: r_12_R, v_12_R
    real(wp),dimension(3,3) :: c,cdot

    write(*,*) ''
    write(*,*) '---------------'
    write(*,*) ' relative_motion_test'
    write(*,*) '---------------'
    write(*,*) ''

    r1_I = target_eci_state(1:3)
    v1_I = target_eci_state(4:6)
    r2_I = chaser_eci_state(1:3)
    v2_I = chaser_eci_state(4:6)
    r_12_I = r2_I - r1_I
    v_12_I = v2_I - v1_I

    call from_ijk_to_lvlh(r1_I,v1_I,c=c,cdot=cdot)

    r_12_R = matmul( c, r_12_I )
    v_12_R = matmul( cdot, r_12_I ) + matmul( c, v_12_I )

    write(*,'(A,*(D30.16,1X))') 'r_12_LVLH : ', r_12_R
    write(*,'(A,*(D30.16,1X))') 'v_12_LVLH : ', v_12_R
    write(*,*) ''

    call from_ijk_to_rsw(r1_I,v1_I,c=c,cdot=cdot)

    r_12_R = matmul( c, r_12_I )
    v_12_R = matmul( cdot, r_12_I ) + matmul( c, v_12_I )

    write(*,'(A,*(D30.16,1X))') 'r_12_RSW : ', r_12_R
    write(*,'(A,*(D30.16,1X))') 'v_12_RSW : ', v_12_R
    write(*,*) ''

    end subroutine relative_motion_test