Unit tests for the relative_motion_module.
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