Calculate particle trajectory for a given gyro-angle and gyro-surface
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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