gyro_trajectory Subroutine

public subroutine gyro_trajectory(gs, theta, ri, vi)

Calculate particle trajectory for a given gyro-angle and gyro-surface

Arguments

TypeIntentOptionalAttributesName
type(GyroSurface), intent(in) :: gs

Gyro-Surface

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

Gyro-angle

real(kind=Float64), dimension(3):: ri

Particle position

real(kind=Float64), dimension(3):: vi

Particle Velocity


Called by

proc~~gyro_trajectory~~CalledByGraph proc~gyro_trajectory gyro_trajectory proc~npa_f npa_f proc~npa_f->proc~gyro_trajectory proc~pnpa_f pnpa_f proc~pnpa_f->proc~gyro_trajectory proc~npa_mc npa_mc proc~npa_mc->proc~gyro_trajectory proc~pnpa_mc pnpa_mc proc~pnpa_mc->proc~gyro_trajectory program~fidasim fidasim program~fidasim->proc~npa_f program~fidasim->proc~pnpa_f program~fidasim->proc~npa_mc program~fidasim->proc~pnpa_mc

Contents

Source Code


Source Code

subroutine gyro_trajectory(gs, theta, ri, vi)
    !+ Calculate particle trajectory for a given gyro-angle and gyro-surface
    type(GyroSurface), intent(in) :: gs
        !+ Gyro-Surface
    real(Float64), intent(in) :: theta
        !+ Gyro-angle
    real(Float64), dimension(3) :: ri
        !+ Particle position
    real(Float64), dimension(3) :: vi
        !+ Particle Velocity

    real(Float64) :: a,b,c,th
    a = gs%axes(1)
    b = gs%axes(2)
    c = gs%axes(3)
    th = theta + pi/2
    ri = matmul(gs%basis, [a*cos(th), b*sin(th), 0.d0]) + gs%center
    vi = gs%omega*matmul(gs%basis, [-a*sin(th), b*cos(th), c])

end subroutine gyro_trajectory