compute_rdot_vecs Subroutine

public subroutine compute_rdot_vecs(x, y, z, vx, vy, vz, rmag, rdot)

compute the rmag and rdot vectors, given the state vectors

Arguments

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

x-position component

real(kind=wp), intent(in), dimension(:) :: y

y-position component

real(kind=wp), intent(in), dimension(:) :: z

z-position component

real(kind=wp), intent(in), dimension(:) :: vx

x-velocity component

real(kind=wp), intent(in), dimension(:) :: vy

y-velocity component

real(kind=wp), intent(in), dimension(:) :: vz

z-velocity component

real(kind=wp), intent(out), dimension(:), allocatable :: rmag

magnitude of position vector [km]

real(kind=wp), intent(out), dimension(:), allocatable :: rdot

derivative of radius magniutde [km/s]


Called by

proc~~compute_rdot_vecs~~CalledByGraph proc~compute_rdot_vecs compute_rdot_vecs proc~export_trajectory_json_file mission_type%export_trajectory_json_file proc~export_trajectory_json_file->proc~compute_rdot_vecs proc~halo_solver_main halo_solver_main proc~halo_solver_main->proc~export_trajectory_json_file

Source Code

    subroutine compute_rdot_vecs(x,y,z,vx,vy,vz,rmag,rdot)
        real(wp),dimension(:),intent(in) :: x !! x-position component
        real(wp),dimension(:),intent(in) :: y !! y-position component
        real(wp),dimension(:),intent(in) :: z !! z-position component
        real(wp),dimension(:),intent(in) :: vx !! x-velocity component
        real(wp),dimension(:),intent(in) :: vy !! y-velocity component
        real(wp),dimension(:),intent(in) :: vz !! z-velocity component
        real(wp),dimension(:),intent(out),allocatable :: rmag !! magnitude of position vector [km]
        real(wp),dimension(:),intent(out),allocatable :: rdot !! derivative of radius magniutde [km/s]
        integer :: i !! counter
        real(wp),dimension(3) :: r, v
        allocate(rdot(size(x)),rmag(size(x)))
        do i = 1, size(x)
            r = [x(i), y(i), z(i)]
            v = [vx(i), vy(i), vz(i)]
            rmag(i) = norm2(r)
            rdot(i) = dot_product(r,v) / rmag(i)
        end do
    end subroutine compute_rdot_vecs