Programs for setting up photocathode trajectories (xmpl2d41.dat).

 

These can be copied from the end of file xmpl2d41.dat, which is supplied with the CPO2D package.

 

 

C Program (in Fortran) for setting up photocathode trajectories:

DIMENSION traj (6)

OPEN (UNIT=2,FILE='tempres.dat',STATUS='UNKNOWN')

C =results file

C Initialise some parameters:

n = 10

C =require number of trajectories

spacing = 0.1

C =initial spacing from cathode

rmax = 50.

C =maximum distance of initial rays from the axis

energy = 0.5

C =initial energy

rad = 150.

C =radius of photocathode

C Start calculation:

z0 = rad + spacing

traj(5) = energy

traj(6) = 0.

C =current

theta_max = ASIN(rmax/rad)

DO i = 1 , n

theta = theta_max*real(i-0.5)/real(n)

C -ie trajectories start from centres of n steps

sn = SIN(theta)

cs = COS(theta)

traj(1) = rad*sn

traj(2) = z0 - rad*cs

traj(3) = -sn

traj(4) = cs

WRITE (2,'(1P6E11.3)') (traj(j), j = 1 , 6)

C =required output

ENDDO

STOP

END