relative_motion_module Module

This module contains various routines related to relative motion.

Axis systems

Three different axis systems are used here. They are:

  • The IJK frame

  • The LVLH frame, defined by:

    • x-axis : completes the right handed system (for a perfectly-circular orbit, the x-axis is )
    • y-axis :
    • z-axis :
  • The RSW frame, defined by:

    • x-axis :
    • y-axis : completes the right handed system (for a perfectly-circular orbit, the y-axis is )
    • z-axis :

Uses

  • module~~relative_motion_module~~UsesGraph module~relative_motion_module relative_motion_module module~kind_module kind_module module~relative_motion_module->module~kind_module module~numbers_module numbers_module module~relative_motion_module->module~numbers_module iso_fortran_env iso_fortran_env module~kind_module->iso_fortran_env module~numbers_module->module~kind_module

Used by

  • module~~relative_motion_module~~UsedByGraph module~relative_motion_module relative_motion_module module~fortran_astrodynamics_toolkit fortran_astrodynamics_toolkit module~fortran_astrodynamics_toolkit->module~relative_motion_module

Interfaces

public interface from_ijk_to_lvlh

Conversion from IJK to LVLH

  • private subroutine from_ijk_to_lvlh_mat(r, v, a, c, cdot)

    Author
    Jacob Williams
    Date
    4/19/2014

    Compute the transformation matrices to convert IJK to LVLH.

    See also

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: r

    position vector of target [km]

    real(kind=wp), intent(in), dimension(3) :: v

    velocity vector of target [km/s]

    real(kind=wp), intent(in), optional, dimension(3) :: a

    acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

    real(kind=wp), intent(out), dimension(3,3) :: c

    C transformation matrix

    real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

    CDOT transformation matrix

  • private subroutine from_ijk_to_lvlh_rv(rt_ijk, vt_ijk, r_ijk, v_ijk, dr_lvlh, dv_lvlh)

    Author
    Jacob Williams
    Date
    8/23/2014

    Transform a position (and optionally velocity) vector from IJK to LVLH.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: rt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: vt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: r_ijk

    Chaser IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: v_ijk

    Chaser IJK absolute position vector [km]

    real(kind=wp), intent(out), dimension(3) :: dr_lvlh

    Chaser LVLH position vector relative to target [km]

    real(kind=wp), intent(out), optional, dimension(3) :: dv_lvlh

    Chaser LVLH position vector relative to target [km]

public interface from_lvlh_to_ijk

Conversion from LVLH to IJK

  • private subroutine from_lvlh_to_ijk_mat(r, v, a, c, cdot)

    Author
    Jacob Williams
    Date
    4/19/2014

    Compute the transformation matrices to convert LVLH to IJK.

    See also

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: r

    position vector of target [km]

    real(kind=wp), intent(in), dimension(3) :: v

    velocity vector of target [km/s]

    real(kind=wp), intent(in), optional, dimension(3) :: a

    acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

    real(kind=wp), intent(out), dimension(3,3) :: c

    C transformation matrix

    real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

    CDOT transformation matrix

  • private subroutine from_lvlh_to_ijk_rv(rt_ijk, vt_ijk, dr_lvlh, dv_lvlh, r_ijk, v_ijk)

    Author
    Jacob Williams
    Date
    8/23/2014

    Transform a position (and optionally velocity) vector from LVLH to IJK.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: rt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: vt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: dr_lvlh

    Chaser LVLH position vector relative to target [km]

    real(kind=wp), intent(in), dimension(3) :: dv_lvlh

    Chaser LVLH position vector relative to target [km]

    real(kind=wp), intent(out), dimension(3) :: r_ijk

    Chaser IJK absolute position vector [km]

    real(kind=wp), intent(out), optional, dimension(3) :: v_ijk

    Chaser IJK absolute position vector [km]

public interface from_ijk_to_rsw

Conversion from IJK to RSW

  • private subroutine from_ijk_to_rsw_mat(r, v, a, c, cdot)

    Author
    Jacob Williams
    Date
    4/19/2014

    Compute the transformation matrices to convert IJK to RSW.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: r

    position vector of target [km]

    real(kind=wp), intent(in), dimension(3) :: v

    velocity vector of target [km/s]

    real(kind=wp), intent(in), optional, dimension(3) :: a

    acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

    real(kind=wp), intent(out), dimension(3,3) :: c

    C transformation matrix

    real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

    CDOT transformation matrix

  • private subroutine from_ijk_to_rsw_rv(rt_ijk, vt_ijk, r_ijk, v_ijk, dr_rsw, dv_rsw)

    Author
    Jacob Williams
    Date
    8/23/2014

    Transform a position (and optionally velocity) vector from IJK to RSW.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: rt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: vt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: r_ijk

    Chaser IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: v_ijk

    Chaser IJK absolute position vector [km]

    real(kind=wp), intent(out), dimension(3) :: dr_rsw

    Chaser RSW position vector relative to target [km]

    real(kind=wp), intent(out), optional, dimension(3) :: dv_rsw

    Chaser RSW position vector relative to target [km]

public interface from_rsw_to_ijk

Conversion from RSW to IJK

  • private subroutine from_rsw_to_ijk_mat(r, v, a, c, cdot)

    Author
    Jacob Williams
    Date
    4/19/2014

    Compute the transformation matrices to convert RSW to IJK.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: r

    position vector of target [km]

    real(kind=wp), intent(in), dimension(3) :: v

    velocity vector of target [km/s]

    real(kind=wp), intent(in), optional, dimension(3) :: a

    acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

    real(kind=wp), intent(out), dimension(3,3) :: c

    C transformation matrix

    real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

    CDOT transformation matrix

  • private subroutine from_rsw_to_ijk_rv(rt_ijk, vt_ijk, dr_rsw, dv_rsw, r_ijk, v_ijk)

    Author
    Jacob Williams
    Date
    8/23/2014

    Transform a position (and optionally velocity) vector from RSW to IJK.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: rt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: vt_ijk

    Target IJK absolute position vector [km]

    real(kind=wp), intent(in), dimension(3) :: dr_rsw

    Chaser RSW position vector [km]

    real(kind=wp), intent(in), dimension(3) :: dv_rsw

    Chaser RSW velocity vector [km/s]

    real(kind=wp), intent(out), dimension(3) :: r_ijk

    Chaser IJK absolute position vector [km]

    real(kind=wp), intent(out), optional, dimension(3) :: v_ijk

    Chaser IJK absolute velocity vector [km/s]

public interface from_lvlh_to_rsw

Conversion from LVLH to RSW

  • private subroutine from_lvlh_to_rsw_rv(dr_lvlh, dv_lvlh, dr_rsw, dv_rsw)

    Author
    Jacob Williams
    Date
    8/23/2014

    Transform a position (and optionally velocity) vector from LVLH to RSW.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: dr_lvlh

    Chaser LVLH position vector relative to target [km]

    real(kind=wp), intent(in), dimension(3) :: dv_lvlh

    Chaser LVLH position vector relative to target [km]

    real(kind=wp), intent(out), dimension(3) :: dr_rsw

    Chaser RSW position vector relative to target [km]

    real(kind=wp), intent(out), optional, dimension(3) :: dv_rsw

    Chaser RSW velocity vector relative to target [km/s]

public interface from_rsw_to_lvlh

Conversion from RSW to LVLH

  • private subroutine from_rsw_to_lvlh_rv(dr_rsw, dv_rsw, dr_lvlh, dv_lvlh)

    Author
    Jacob Williams
    Date
    8/23/2014

    Transform a position (and optionally velocity) vector from RSW to LVLH.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in), dimension(3) :: dr_rsw

    Chaser RSW position vector relative to target [km]

    real(kind=wp), intent(in), dimension(3) :: dv_rsw

    Chaser RSW velocity vector relative to target [km/s]

    real(kind=wp), intent(out), dimension(3) :: dr_lvlh

    Chaser LVLH position vector relative to target [km]

    real(kind=wp), intent(out), optional, dimension(3) :: dv_lvlh

    Chaser LVLH position vector relative to target [km]


Abstract Interfaces

abstract interface

  • private subroutine report_func(t, rv)

    for reporting the points in the cw_propagator.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: t

    time [sec]

    real(kind=wp), intent(in), dimension(6) :: rv

    state [km,km/s]


Functions

public function cw_equations(x0, dt, n) result(x)

Author
Jacob Williams
Date
6/14/2015

Clohessy-Wiltshire equations for relative motion.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(6) :: x0

initial state [r,v] of chaser (at t0) [km, km/s]

real(kind=wp), intent(in) :: dt

elapsed time from t0 [sec]

real(kind=wp), intent(in) :: n

mean motion of target orbit (sqrt(mu/a**3)) [1/sec]

Return Value real(kind=wp), dimension(6)

final state [r,v] of chaser [km, km/s]


Subroutines

public subroutine cw_propagator(t0, x0, h, n, tf, xf, report)

Author
Jacob Williams
Date
8/23/2015

Clohessy-Wiltshire propagation routine.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: t0

initialize time [sec]

real(kind=wp), intent(in), dimension(6) :: x0

initial state in RST coordinates [km,km/s]

real(kind=wp), intent(in) :: h

abs(time step) [sec]

real(kind=wp), intent(in) :: n

mean motion of target orbit (sqrt(mu/a**3)) [1/sec]

real(kind=wp), intent(in) :: tf

final time [sec]

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

final state in RST coordinates [km,km/s]

procedure(report_func), optional :: report

to report each point

private subroutine from_ijk_to_lvlh_mat(r, v, a, c, cdot)

Author
Jacob Williams
Date
4/19/2014

Compute the transformation matrices to convert IJK to LVLH.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: r

position vector of target [km]

real(kind=wp), intent(in), dimension(3) :: v

velocity vector of target [km/s]

real(kind=wp), intent(in), optional, dimension(3) :: a

acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

real(kind=wp), intent(out), dimension(3,3) :: c

C transformation matrix

real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

CDOT transformation matrix

private subroutine from_ijk_to_lvlh_rv(rt_ijk, vt_ijk, r_ijk, v_ijk, dr_lvlh, dv_lvlh)

Author
Jacob Williams
Date
8/23/2014

Transform a position (and optionally velocity) vector from IJK to LVLH.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: rt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: vt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: r_ijk

Chaser IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: v_ijk

Chaser IJK absolute position vector [km]

real(kind=wp), intent(out), dimension(3) :: dr_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(out), optional, dimension(3) :: dv_lvlh

Chaser LVLH position vector relative to target [km]

private subroutine from_lvlh_to_ijk_mat(r, v, a, c, cdot)

Author
Jacob Williams
Date
4/19/2014

Compute the transformation matrices to convert LVLH to IJK.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: r

position vector of target [km]

real(kind=wp), intent(in), dimension(3) :: v

velocity vector of target [km/s]

real(kind=wp), intent(in), optional, dimension(3) :: a

acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

real(kind=wp), intent(out), dimension(3,3) :: c

C transformation matrix

real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

CDOT transformation matrix

private subroutine from_lvlh_to_ijk_rv(rt_ijk, vt_ijk, dr_lvlh, dv_lvlh, r_ijk, v_ijk)

Author
Jacob Williams
Date
8/23/2014

Transform a position (and optionally velocity) vector from LVLH to IJK.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: rt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: vt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: dr_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(in), dimension(3) :: dv_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(out), dimension(3) :: r_ijk

Chaser IJK absolute position vector [km]

real(kind=wp), intent(out), optional, dimension(3) :: v_ijk

Chaser IJK absolute position vector [km]

private subroutine from_ijk_to_rsw_mat(r, v, a, c, cdot)

Author
Jacob Williams
Date
4/19/2014

Compute the transformation matrices to convert IJK to RSW.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: r

position vector of target [km]

real(kind=wp), intent(in), dimension(3) :: v

velocity vector of target [km/s]

real(kind=wp), intent(in), optional, dimension(3) :: a

acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

real(kind=wp), intent(out), dimension(3,3) :: c

C transformation matrix

real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

CDOT transformation matrix

private subroutine from_ijk_to_rsw_rv(rt_ijk, vt_ijk, r_ijk, v_ijk, dr_rsw, dv_rsw)

Author
Jacob Williams
Date
8/23/2014

Transform a position (and optionally velocity) vector from IJK to RSW.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: rt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: vt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: r_ijk

Chaser IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: v_ijk

Chaser IJK absolute position vector [km]

real(kind=wp), intent(out), dimension(3) :: dr_rsw

Chaser RSW position vector relative to target [km]

real(kind=wp), intent(out), optional, dimension(3) :: dv_rsw

Chaser RSW position vector relative to target [km]

private subroutine from_rsw_to_ijk_mat(r, v, a, c, cdot)

Author
Jacob Williams
Date
4/19/2014

Compute the transformation matrices to convert RSW to IJK.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: r

position vector of target [km]

real(kind=wp), intent(in), dimension(3) :: v

velocity vector of target [km/s]

real(kind=wp), intent(in), optional, dimension(3) :: a

acceleration vector of target [km/s^2] (if not present, then a torque-free force model is assumed)

real(kind=wp), intent(out), dimension(3,3) :: c

C transformation matrix

real(kind=wp), intent(out), optional, dimension(3,3) :: cdot

CDOT transformation matrix

private subroutine from_rsw_to_ijk_rv(rt_ijk, vt_ijk, dr_rsw, dv_rsw, r_ijk, v_ijk)

Author
Jacob Williams
Date
8/23/2014

Transform a position (and optionally velocity) vector from RSW to IJK.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: rt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: vt_ijk

Target IJK absolute position vector [km]

real(kind=wp), intent(in), dimension(3) :: dr_rsw

Chaser RSW position vector [km]

real(kind=wp), intent(in), dimension(3) :: dv_rsw

Chaser RSW velocity vector [km/s]

real(kind=wp), intent(out), dimension(3) :: r_ijk

Chaser IJK absolute position vector [km]

real(kind=wp), intent(out), optional, dimension(3) :: v_ijk

Chaser IJK absolute velocity vector [km/s]

private subroutine from_rsw_to_lvlh_rv(dr_rsw, dv_rsw, dr_lvlh, dv_lvlh)

Author
Jacob Williams
Date
8/23/2014

Transform a position (and optionally velocity) vector from RSW to LVLH.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: dr_rsw

Chaser RSW position vector relative to target [km]

real(kind=wp), intent(in), dimension(3) :: dv_rsw

Chaser RSW velocity vector relative to target [km/s]

real(kind=wp), intent(out), dimension(3) :: dr_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(out), optional, dimension(3) :: dv_lvlh

Chaser LVLH position vector relative to target [km]

private subroutine from_lvlh_to_rsw_rv(dr_lvlh, dv_lvlh, dr_rsw, dv_rsw)

Author
Jacob Williams
Date
8/23/2014

Transform a position (and optionally velocity) vector from LVLH to RSW.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: dr_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(in), dimension(3) :: dv_lvlh

Chaser LVLH position vector relative to target [km]

real(kind=wp), intent(out), dimension(3) :: dr_rsw

Chaser RSW position vector relative to target [km]

real(kind=wp), intent(out), optional, dimension(3) :: dv_rsw

Chaser RSW velocity vector relative to target [km/s]

public subroutine relative_motion_test()

Author
Jacob Williams
Date
8/22/2015

Unit tests for the relative_motion_module.

Arguments

None