pitch_to_vec Subroutine

public subroutine pitch_to_vec(pitch, gyroangle, fields, vi_norm)

Calculates velocity vector from pitch, gyroangle and fields

Arguments

Type IntentOptional AttributesName
real(kind=Float64), intent(in) :: pitch

Pitch

real(kind=Float64), intent(in) :: gyroangle

Gyroangle [radians]

type(LocalEMFields), intent(in) :: fields

Electromagnetic fields

real(kind=Float64), intent(out), dimension(3):: vi_norm

Normalized velocity vector


Called by

proc~~pitch_to_vec~~CalledByGraph proc~pitch_to_vec pitch_to_vec proc~fida_weights_los fida_weights_los proc~fida_weights_los->proc~pitch_to_vec proc~gyro_correction gyro_correction proc~gyro_correction->proc~pitch_to_vec proc~gyro_radius gyro_radius proc~gyro_radius->proc~pitch_to_vec proc~fida_weights_mc fida_weights_mc proc~fida_weights_mc->proc~gyro_correction proc~fida_f fida_f proc~fida_f->proc~gyro_correction proc~neutron_mc neutron_mc proc~neutron_mc->proc~gyro_correction program~fidasim fidasim program~fidasim->proc~fida_weights_los program~fidasim->proc~fida_weights_mc program~fidasim->proc~fida_f program~fidasim->proc~neutron_mc proc~neutron_f neutron_f program~fidasim->proc~neutron_f proc~fida_mc fida_mc program~fidasim->proc~fida_mc proc~neutron_f->proc~gyro_correction proc~fida_mc->proc~gyro_correction

Contents

Source Code


Source Code

subroutine pitch_to_vec(pitch, gyroangle, fields, vi_norm)
    !+ Calculates velocity vector from pitch, gyroangle and fields
    real(Float64), intent(in)                :: pitch
        !+ Pitch
    real(Float64), intent(in)                :: gyroangle
        !+ Gyroangle [radians]
    type(LocalEMFields), intent(in)          :: fields
        !+ Electromagnetic fields
    real(Float64), dimension(3), intent(out) :: vi_norm
        !+ Normalized velocity vector

    real(Float64) :: sinus

    sinus = sqrt(max(1.d0-pitch**2,0.d0))
    vi_norm = (sinus*cos(gyroangle)*fields%a_norm + &
               pitch*fields%b_norm + &
               sinus*sin(gyroangle)*fields%c_norm)

end subroutine pitch_to_vec