Sie sind auf Seite 1von 135

SLAC

-UC-28

- 331

(4

EGUN-AN ELECTRON OPTICS


AND GUN DESIGN PROGRAM
W. B. Herrmannsfeldt
Stanford

Linear

Accelerator

Stanford

University

Stanford,

California

October

Prepared

number

94309

1988

for the Department

under contract

Center

of Energy

DE-AC03-76SF00515

Printed in the United States of America.


Available from the National Technical Information
Service, U.S. Department
of Commerce, 5285 Port Royal Road,
Springfield, Virginia 22161. Price: Printed Copy A07, Microfiche AOl.

ABSTRACtI? The name EGUN

has become commonly

known as the SLAC Electron

Trajectory

associated with

Program.

the program

This document

also

is an updated

version of SLAC-226, published in 1979. The program itself has had substantial
upgrading

since then, but only a few new features are of much concern to the

user. Most of the improvements

are internal

and are intended to improve speed

or accuracy.
EGUN

is designed to compute trajectories

and magnetostatic
fields.

Starting

fields, including
options

include

the effects of space charge and self-magnetic

Childs

shapes, as well as user specified initial


cal symmetry

of charged particles in electrostatic

Law conditions

conditions.

on cathodes of various

Either rectangular

may be used. In the new jargon, the program is a 2-l/2

code meaning 2-D in all fields and 3-D in all particle


tion Solver is used to find the electrostatic
derived from the boundary

conditions.

motion.

program or arbitrary

configurations

Magnetic

fields are to be specified exter-

designed to be used on the newer models

small main frames,

work stations,

program

uses the programming

program

should operate on any system that supports

most common PC monitors


plots on dot-matrix

data from another

also covers the program EGN87c, which is

developed version of EGUN


computers,

A Poissons Equa-

of coils.

This edition of the documentation

of personal

dimension

fields by using difference equations

nally by the user, by using one of several methods including

a recently

or cylindri-

etc.

The EGN87c

language C which is very transportable

are included,

printer-plotters

C. Plotting

and the capability

is provided.

so the

routines

for

to make hard copy

TABLE

OF CONTENTS

~--

............................
............................

1
2

Introduction
Application

Poisson Equation

Solver

1
2

......................

Input

...................

3.1 General Description


3.2 Problem

................
Title and Potential Cards
............
POTN, Rect. or Cyl. Coordinates
Field Data

Boundary

Input

Special Boundary

...................

...........................
Grids
Boundary Diagnostics
3.3 Poissons Equation
4

Starting

Conditions

...............

..................

Solver

15
16
19
20

.....................
Conditions

9
11

......................

Magnetic

................

........................

28
28
30
32
35

..................
4.1 Universal Parameters
..........................
PERVO
.................
HOLD Emission limited
PE
............................
..........................
ERROR
......................
UNIT, UNITIN

36
36
37

..........................
LSTRH
........................
MAXRAY
STEP
...........................
............................
NS
SPC ............................
.........................
PHILIM
...................
SAVE=l,
Boundaries

39
39
39

38
38
39

40
41
42
42

..................

44

MASS ...........................
.......................
AV and AVR
..........................
BEND
........................
MAGMLT
...........................
IPBP
ZEND ...........................
VION
...........................
..................
ZDOTEQ, EBQ Mode

45
45
46
47
47
47
48
48

SAVE=2,

Trajectories

4.2

Equipotential

P1ol.s

EQUIPR
LM

49

.........................

EQLN..

..................
.........................

EQST

...........................

IZl,IZ2andIZS
4.3

...................

Plotting

50
. .........

50
50
50

.....................

Controls

51

....................

51
51

SCAL%=YES
......................
SXandSY
........................
4.4 Magnetic Fields
.....................
Magnetic
Axial

Field Input

Magnetic

MAGORD,
NMAG
Rect.

4.7

53

...................

53

Order and Direction

Coord.

; ...........

User Specified
Prograxn

GO
61
G2
70

............

......................
Data

Generated

Laplaces

59

.....................

74

....................
Cards

Equation

76

................

Thermal Effects ......................


Rectangular
Coordinates with
4.8

58

.................

Vector Potential Data


..................
General Cathode and GENCAR.D
Spherical Cathode
....................
Card Starting

56
57

I ......

Expansions

Integrals

.............

....................

Expansions.

Elliptic
4.5
4.6

.......................

Field

Ideal Coils

Off-Axis

51
52

Cylindrical

Applications

.............

78
Beams

....

79
79
82

4.9 Dielectric Boundaries


..................
Trajectory
Calculations
......................

83
87

Trajectory

91

Analyses

........................

References
..............................
Appendix
I, Equation:; of Motion
Apperldix

II, General

Neumann

Appendix

III,

Appendix

IV, Boundary

Condensed

04
96

..................
l3ounclary

Inst.rllctions
Examples

............

...............
................

104
107
120

TABLE

OF FIGURES

1
2

...................
Simulation of a Pierce Diode
Section of mesh for solution of Poissons Equation

Example

Fortran

Program output

Basic geometry for spherical cathode configurations

Plotted

A-II
A-IV

of preparation

to run a problem

~--

7
9

........

13

.............

14

data prepared for the problem shown in Fig. 3 ......

output

from the boundary

data shown in Fig. 4

of sample problem shown in Fig. 3

General Neumann Boundaries


Boundary Example Figures

................
.................

.......
........

....

25
72
73
104
120

--

1. INTRODUCTION

~~. - -

This report is intended as a users reference manual for the EGUN


Trajectory

Program.

earlier publications
SLAC-226.l

It contains

all the currently

relevant

the special features

it includes specific instructions

which

to express thanks

has at some time or other suggested improvements

to everyone who

to the program.

by this open process and it is for the purpose of making

We have
all these

available that this report is being prepared.

This edition

of the documentation

of the program called EGN, written


models of Personal Computers.

plotters

These features

as a direct result of the needs of some particular

user and we wish to take this opportunity

are included,

and

for using a number of

have been added to the program.

have usually been incorporated

features better

from the

about this program which were SLAC-51 and SLAC-166

In addition,

all benefited

material

Electron

The plotting

package called Metawindow(R)


common hardware

configurations.

developed version

in C2 and designed to be used on the newer

Plotting

and the capability

is provided.

also covers a recently

routines for most common PC monitors

to make hard copy plots on dot-matrix


routines

provided

by Metagraphics.3

printer-

are based on a commercial


Metawindow

supports

most

All of the physics options and input data are

the same for the two versions except that EGN uses free field input for boundary
and trajectory
Computer
cially

data.

Both programs use essentially

implementation

for the appropriate

the same NAMELIST

files.

of EGN is covered in a separate note prepared espehardware.

Prospective

users of EGN can check with

the author to find what hardware is supported,

but it is likely that EGN would

operate on any system for which a C compiler

is available.

In the present PC

version, the code requires around 400 kbytes of storage. It operates about 30-60
1

times slower on a PC than it does on the IBM-3080


space-charge
minutes

limited

series mainframe.

A typical

Pierce diode may need 20 seconds on the 3081 and lo-20

on a PC, depending

on the hardware

configuration.

2. APPLICATION
The SLAC Electron
tron trajectories

Optics

in electrostatic

solved by finite difference


ifying

fully

distribution.

Electric

and account for all possible electric

on one cycle followed

by another solution

by another cycle of trajectory

The program

and currents.

by

trajectory

are

include

accepts

the output

and magnetic

field compo-

deposition

of charge

which is in turn

calculations.
or cylindrical

and magnetic

coordinates.

beam to be calculated

in

fields.

Magnetic

fields

or as arrays of coils with specified coordinates

configuration

data from

the effects of saturable

iron.

symmetric.

order expansion

of the radial coordinate.

trajectories

Off-axis

of solenoids.

a magnet

field components

may be started

Alternatively,

design program,

In cylindrical

fields are axially

Electron

equations

The preferred technique of defining the magnetic field is to calculate

the axial field from an arbitrary


program

is

defined by spec-

of Poissons equation

array of electric

are read in either as axial strengths

Poissons equation

appropriate

may be used in either rectangular

symmetric

elec-

fields are determined

special option allows space charge forces for a cylindrical


a rectangularly

to calculate

conditions

The electron

nents. Space charge forces are realized through

followed

written

fields.

using boundary

of the boundary.

the potential

relativistic

is specifically

and magnetostatic

equations

the type and position

differentiating

Program

coordinates,

can

the magnetic

are calculated

by one of four schemes:

which

the

by a sixth-

--

times slower on a PC than it does on the IBM-3080


space-charge limited
minutes

series mainframe.

A typical

Pierce diode may need 20 seconds on the 3081 and 10-20

on a PC, depending on the hardware configuration.

2. APPLICATION
The SLAC Electron
tron trajectories

Optics Program

in electrostatic

is specifically

and magnetostatic

fields.

solved by finite difference equations using boundary


ifying the type and position

of the boundary.

differentiating

distribution.

fully

the potential

relativistic

written

Electric

fields are determined

on one cycle followed by another solution


followed by another cycle of trajectory

by
are

field compo-

deposition

of charge

of Poissons equation which is in turn

calculations.

The program may be used in either rectangular

or cylindrical

special option allows space charge forces for a cylindrical


symmetric

equations

and magnetic

appropriate

is

defined by spec-

The electron trajectory

nents. Space charge forces are realized through

elec-

Poissons equation

conditions

and account for all possible electric

a rectangularly

to calculate

array of electric and magnetic

coordinates.

beam to be calculated

in

fields.

Magnetic

fields

are read in either as axial strengths or as arrays of coils with specified coordinates
and currents.

The preferred technique of defining the magnetic field is to calculate

the axial field from an arbitrary


program
include

accepts the output

data from

the effects of saturable

fields are axially

symmetric.

configuration

iron.

of solenoids.

a magnet

Alternatively,

design program,

In cylindrical

Off-axis field components

coordinates,

Electron

trajectories

may be started

by one of four schemes:


2

can

the magnetic

are calculated

order expansion of the radial coordinate.

which

the

by a sixth-

1. GENERAL

cathode in which electrons are started

holds near a surface designated


2. SPHERE
in which

3. CARDS

current

4. GENCARD

On the first iteration

charge is computed
jectories

and a radial limit.

conditions

which combines the versatility

of paraxial

at right

coordinates)
angles to the
Childs

law for

for each ray are specified

card format.

lation of emission using Childs

sumption

law

is again used.

in which the specific starting

in an 80-column

in rectangular

are assumed to be emitted

surface defined by a radius of curvature


space charge limited

Childs

as the cathode.

for a spherical cathode (cylindrical


the electrons

assuming

of CARDS

law as in GENERAL.

cycle, space charge forces are calculated

flow.

As the rays are traced through

and stored in a separate

have been calculated,

with the calcu-

the program

array.

After

from the as-

the program,

space

all the electron

tra-

begins the second cycle by solving

Poissons equation with the space charge from the first cycle. For problems meeting the paraxial

assumptions,

especially if relativistic

this one cycle may be sufficient

to solve the entire problem.

in which space charge is negligible,


cycle is usually

iteration

The Childs

averaging

equation

starting

for the starting

used for the previous

from the solution

An additional
Laplaces

and phototubes,

cycles (as many as are requested)

law calculations

the perveance

lated directly

e.g., spectrometers

For other problems


a single

adequate.

Subsequent
tern.

electron beams are involved,

conditions

cycle with

are remade

the perveance

by

calcu-

of Poissons equation.

option is LAPLACE

not involving

follow the above pat-

intended for any application

electron ray tracing.


3

of

In this case the number of

--

cycles is used simply to improve the accuracy of the solution of Laplaces equation.
The LAPLACE

option includes a provision

space charge array. The output


the entire boundary.
calculate

from LAPLACE

capacity

and Z in cylindrical

coordinates

coordinate
through

In rectangular
Magnetic

data in the

includes a list of the fields on

output

azimuthal

coordinates,

and to

of part or all of some configuration.

The Poisson Solver program

calculated

arbitrary

This can be used to find local peak field strengths

the electrical

rectangular

for inputting

always operates in two dimensions;


or Y and X in rectangular

retains the R and Z labels.


angles, (labeled

PHI is actually

PHI)

the third

fields, except for the self-magnetic

either

coordinates.
Electron

orbits

The
are

referenced to the Z axis.


Cartesian

coordinate.

field of a beam, are input directly

in one of three ways:


1. by specifying

the field along the Z-axis, (two methods are provided)

2. by specifying

a set of point coils (giving position,

3. by using the vector potential


son. It is interesting

or

from a magnet program such as Pois-

to note that Colman4 has converted several accelerator

physics programs including


In cylindrical

output

radius and current),

coordinates,

Poisson to run on the IBM-AT.

the magnetic

with radial terms as required by Maxwells

field is interpreted
equations.

as an axial field

The off-axis fields can be

made by either a sixth order expansion from the axial fields or, for the case of a
set of coils, by directly

using the appropriate

elliptic

order expansions can be selected if the quality


sixth

order expansions.

interpolation

Second or fourth

of the data cannot support

When the vector potential

is used in place of the expansion.

functions.

input

the

has been used, local

In rectangular

coordinates

the magnetic

in any one of the three Cartesian


by expansion

of the coordinate

the median

directions.

Off-median-plane

in the direction

normal

in the R-direction.

pole face of a dipole magnet.


be orthogonal

Cartesian

plane of the problem,


direction.

(Remember

coordinates.)

through

to the median

the Z-axis, then the field extends to infinity

in the

equations

of the field on the median


depending

infinitely

numbered

long conductor.

ray, then the current

for both coordinate

below the minimum

problem

is generally

ray.

depending

one is dealing with


better

insures that

The self-magnetic

field

crosses the last preceding


if the ray continues

to

if the ray goes

If several rays cross, the results


of course, on how significant
field is very significant,

a very intense relativistic

suited to the paraxial

ray approach,

first cycle, in which the space charge is offset by the self-magnetic


5

the

rays lies on the axis in an

However,

field is. Note that if the self-magnetic

almost by definition,

in rectangular

from those rays is only dropped

radius of a previous
incorrect,

of

systems from the cur-

sort routine

from the previous

from that ray is dropped.

are apt to be somewhat


self-magnetic

A built-in

If the ray being calculated

cross other rays, then the current

on the symmetry

expansions

from the axis outwards.

assumes all the current

plane can

to second order.

rent in the rays on the present cycle.

calculation

of the

to the

fields are calculated

rays are sequentially

and

plane lies normal

the coils that produce the field. The off-median-plane

Self-magnetic

direction

If

that R, Z and PHI are here taken to

or in the R-direction,

satisfy Maxwells

plane.

This fits the configuration

If the median

In this case the direction

be either in the Z-direction

coordinates

fields are found

plane is the R-Z plane, then the field is in the PHI

the field extends to infinity

PHI

field -can be -defined to be principally

beam.

the
then
This

as solved in the
field directly,

rather

than by the off-setting

beam is already relativistic


velocity

effects of two large terms.

in the gun, a new option

above which the direct cancellation

This permits

to be used near the cathode and the paraxial

when the beam is at higher energy.


using the parameter
In rectangular

coordinates,

the self-magnetic

calculation

Law

to be used

level is given in units of v/c

only if there is no external

about

or if for other reasons it is

field, then an external

In any case, in rectangular

A single variable

field assumes symmetry

If this is not correct,

desired to turn off the self-magnetic


can be specified.

This velocity

the Childs

ZDOTEQ.

the Y = 0, (R = 0) plane.

functions

allows the user to define a

of space charge by the self magnetic

field is used instead of the normal separate terms.


calculation

For cases where the

coordinates,

field of strength

zero

the self-magnetic

field

field in the PHI direction.

controls plotting.

If this variable,

MI is set to zero to reject

all plotting,

then on the first and last cycles, every tenth point that would have

been plotted

is printed

cycle is plotted.

so that it may be hand plotted.

The first cycle may also be plotted

cycle. All plots may include equipotential


the trajectory
Figure

paths.

overlaid

as a function

output

showing

a Pierce diode with

If there is an external

on the trajectory

allows one to choose a single trajectory,


is plotted

or one may even plot every

plots, either separate or overlaid with

of the graphic

lines and trajectory

then this field is also plotted,

PHI,

at least the last

plots.

1 is an example

equipotential

Normally

IPHI

of Z.

plots.

magnetic

field,

A special option

for which the azimuthal

position

..

.
74

Figure 1. The figure is the computer drawn simulation


particular example was plotted on a dot-matrix
printer
from the program, not using a screen dump routine.

of a Pierce diode. This


using data sent directly

There

are a pair of diagnostic

vs. radius.

(Alpha

= arctan

plots;

dR/dZ).

plot is constructed

by creating

the largest R value, and plotting


be rather

density

Th ese are plotted

the last cycle, so that the radius plotted


density

current

vs. - radius

and alpha

using the final data of

is the final R coordinate.

The current

ten bins in the space between

R=O and

the current that falls in each bin; the result can

ragged even for a fairly

uniform

beam, unless many trajectories

are

used.
A diagnostic

routine

is called at the end of the program

tance using the so-called edge emittance


Both the actual emittance
lated; the momentum

interpret

which is four times the rms emittance.

and the invariant

the normalized

parameter

this as a deliberate

the boundary

the emit-

or normalized

emittance

are calcu-

of the first ray is used to define the beta-gamma

that is used to determine


If the plotting

to calculate

a useful way to preview

emittance.

MI is defined as a negative
fatal boundary

as well as provide

error.

all diagnostics

the boundary

product

the programs

The program

will then plot

of the boundary

plot without

entire program.

number,

spending

data.

This is

time running

the

3. POISSON EQUATION SOLVER


3.1

GENERAL

The program
boundary

DESCRIPTION

contains

conditions

subroutines

and calculate

tions for each mesh point within


called to generate the solution
ary conditions.

The solution

which read in data cards describing

the coefficients
the problem.

of the finite

The subroutine

difference equaPOISSN

is then

to Poissons equation which match those boundis found in terms of a set of points which form a

mesh of identical squares. It is recognized that a provision for a rectangular


(i.e., different

horizontal

the

and vertical

spacing) would improve the utility

program

and it is planned to incorporate

potential

is calculated

for each intersection

this feature as soon as possible.

mesh
of the
The

of the mesh. Figure 2 shows a small

section of the mesh.

Figure 2. Section of mesh for solution of Poissons equation.


In rectangular

coordinates,

the finite difference form of Poissons equation is

vl + v2 + v3 + v5 - 4v4 = (R.H.)
9

(3.1)

points in Fig. 1 and.R.H.- is the value of the

where the Vs refer to the numbered


right-hand

side of Poissons equation

at point 4 when written

in the form

v2v = p/c2
All equations

(3.2)

use the mesh space, h, as the basic unit,

so h does not appear

explicitly.
For problems

with

cylindrical

symmetry,

the finite

difference

equation

be-

comes

RVl

+ Rv2

-t (R-t

i/z)&

-t- (R -

i/2)6,

4Rv4

= R X (R.H.)

where R is the distance in mesh units from the axis of symmetry

P-3)

to the point at

4.
A number

of references5-7

and of the special equations


interest.

A Dirichlet

In an electrostatic
An ordinary

boundary

Neumann

on which the normal

axis of symmetry

at boundaries.

problem,

value of the normal

give the derivation

is that boundary

boundary
derivative

derivative

Three types of boundaries


on which the potential

is one which lies coincident


of the potential

symmetric

is known.

is known.

with the mesh and


In practice,

the only

device has the normal

derivative

boundary.

However, the axis of a cylindrical

symmetry

problem

is a special case of which

is

VI + V2 + 4V3 - 6V4 = (R.H.)


The difference equation
can be derived

are of

that is ever known is zero. Thus, for example, the

of a cylindrically

equation

equations

this would be an electrode fixed at a given potential.

equal to zero and is a Neumann

the difference

of these difference

for ordinary

from Eqs.

Neumann

boundaries

(3.1), (3.3) or (3.4) by setting


10

(3.4
parallel

to either axis

the potentials

which

straddle

the boundary

in cylindrical

equal to each other.

coordinates

Neumann

+ (R - l/Z)&,

- 4RV4 = R x (R.H.)

is the general Neumann

boundary,

i.e., one which

does not lie along a mesh line. It is always assumed that the normal
The program

difference

coefficients

has a provision

for overriding

the internally

and it is feasible to hand calculate

for a general Neumann


Appendix

P-5)

1 or 2 applies to the point inside the problem.

The third type of boundary

is zero.

boundary

has the form

2RVl,2 + (R + l/Z)&
where the subscript

Thus a vertical

II. However,

boundary.
in practical

There is a derivation
applications

difference

derivative
computed
coefficients

of these coefficients

to electron optics problems,

in
it is

only rarely necessary to go to such extremes.


A special case of general Neumann
the 45 Neumann

boundary.

using the ordinary

boundary

All that is required is to specify each successive point

Neumann

condition

for both coordinates;

and DELTAZ

= 0. A tilted

boundary

most interest

can frequently

be adequately

normal

and 45 Neumann

3.2

that

is sufficiently
approximated

i.e., both DELTAR


far from the area of
by a combination

of

boundaries.

PROBLEM INPUT

In this section the rules for problem


example and following

through

read this section carefully


familiarity
no attempt

input will be described using an actual

the process line by line. The new user is urged to

while the old user or reader trying

with the program

may well skip this section.

to gain an overall

In this section especially,

will be made to be concise.

Condensed
listing

which can be handled easily is

instructions

and are intended

for problem

input

to be up-to-date.
11

are maintained

A copy of the current

with

the source

version of these

instructions

is printed

which are relevant


Except

in Appendix

to this discussion while studying

for the TITLE,

the program

III. The reader should followthe

boundary

input,

option

are defined at the place in which the program


The definitions

the example.

and ray starting

is by means of the NAMELIST

instructions

cards, all input

by which

certain

variables

expects them.

are by means of short defining statements,

e.g., RLIM

= 50.

A given set of these statements

may be placed on one card, but the number

data cards used is unimportant.

Each set of inputs

e.g., &INPUTl,
NAMELIST

which
card.

must

begin in column

The NAMELIST

order of the entries is unimportant


Reasonable
especially

default

subscripts
a string

2.

Never use column

block is closed by an &END


and not all parameters

but it is usually
of numbers

preferable

separated

final comma before the &END


Preparation
on graph paper.
SLAC injection

for running
Figure

Array

1 of any

entry.

The

need to be included.
parameters,

for the rarely used ones for which the default value is usually
to be ignored.

of

is preceded by a designator,

values have been assigned to all NAMELIST

to cause the parameter

to

designed

elements can be defined with

their

to give the name of the array followed

by commas.

by

All entries are spaced by commas;

is optional.

a problem consists of making a suitable scale drawing

3 shows the region between

gun. Figure 4 is the line-by-line

12

listing

cathode

and grid for the

of the input

data.

q::q ; +;:-}

j....,....,

*,.f-&w-

Figure 3. Example of preparation

:.I ..I.+}

:I.:.:l.

. .

:y.,yrl.,.

to run a problem.

13

--

GINJECT INJECTION GUN MODEL4-IA GRID-CATHODE


REGION(WBH) MOD. 11-20-67
&INPUT1
LSTPOT=2,RLIM=72,ZLIM=40,POTN=4,POT=O.0,500~.0,0.0,0.0,MI=3,MAGSEG=l,
_ .
&END
&INPUT2
Z1=20,Z2=40,Z3=20,BC=0.0,25.0,0.0,0.0,0.0,0.0,0.0,
&END
-0.99
0.0
1
10
-0.4
2.0
1
1 16
-0.1
0.99
3
1 37
-1.0
2.0
38
4
4
-0.8
2.0
IO
4 48
-0.6
0.99
14
55
4
-1.0
2.0
15
56
4
-0.4
2.0
15
57
4
-0.3
2.0
15
58
4
-0.4
2.0
15
59
4
-1.0
2.0
15
4 60
2.0
-0.99
14
4 61
-0.8
-0.2
13
61
4
2.0
-0.7
12
4 62
2.0
-0.7
6
62
4
0.0
-0.7
0
4 62
0.0
2.0
0
66
0
0.0
0.99
0
2 71
2.0
0.99
10
2 71
2.0
0.99
26
2 71
0.99
0.99
2 71 27
0.99
-0.2
27
2 70
0.8
2.0
26
2 69
0.2
-0.3
17
2 49
0.8
2.0
13
41
2
0.4
2.0
13
40
2
0.3
2.0
13
39
2
0.2
11
-- 2.0
2 22
0.3
0.0
10
2
0
2.0
0.0
8
0
0
2.0
0.0
2
0
0
888
&INPUT5
RAD=257, RMAX=37.5, UNITIN=O.Ol,MAXRAY=40.
START='SPHERE', NS-7,
&END

Figure

4.

FORTRAN data

prepared

14

for

the problem

shown in Fig.

3.

--

Title

and Potential

_ -

Cards

Th e fi rs t card of the data set is the title card. The contents of this

(TITLE)

card will appear at various points in the printed

output

and as the title for the

plots. A line up to 80 characters long may be used with any alphanumeric


The second card is &INPUTl,
The following
version
limits

remarks

of the program.
valid with

should use about


smaller,

starting

in column 2.

about array limits

apply specifically

Refer to the condensed set of instructions

5000 mesh points

although

for array

there are occasions when much

larger, numbers of mesh points are useful.

always possible to break a problem

up into sections that

larger than about 5000 to 8000 mesh points.

card is the potential

up the program.

Actually,

card.

It is virtually

are not appreciably

Present versions of the programs

do not charge for points between the upper boundary

setting

to the current

the version that you have. It is suggested that most problems

or somewhat

The third

string.

It contains

of a problem and RLIM.


the basic information

for

any number of lines or cards can be used to

specify the data.


( RLIM)
tion.

RLIM
(ZLIM)

RLIM

is the maximum

is a positive
ZLIM

size of the problem area in the radial direc-

integer; the present limit

is th e maximum

is 100.

size of the problem in the axial direction.

larger than necessary value of ZLIM may affect the way the plots are scaled. If an
attempt

is made to create a boundary

or goes negative,

error messages are printed

the solution of Poissons equation.


300. The present limit
program
(IAX)

which exceeds the limits

ZLIM

and the program

RLIM

by ZLIM,

will not attempt

is a positive integer; the present limit

is

for the total area is 11001 mesh points in the FORTRAN

and 8001 in the C version.


IAX s p eci fi es a depressed axis in cylindrical

coordinates.

for a hollow beam device or for a device that is really in rectangular


but for which it is desired to use some cylindrical
15

features,

It can be used
coordinates

such as the elliptic

--

integral

specification

of the magnetic

field.

IAX

is aninteger

with

the default

value IAX=O.
(POTN)

POTN

is the number of potentials

may be reasons to assign different


same potential.

Normally

number 1 and the anode

the grid, if any, will be number 3. A focus electrode,

potential,

the general cathode starting


thin grid support,

numbers to parts of surfaces which are at the

the cathode will be potential

will be number 2. Usually


even if at cathode

which are to be read in. There

should be assigned a different


method

can intercept

to be applied.

a trajectory,

number

to enable

If an electrode,

such as a

the ray may pass right through the

electrode as if it was a thin ideal grid. If the focus electrode is given the potential
number 4, or 14, 24, etc., a trajectory
the electrode.

for POTN

is 101.

symmetry.

is a negative integer for rectangular symmetry.

rectangular

COORDINATES.

coordinates

assumes rectangular

symmetry

If POTN

to switch to

is negative, the program

and a message: ***RECTANGULAR


appears immediately

COORDI-

after the list of potentials.

The next numbers are the elements of the array of potentials.

are read in order from


means that

1 to POTN.

up to 15 significant

of valid ways of punching


1, 250.000.
potentials

The code to the program

is the sign of POTN.

PHI IS TRANSVERSE

POT(I)

which

The present limit

is a positive integer for cylindrical

RECTANGULAR

NATES,

lines that get

5 is used for a hollow cathode or a shadow grid and should not

be used for the focus electrode.

- POTN

one mesh unit of

These numbered electrodes also stop equipotential

close. Potential

POTN

will stop when within

For NAMELIST,

Potentials

are carried

in double precision

decimal figures can be used.

250 volts are as follows:

They

Examples

250., 250, 2.5302,

the list need consist only of POT

2500E-

= (string

of

separated by commas).

POT(I)
Negative

is an element of an array of floating


potentials

are indicated

point numbers.

by a minus sign, e.g., -250. Negative


16

po-

tentials

are permitted

but it is preferable

to avoid using-them.

Since a constant

can always be added to all potentials,

it is possible to make the most negative

potential

negative numbers

zero. The reason for avoiding

negative and some diagnostics


potentials.
quickly

of the output

On the other hand, certain

examined

if a symmetry

equal + and - potentials.


Note that

are simplified

problems

The program

is intended

are in volts and magnetic


fields or relativistic
perveance

to include

potentials

time will not be affected.

MI

units.

Thus potentials

does not use magnetic

However,

The

there is also nothing

has been run at one set of poten-

optics may be applied to avoid the cost of

again.

If MI = 0 there are no plots generated.

structions

to potential

output.

fields are in gauss. If a problem

MI is a code number which determines

trajectories

corresponding

to be run using engineering

Of course, when a problem

the problem

(MI)

desirable.

One reason for doing this is to get

lines on the plotter

tials, all the scaling rules of electron


running

are certainly

energies, there is no reason not to scale the potentials.

and running

gained by scaling.

that can be

plane or surface is made to be zero by having

numbers which are not used by the problem.


a desired set of equipotential

if there are no negative

have a symmetry

Then negative potentials

it is acceptable

is that space charge is

is printed

for the first

the selection of plots.

However,

and last cycles.

every tenth

point

of the

Refer to the condensed

in-

for a table showing the available options for MI.


is a positive

deliberate
TYME

boundary

or zero.

before printing

If MI

is negative

error for help in debugging

is used to make an internal

guard against

subroutines

integer

running

out of computer

and plotting

it is interpreted

as a

boundaries.

check of how much time is being used to


time,

the results.

TYME

as specified

on a JOB card, just

uses special machine

to measure actual use of CPU time which is the parameter

determine

JOB time and charges in a multitask

variations

in time due to the presence of other jobs on the system.


17

environment.

language
used to

This avoids gross


The subroutine

must be supplied
dummy

by non-S-tanford

subroutines

for TYME

users to suit their hardware

may be used to defeat this feature.

once each cycle and determines

the extra plotting,

etc., that is involved

or, alternatively,

The program

only tests

that there is adequate time left to do

in the last cycle, based on the previous

cycle time.
When time appears limited,
note that:

THERE

BER OF CYCLES.

entirely

cuts out intermediate

IS NOT

ENOUGH

TYME

does not need to correspond

The user may wish to modify


TYME

the program

by setting

In a PC environment,

TIME

TO DO THE

the value according

cycles, with a

SPECIFIED

exactly

NUM-

to the job card.

to his experience,

or disable

it much larger than his JOB card time.


TYME

will cause the program

to drop intermediate

cycles, with the above message, but will not cause the program

to be terminated

early. However, users should be careful to allow enough time, or watch the screen
carefully

to see that cycles are not skipped inadvertently.

LSTPOT

= 1, 2 or 3 causes the program

all- the mesh points.


solution

together

solution

(LSTPOT

cause the printing

= i), or the last solution

from both the first and last cycles (LSTPOT


The parameter
in magnetic

controls

(LSTPOT

parameters

boundary

of the first

and thus

is run many
(LAPLACE)

= 2), or the solutions

= 3).

two of the four possible ways of reading

fields. The example case will be explained

Three additional
the solution

MAGSEG

plot, can show quite

= 0, suppresses this output

if the same or a very similar

The choices for LSTPOT

of

available for the Poisson

with the equipotential

The default value; LSTPOT

saves quite a lot of printing


times.

a table of the potentials

This is the most useful diagnostic

and, when studied

subtle errors.

to print

in the next section.

have been added to the PC program

to control

of Poissons equation;

1. PASS is an integer controlling


solver for the initial

solution.

the number
The default
18

of passes made by the Poisson


value is PASS=2,

but for prob-

lems without
solution

space charge, it is sometimes- desired-to

converge to a better

before doing any ray tracing.

2. XR is the matrix

property

stead of a relaxation
XR=0.995
smaller

called the Spectral

constant

Radius

in the Poisson solver.

that

is used in-

The default

value is

(it must be less than 1.0) but for some small problems,

value may cause the program

to converge faster.

a slightly

It is not recom-

mended that users change XR unless they are prepared to experiment


the effect that it has on the accuracy
3. ERROR

is the error limit

Smaller values tighten


of 10.0 or 0.1.
used together
Laplaces
Magnetic

with

of convergence.

multiplier;

the default

the error limit;

This same parameter


PASS to modify

typically

it is incremented

is defined in &INPUTS.
the accuracy

of the initial

in steps
It can be

solution

of

equation.

optics calculations

that may be present.

include the effects of any external

The input

methods

for magnetic

revised and will be treated later in a special section.


fields then the input could occur at this point.
segments of magnetic

1, etc.

value is ERROR=l.O.

Field Data

Electron

that

with

The namelist

which may be anything

&INPUT2

If there are external magnetic


MAGSEG

signals

one segment for MAGSEG

is called MAGSEG

from constants

fields

fields have been greatly

The parameter

field data will follow;

magnetic

times to read in segments,

to sixth order polynomial

functions

of Z.

Please note that this discussion is only included here to explain the &INPUT2
namelist

data card in Fig.

magnetic

field situation

The magnetic

an axial field starting


sixth

order expression

as an explanation

of the

which will be found in an expanded form below.

The example problem


an example.

4. It is grossly incomplete

contains

a meaningless

field plotted

magnetic

on the right-hand

field inserted only as


side of Fig.

3 shows

at Z = 20 going from 0 to 500 gauss in 20 mesh units.


is used by the program
19

to fit the fields on any segment

of the axis.
segment

The data on t-he card are Zl and Z2, the limits

being described;

seven coefficients

for the segment being described,

= CBC(n)(Z

22 and 23 are integers.

The parameters

- Z3)n-1,

BC(n)

array. The array has been initialized

n = 1 to 7

is an element

of a seven member

A second option,

to -6, ZLIM+G

MAGSEG

real

to zero.

and 0, respectively.

are read in as an array by BC = (string of coefficients

(22 = 100,

The coefficients,

BC,

separated by commas).

= -1, allows the axial array to be read in directly.

See Section 4.4 for a description

of this feature.

Input

The main
conventions
program

(3.6)

Zl, 22 and 23 are read in by simple statements

etc.) and are defaulted

Boundary

and

for the equation:

BZA(Z)

Zl,

23, the origin

of the range of the

thing

for a user of the program

used to input boundary

is for electrostatic

that class of problem.


for the problem
integers followed

optics,

data. Since the primary


the terminology

application

by two floating

program

point numbers.

The C program

and

for the

used will be appropriate

Each line on the table in Fig. 4 represents

in Fig. 3. The FORTRAN

one card for each point.

to learn is the technique

one data card

uses fixed field input;

The fixed field format

uses free field input.

to

three

requires

It is still a good

idea to use one line for each point on the boundary.


The chief feature of the input routines
the problem
typical

that the programmer

problem

of the program

to fill in for segments of

skips. This saves a great deal of labor since a

which uses perhaps 300 boundary

about 50 cards. This technique


ability

is the ability

points may be specified with

will be called fitting

in the description

to fit a curve to three specified data points.


20

for the

Two types of boundaries


the potential
derivative

Neumann

is known.

of the potential

Dirichlet

boundaries

aries represent
component

boundaries

are those on which

are those on which

the normal

is known.
are used to represent metal surfaces.

gaps between

Neumann

surfaces and must be chosen so that

bound-

the normal

of the field is zero since that is the only value that is ever known

practice.

Thus the cathode

boundary

in a typical

For electrostatic
boundaries

is a Dirichlet

example.
problems

A boundary
the boundary
a Neumann
boundary

Neumann

may have any shape


of the smallest

boundaries

details

are possible however,

point is defined as any mesh point less than one mesh unit from
of the problem,

boundary

but always within

are always boundary


points.

and not just a program

which type boundary

the boundary.

points.

is being specified.

The points

The points

This difference,

convention,

in either the R or Z direction

a Neumann

the resolution

to restrict

will be described later in this section.

are never boundary

formulation

boundaries

used. Slanted Neumann

technique

can meet at a corner.

it has been found satisfactory


Dirichlet

in

and the axis is a Neumann

boundaries

the mesh spacing limits

which can be effectively


and the input

boundary

Neumann

to lie along mesh lines.

desired although

boundary

are used: Dirichlet-boundaries

which

on

on a Dirichlet

is inherent

in the

gives rise to a code to determine

Thus, if the distance from a point to a


is zero, then that boundary is defined as

boundary.

There are five entries on each boundary


1. Potential

number,

integer,

elements of the array POT(I)

corresponds

data card;
to the surface numbers

denoting

described earlier.

2. R, integer, the value of the radial coordinate

of the mesh at the boundary

point.
3. Z, integer,

the value of the axial coordinate

point.
21

of the mesh at the boundary

4. DELTAR,

floating

point, the distance from-the

in the radial direction.


radial

line at a point

intersection

in the minus direction

is not significant.

used but typically

In the case of a point

that

if the boundary

number

potentials.

is a Neumann

one mesh unit of a Dirichlet

number.

Otherwise

It is important

boundary

it

to realize

for a Neumann

is a zero for DELTAR

column.

A column

has a DELTAR

the program

be a boundary

and DELTAZ

or DELTAZ

refer to two different

should
surfaces

boundary.
a single point

cannot

be a complete

must have a top point and a bottom

between -1.0 and +l.O.


cannot

point for two Dirichlet

in which, either DELTAR

this also means that

both of these, one point

be within

is

when it is necessary to make some adjustment

to avoid a situation

in which neither

Boundary

number

This is not usually a problem for the programmer.

have two values, or in which DELTAR

However,

the potential

is not the code number

the code for a Neumann

there can be situations

in the problem

of which

within

above, apply.

number is the number for that surface.

cannot simultaneously

surfaces at different

a complete

then

= 0.

A mesh point

Note that

point

is parallel to the azis. If the boundary is a radial plane, then the

code is DELTAZ

However,

boundary,

to punch a zero for the potential

Repeating,

If the

greater than 1.0 could be

The same rules as for DELTAR,

If the point is simultaneously

a zero for the potential

boundary.

Any number

on a Neumann

then the potential

is customary

from the mesh point.

the

point, the distance from the mesh point to the boundary

in the Z or axial direction.

boundary,

intersects

the distance is specified as 2.0 if it is greater than 1.0.

floating

not significant.

is negative if the boundary

is greater than one mesh unit from the boundary

the intersection

5. DELTAZ,

DELTAR

mesh point to the boundary

be a column.

Since one point

The same thing

applies tests for the columns

points must be defined in sequential

point,

each

cannot

have

applies to rows.

only.
order.

one mesh unit in both R and Z. If a boundary


22

row or

Adjacent
point

points must

is not within

one

--

mesh unit of the previous point, then a special procedurastarts

with the purpose

of determining

and filling in the missing point or points.

to as fitting,

fits a second degree equation to the three boundary

by the two cards referred to above and the immediately

This procedure, referred


points defined

next card. The equation

is either of the forms

(3.7)

R = AZ2 + BZ + C, if SLOPE 5 1.0


or
Z = AR2 + BR + C, if SLOPE > 1.0
depending on whether

SLOPE

= ABS[(2Z

+ 1) A + B] is less than or greater

than unity.
Use of fitting

demands some care and understanding

on the part of the user.

It should not be used on curves with more than one curvature


go through
treated

or on curves that

too large an angle, i.e., never more than 45. Such curves should be

as made up of segments of curves with

a single curvature

which can be

defined by a second order equation of the type given above. It is most useful on
long straight

or slightly

curving

segments.

Three points always define a segment and if the third point is missing or goes
around a corner to another segment, the result will be chaotic.
The programmer

must realize that each boundary

two points on the surface at the intersections


points

point may actually

define

in the R and Z directions.

If both

do not lie on the same segment, as may happen at the junction

of two

Neumann

Boundaries,

the program will choose the correct point for each bound-

ary segment.

This is a significant

the program.

It is no longer necessary to provide a data card for one extra point

in each direction

change from the older FORTRAN

from the corner.


23

versions of

In the special,

but quite

corner is a Neumann
boundary

boundary,

and the Neumann

for either DELTAR


at the example

The boundary
as an example.

boundary

or DELTAZ.

number

output

Beginners

DELTAZ.

should clearly understand

point

this; look

below to avoid a common

The POINT

a sequential

it contains a zero. The remaining

and 5 as the following

discussion

one: Potential

column

mistake

CARD,

in detail
POTEN-

is just the point number.

number if such a card exists; otherwise

from fitting.

data as are found

It is useful to compare Figs. 3, 4

progresses.
number

place), DELTAR
=-0.99,

POINT,

columns contain the identical

on the card, or the data resulting

the axis), DELTAZ

entry of 0.0

listing shown on Fig. 5 will now be examined

column contains

the usual starting

refers to the conducting

is defined by an appropriate

Notice that there are seven columns;

Card number

one of- the surfaces at a

been observed in new users.

R. Z, DELTAR,

The CARD

case in which

the potential

for the first boundary

that has frequently

TIAL,

common,

one, (cathode),

R = 0, Z = 1, (this is

= 0.0, (code for Neumann

boundary

along

(-1.0 could have been used but 1.0 for the DELTA

terms can result in some confusion for the fitting

routine).

The point R = 0, Z =

0 could also have been used but it is risky to use -0.01, for example, for DELTAZ
because the curve could try to cross the Z = 0 line before R = 1, thus resulting
a point with two values of DELTAR,

0.0 and some positive

fraction.

also have the result of adding another column to the problem


the resolution

or the actual area, thus resulting

0.99 or 0.999 is frequently

used for DELTAR

24

in a fractional

or DELTAZ.

without

in

This would
increasing

slow down. Thus

:
.
:
:.

Figure

5.

Program output

from the boundary

25

section

using

I.- ..000
I.0.m
Rum
*.- ..I.l.oOm
:.zz
I...a.- :=

the data from Fig.

3.

Card number

two: POT

= 1, R = 16, Z = 1; DELTAR

= 2.6, DELTAZ

=-

0.4. Since R = 16 is more than one unit from R = 0 on card one, the automatic
fitting

routine

will be called.

the cathode surface.


cross within

It will read the next card which

The DELTAR

= 2.0 indicates

one mesh unit in the R direction.

= 37, Z = 3, DELTAR

= 0.99, DELTAZ

must also be on

that the boundary

does not

Card number three: POT

= -0.1. Both DELTAR

= 1, R

and DELTAZ

refer to the same curve segment,

so there is no ambiguity

coordinates

which the curve will fit are: (r = 0, z = O.Ol),

of the points through

(r = 16.0, z = 0.6) and (r = 37.99, z = 3.0).

for the fitting.

It will use Eq.

(3.8) rather

The

than

Eq. (3.7) because the absolute value of the slope is greater than one.
Card number

four:

POT

= 4, R = 38, Z =4, DELTAR

-1.0. Pot = 4 is used to permit

the focus electrode,

distinguished

The -1.0 for DELTAZ

from the cathode.

on the first point

of the set of three.

No fitting

= 2.0, DELTAZ

which this surface is, to be


is inadvisable

but works

since R and Z are 1 mesh unit

from those on card three.


Card number

five: POT

= 4, R = 48, Z = 10, DELTAR

-0.8. This card causes the automatic


Card number
-0.6.

six: POT

This is the third

fitting

procedure

= 2.0, DELTAZ

to be called.

= 4, R = 55, Z = 15, DELTAR

card of the set and fits the straight

= 0.99, DELTAZ

section of the focus

electrode.
The next several cards define the boundary
electrode.

around

The logic should be obvious by inspection.

the point

Fitting

on the focus

is used for the top

of .the focus electrode.


Card number sixteen:

POT

= 0.0. This card is interesting

= 4, R = 62, Z = 0, DELTAR

because it defines the end of the segment to be fit

along the top of the focus electrode

and the beginning

along Z = 0. Because of the Neumann


recognizes the corner condition

= -0.7, DELTAZ

condition

(DELTAZ

and fits to the point


26

of the Neumann

segment

= 0.0) the program

(r = 61.3, z = 0.0.

Card number seventeen: POT = 0, R = 66, Z-= 0, DELTA-R


= 0.0. This is a case where one might forget to skip a point
. . . dont.

Also note especially

R direction
Neumann

= 2.0 . . . there is no surface in the

boundary.

Potential

POT = 2, R = 71, Z = 0, DELTAR

2 is for the anode, which

in this example.

The 0.0 for DELTAZ

Card number twenty:

signifies the vertical

Neumann

This is an extra

card inserted
program

boundary.

segment.

POT = 2, R = 71, Z = 27, DELTAR

would occur if the fitting


different

= 0.99, DELTAZ

is the role played by the gun grid

Note that this card is used to begin the next fitting

= 2.0.

and make R = 63

for more than one mesh unit, even though the point lies right on the

Card number eighteen:


= 0.0.

the DELTAR

= 2.0, DELTAZ

= 0.99, DELTAZ

to avoid the corner

ambiguity

which

had to use the next card which points to two

line segments of the same surface.

Actually,

this data card is a vestige

of an old data set; the extra card next to the corner is no longer required.
Cards number
Z T 27, DELTAR
a short column
not agree with

twenty-one

and twenty-two:

POT

= 0.99 and 0.2, and DELTAZ


to avoid a column

= 2, R = 71 and R = 70,

= 0.99. These two cards form

of length one at the corner.

the design surface, but the location

Clearly

they do

is such that the discrepancy

cannot affect the solution.


The last three boundary
Note that the last card, POT
2.0, specifies the point
defining

the boundary.

ever repeating

conditions

segment

= 0.0, DELTAZ

to the first point,

must be completed

on the axis.

888 in the POT

terminates

thus completely

in this way without

field, or any other potential

the boundary

input.

number

If this number is 999, special

are expected to follow in the input file, as explained

the difference

point.

If there are no special boundary


calculate

adjacent

The boundary

The next card, with

boundary

= 0, R = 0, Z = 2, DELTAR

immediately

a boundary

greater than POTN,

cards define the Neumann

equations

points, then the next step for the program


and to perform
27

below.
is to

some checks on the boundary

data.
Special Boundary

Conditions

A curved

or slanted

eral Neumann

conditions

Neumann

boundary

Neumann

as described

is correctly

0. General Neumann

lated by the program.

except for 45, requires

in Appendix

conditions

values by overwriting

= 0 and DELTAZ

such as dielectric

If 999 is used, the program

R and Z; the coordinates

Dl, D2, D3 and D5; the four coefficients

surfaces,

the difference equations

The normal ending to the boundary

number greater than POTN.

the gen-

II. The special case of a 45

described if both DELTAR

and other boundary

may be put in as calculated

cards containing

boundary,

calcu-

data is by a potential
will commence reading

of an existing

boundary

of the difference equation

point,

and

for the point

(W).
R and Z are integers locating
are the real positive

coefficients

an existing boundary

point.

of the difference equation

Dl, D2, D3 and D5

at (R,Z).

of such cards may be used in any sequence, An R value greater


terminates

points

than

RLIM

this input.

Dielectric
electric

Any number

materials

surface.

may be simulated

values at the di-

The surface must have been defined as a boundary

exist in the data file.

line of dummy

by special boundary

boundary

for this are summarized

Usually

points,

this can be done with

having DELTAR

a simple straight

= DELTAZ

in the condensed instructions

so that the

= 2.0. The rules

and will be explained

in

Section 4.9.
Grids
The program
cluding

can handle electrode

such arrangements

structures

of remarkable

as grids. Of course, in cylindrical

can consist only of a set of rings; the radial support

complexity,

symmetry,

wires do not apply.

in-

the grid
It can

be shown that most of the harm done to a beam by a grid is done by the rings,
28

and that azimuthal

deflections

that would be caused by-the radial wires are less

significant.
Two kinds of grids are of interest:
1. Ideal grids that consist of a thin electrode,
both sides are defined using ordinary
ideal

in the sense that

deflections,
through

to continue

boundary

interception.

grids because, in general,


propagating

a particle

can no longer calculate


crosses the boundary

shape, for which

definitions.

there is no field penetration,

and also no particle

thin

of any arbitrary

fields.

hence no particle

Trajectories

will pass directly

the ray tracing

until

the partial

Such grids are

routines

attempt

differentiation

routine

There is always one iteration

so that the particle

step which

finds itself on the other side of

the electrode.
2. The second type of grid is actually
pointed

out above, must extend in the PHI direction

system.
-

made up of individual

In order to resolve individual

significantly

wires,

finer than the grid spacing.

order to be noticed by the boundary

in either coordinate

the mesh density

definition.

It does not seem to matter


lie on one mesh line. If on a

node, then four adjacent points become boundary

points defining that grid

wire, while if only on a mesh line, then the two adjacent


The closest meaningful

on every second horizontal

grid spacing would

mesh line (for a vertical

This allows for some field to leak through


some grid-induced

particle

are spaced so closely that


the simulation
In defining

deflection

occur if a grid wire lies


or nearly vertical

grid).

the space between wires and for

to occur.

Obviously

if the grid wires

of the ideal grid described above.

it can be necessary

points in order to make the sequential


boundary

points define the

they have the same spacing as the mesh, then

results in the definition

grid wires,

must be

Wires must lie on a mesh line in

if the grid wires lie on a mesh node or simply

wire.

wires, which as

definition

to define
of boundary

to a grid wire, or between wires, and back again.


29

dummy

boundary

points from a real


Dummy

boundary

points consist simply of boundary


It is possible to use boundary
same as for Neumann
line.

Internally

ordinary

array with
rather

boundaries,

points,

messy looking

Boundary

boundaries;

treat

dummy

points.

line must lie on a mesh

boundary

The boundary

from such a grid structure.


a complex

one with

hence the least amount

the rules are the

points

Usually

as if they are

are found in the

plots

are apt to be

the game in defining

grids, is to do it with

the fewest

of work.

Diagnostics

If the input
is: SPECTRAL
program

will

andDELTAZ=2.0.

except that their difference coefficients

especially

of points,

for dummy

that is, the boundary

all the other boundary

any boundary,
number

fitting

the program

interior

points with both DELTAR

data are acceptable,


RADIUS=0.995.

for the convergence

BOUNDARY

ERROR

the next message printed

The spectral

of the solution

IN COLUMN

radius is a constant

of Poissons equation.

in the middle

of the listing

and 0 5 2 5 ZLIM,

exceeded the maximum

number allowed which is presently

from an error in boundary

calculation

fitting

of boundary

data have exceeded the limits

lem, 0 5 R 5 RLIM

sage appears if the boundary

used by the

XX

If this message appears somewhere


data, it is a signal that the boundary

on the output

or that

of the prob-

the boundary

goes into a loop.

data have

1101. Thus, this mesLoops usually

as might be caused by omitting

result

one of the three

points of a line segment.


The FORTRAN
and complete

program

the listing

problem

will not attempt

program

in trying

found.

The program

computation
However,

the

to run and there may be other errors caused by the

to interpret

the program

to pick up the boundary

even after such an error has been found.

In the PC environment,
by having

will attempt

the rest of the boundary.


the interactive

stop immediately

nature of boundary

is favored

when this type of boundary

makes a plot file which can be immediately


30

input

plotted

error is
to the

monitor

screen, and showshow

far the boundary-has

progressed.Sometimes

is enough to show where the error is, but if not, then the program
can be called up to the terminal

this

output

file

and the progress can be charted to a particular

data point.

BOUNDARY

ERROR IN COLUMN

XX

If this message appears at the end of the boundary


the program

checks have found an error.

requirement

that each column

The program

listing

it indicates

checks are based on the

must have a top and a bottom.

be more than one segment to a column,

the requirement

that

Since there can

translates

to mean that

there must be an even number of ends for each value of Z. An end is defined by a

DELTAR

value between +l

and -1. Thus the programmer

need only determine

why there are not an even number of such points for the indicated
Note that

there are similar

checks which

could be made but arent.

row must have two ends also, but no such check is included.
bottom

boundary

mistakes

Each

Also obviously

between 0.0 and -1.0, not greater than 0.0. This

end must have DELTAR

and similar

column.

are left to the programmers

care to prevent

or

correct.
CHECK

BOUNDARY

The CHECK

POINTS

BOUNDARY

....

POINTS

messages are warnings

that

nostics has located an unusual condition.

These may be perfectly

correct points,

but the programmer

should examine each such message and satisfy himself why

it has been singled out and that it is indeed correct.


ple, good at detecting
adjacent

boundary

execution

sign errors on DELTAR

points

messages do not inhibit


In the C version,

have opposite

These checks are, for exam-

and DELTAZ

values.

signs, but not usually.

Sometimes

The warning

operation.
all these diagnostic

and are also printed

for the warning

the diag-

messages appear on the screen during

in the output

listing.

Programmers

messages when any new or changed boundary

time.
31

should check

is run for the first

BOUNDARY

ERROR-OR

MI NEGATIVE

If this message appears at the end of the boundary


must check for messages of the previous
has set MI negative,
is worthwhile
boundary

one plot including


frequently
printout

then the boundary

for the programmer

errors.

The programmer
equipotential

become glaringly

data have passed the program

to catch other

on examination

Unsuspected

of a plot.

caused by LSTPOT

errors

The optional

> 0, should

always be

configuration.

POISSON'S EQUATION SOLVER

the program

input,

makes the first solution

and before reading the starting


of Poissons

equation

conditions,

(actually

at this point since there is no space charge, hence right-hand

equals zero). The description


here for a brief description
The program
Mathematically,

a matrix

one column.

of the mechanics of the solution


set of equations

for a column

side (R.H.)

consists

columns

values, and the end points are also knowns.


or, in the case of a Neumann

boundary,

of a tridiagonal

at a time.

matrix

which

of each of the points in

are assumed to contain

known

That is, either the value is known

the adjacent

being solved since the derivative

is known as the semi-iterative

of Poissons equation.

for one column

to find values for the potential

To do this, the adjacent

the same as the point

Laplaces

of the input data for the example will be interrupted

solves the complete

must be solved (inverted)

method

carefully

checks. It

should also always endeavor to get at least

obvious

After reading the boundary

equation

the programmer

If there are none, and he

lines of any new geometry.

of the table of potentials

listing

to look at the output

used for a new or revised boundary


3.3

two types.

Chebyshev

point

is assumed to be

is zero.

method

The relaxation

and is described by

Varga.8
Each column consists of two or more points, with upper and lower end points
being boundary

points for which -1.0 5 DELTAR

at the top and bottom

a condition,

< 1.0 Thus each column

either Neumann

32

or Dirichlet,

has

that permits

the program
column

to write

a set of n equations

of the problem

than one segment

in n unknowns

area defined simply

which

for that

column.

by the value of Z, may have more

must each meet the above definition

of a column.

Each such column must have its proper ends. In the example problem,
two columns

for each value of Z up to and including

When a column
nate columns

is solved, the adjacent

C program)

there are

Z = 14.

columns

are considered

fixed.

are solved so that on two passes first the odd numbered

and then the even numbered

columns

are solved.

or less if the error criterion

After

is satisfied,

columns

50 iterations,

the calculation

Alter-

(25 in the
is stopped

and a message is printed:


N=51,

ERR = X.XXE

- XX.
(the counter is already set to 51) the

This is the signal that after 50 iterations


largest single change of a potential

is ERR volts.

adjusted

ERROR.

tightened

by using the parameter


by a factor

areas of Neumann

by giving

the program

a better

present versions

of the program

The FORTRAN

program

passes each.
iterations
inclusion

Certain

is automatically

problems

starting

either by iterating
distribution.

are much superior

using large

The initialization

has had the same improvements

the iteration

the field is sufficiently

for more cycles or

as have been installed

in two sets of 25 iterative

process is quite satisfactory

determined

of the

to those in earler versions.

and allow it to seek convergence

Generally

can be

are subject to slow convergence so that the results

This can be remedied

in the C program,

The error criterion

of ten for the final cycle.

boundaries,

may be incorrect.

The convergence criterion

to start ray tracing

and after 50
leading to the

of space charge.

If the Poisson solver detects that the solution


with a message, POISSON
means there is a boundary

is not converging

EQN FAILS TO CONVERGE.

it will stop

As a general rule, this

error, but there are at least two situations

in which

the user may have to try to fool the test:


1. If a drift

tube or structure

is simulated
33

with

little

or no voltage

on any

electrode,
message.

the injection

The cure is to specify

array. The potential


that is actually

a significant

the the convergence

positive

does not have to correspond

voltage

in the POT

to an element of the array

used on the boundary.

2. The second condition


solution

of space charge may trigger

under which this message may occur is if the Laplace

is very slow due to, for example, the large area of Neumann

ary noted above. The cure, if everything


above; specify

a potential

that

bound-

else appears okay, is the same as

is, for example,

ten times larger than the

largest one in the problem.


After

finishing

POTLIST,

is printed

potential)
ground

the first

giving the potential

for every point in the RLIM


points

the problem.

(points

behind

The POTLIST

should always be studied


example,
thereby

cycle of Poissons

equation,

(normalized

by ZLIM

a potential

for peculiarities.

space. Since this includes back-

effective

trace the outline


diagnostic

An error in boundary

leave a strange zero in the middle of the high potential


greatly

tial plots,

distorting

the fields.

it is possible to pinpoint

suppressed by setting

LSTPOT

When used together


errors in a few minutes.

= 0 in &INPUTl.

34

or

to 100% of the maximum

the surfaces) one can usually


is an exceptionally

map,

of

device and

data may, for


part of a device,

with

the equipoten-

The POTLIST

is

4. STARTING
After the first calculation
ing conditions.
which

those variables
specified.

of Poissons equation,

The format

the variable

CONDITIONS

is NAMELIST

is named followed

the program reads the start-

consisting

of defining

by an equal sign and the value.

that need to be altered from the default

The sample problem demonstrates

how little

in many cases. Using the sample problem,


the technique.

conditions

included

the following

in the program.

be added, the user must refer to the comments

in

Only

need to be

data needs to be specified


remarks will

In the rest of this section, a brief description

of the options currently

equations

illustrate

will be given for each

Since other options can always

in the program for the up-to-date

implementation.
The sample problem
with

&INPUT5

SPHERE
RAD

is coded as a spherical

signals that the namelist

directs that the spherical

= 257 and RMAX

respectively.

UNITIN
unit.

immediately

converted

prints

function

diode conditions

= 0.01 specifies that


scaling

conditions

radius

4.3 Plotting;

and cathode

the scale of the problem

is in MKSA

units

so that

radius
is 0.01

UNITIN

is

parameters.

are described in the following

apply to more than one case,

4.2 Equipotential

START

will be used. The entries

as follows:

4.1 Universal;

The entry

to unit in meters. After reading these items the program

a table of all the starting

The starting

entries follows.

= 37.5 give the spherical

All problem

inches/mesh

diode or Pierce gun. The card

lines; controls equipotential

plot controls,

35

plotting,

Sections according

to

4.4 Magnetic

fields; input

4.5 General cathode;


4.6 Spherical

and calculation

parameters

cathode;

parameters

controlling

parameters

for magnetic

fields,

the general cathode option,

which specifically

apply to the spherical

cathode option.
4.7 Card starting;

parameters

controlling

the use of user specified

starting

conditions.
4.8 Laplace starting;
plications

controlling

for ap-

Boundaries;

how dielectric

materials

can be included

in the

specification.

UNIVERSAL PARAMETERS

4.1

For each starting

parameter,

there is a default value which will be the value

used if it is not changed by the input.

In the following

will be given as described by the program


INSTRUCTION

DEFAULT,

This will be followed


in UPPER

determined
PERVO=
PERVO
= SPHERE
constant

the entries

with the format:

COMMENT

MAX

CASE are selected verbatim

appears for the default

comments

discussions,

by a discussion of the use of the parameter.

which appear in Appendix

.-

the use of the program

other than ray tracing.

4.9 Dielectric
problem

parameters

The lines

quotes from the Condensed Instructions

III. When a second number,

value, it refers to the maximum

separated

by a comma,

allowed value, usually

by array limits.
X.Xx
is the initial
or START

PERVO

= 0

ZERO USES LAPLACE/

value of the perveance of the beam for either the START


= GENERAL

methods.

K in the expression

36

Perveance

is defined as the

I = M x v3i2 x lo6
-.
Here K is expressed in micropervs
1.0 device operating

so that,

for example,

at lo4 volts would have a current

a microperveance

of 1.0 A. The entry X.Xx

indicates that a decimal number is the expected value. When a single X is used, it
implies that an integer is expected.
number of significant

The Xs do not indicate the input format;

figures is not restricted

except by the computer

the

hardware,

and by the logic of the program.


PERVO

normally

controls

only the perveance

it may be held for any desired number


process by which the program
calculated
cycle.

for a given cycle with

value.

the perveance

averaging

method

than with

or from prior calculations.

that

actually

takes the value of perveance

simply

= X. The

used in the preceding

arriving

better

to be correct

value PERVO

calculated

the current

in quickly

it is frequently

a value known
The default

to start

= X

with

the

from experiment

= 0 is a code instruction

for the LAPLACE

solution

and

The new

is advised to use the default value until specific experiences

lead him to try something


HOLD

per ray.

at a stable

divides it by two to arrive at the perveance for the first cycle.

user of the program

However,

perveance is to average the perveance

process has proven very effective

It has been so successful

cycle.

of cycles by using HOLD

The new averaged value is then used to determine

The averaging

which

determines

of the first

HOLD

else.
= 1

PERVO

HOLDS

FOR HOLD

PROGRAM

CYCLES
HOLD
.

= 2 or more causes the input value of PERVO

37

to remain unchanged

by the averaging

process for HOLD

particularly

very nonuniform

establish

with

by running

application

loading,

with

There are some problems,


where using HOLD

for the process to stabilize.

a fixed reduced perveance.

Then, of course,

must be at least as large as NS.


PE = 0.1

PE is the incremental
the combined

INITIAL

ENERGY

potential

PE is only used for starting

for calculating

the initial

AT CATHODE

energy that is added to every trajectory

effect of work function

and HOLD,

conditions.

with

and thermal

IN EV
to account for

energy. Like PERVO

one of the Childs

It is normally

Law routines

not necessary to have any

PE, but some small changes may be observed by varying

it. In a few low

emission devices, it has been found essential to have some initial

energy to avoid

instabilities

near the cathode.

ERROR

= X.X

ERROR

ERROR

multiplies

the built

that an adequate solution

MULTIPLIES

= 1.0

iterates

if there are large areas of Neumann


e.g., ERROR

to converge at all. Slow convergence is indicated

three times, prints

TEST

in error test by which the program

it may be necessary to reduce the allowed error,


the program

ERROR

determines

of Poissons equation has been reached. If the problem

is slow to converge, particularly

boundary,

= 0.1, to get

if each cycle only

N = 3, ERR = nnn, and calculates

the trajectories.

On the last cycle, the error test is reduced by a factor of 10 from whatever
-

helps

temperature limited emission conditions

is to simulate

the entire problem

PE = X.X

initial

cathode

cycles.

the necessary space charge environment

more frequent

HOLD

program

was set by the user.


a later section.

Some hints about convergence

The ERR

value returned

by the program

change of any mesh point during the last iterative


.

38

problems

level

will be found in

is the largest single

cycle, in volts.

UNIT

UNIT

= X.XxX

UNITIN

= X.XxX

= 0.001

METERS/MESH

UNIT

(SEE UNIT)

INCHES/MESH

UNIT

The default scale value for the program


is given for UNITIN
to meters.

is 0.001 meters/mesh

for problems

using magnetic

All the standard

electron optics can be used once a problem

has been solved.

LSTRH

= X

is mostly

a map of deposited

= 0

IF>O, PRINTS

used as a diagnostic

converted

fields, the optics of an electron

gun does not depend on the scale factor.

This option

If a value

(mc h es / mesh unit) this value will be immediately

Except

LSTRH

unit.

rules of scaling in

SPACE

for program

space charge with the same format

CHARGE

debugging.

MAP
It prints

as the POTLST

map of

potentials.
MAXRAY

MAXRAY

= XX

If MAXRAY
MAXRAY

IS NEGATIVE,
determines

be calculated.

= 27,101
THE

MAXIMUM

NUMBER

the maximum

= GENERAL

a program

unless the value of MAXRAY

the program

OF RAYS=ABS(MAXRAY)

have a limit

rays used by START

MAXRAY,

OF RAYS

number of electron trajectories

The arrays for trajectories

algorithm

NUMBER

or START

that can

of 101. The number

= SPHERE

is determined

is negative.

tries to make the largest possible

Within

integral

of
by

the limit
number

of

rays per mesh unit at the cathode.

STEP

STEP

= O.XX

STEP

is the iteration

---- for the program

to properly

= 0.8

UNITS/STEP

step length for ray tracing.

It must be less than 1.0

account for space charge, calculate

etc., when crossing a mesh line.


thus the program
.

MESH

The equations

of motion

magnetic

are time dependent,

uses STEP to calculate step time from the velocity

39

fields,

at the start

of the step. Since the electron can accelerate during a step, it may may actually
go slightly

farther

than STEP. The default value is about the largest that should

be used. If magnetic
a factor

of two.

of two.

Shortening

On the last cycle, STEP

is automatically

the step means more time will

As a rule of thumb,
equation

fields are present, STEP should usually be reduced at least

the program

spends roughly

and half with the ray tracing.

could increase running

time by about

to solve the differential


small steps anyway,

equations

be required

method

is used

Because of the necessity

to take

and because of the time needed, the program

any of the predictor-corrector

techniques

of verifying

frequent

become glaringly

in one step, and fly out of the problem

NUMBER

NS defines the number


is used as the running
Initially

variable

NL = NS. The default

is having trouble

converging

-.-- charge, it is advisable


reduction

of program

of ERROR

NS is the number

to still

OF PROGRAM

value is usually

on the perveance.

conservation

,0 > 1.0. At

runs.

In the program,

NL

of cycles left to be run.

acceptable

unless the program

For the special case of no space

use NS = 2 to gain the insight

and STEP on the final cycle. For START

of times that Laplaces equation

40

The most

CYCLES

cycles to be made.

to record the number

fields

area with /3 > 1.0,

when a ray ends with

the very least, this is a signal to reduce STEP in subsequent


NS = 7

if magnetic

to get too close to the axis, violate

where p = V/C. An error message is printed

NS = X

Experience

obvious when the plots are examined.

effect is for a trajectory

of angular momentum

does not use

step length.

has shown that errors due to STEP being too large, especially
are included,

Poissons

STEP by a factor of two

The Runge-Kutta

of motion.

for a problem.

half of the time with

Thus reducing
25%.

reduced by a factor

will be cycled.

afforded

by the

= LAPLACE,

SPC=X.X

SPC=O.5

SPC SIMULATES
SPC IS THE

ESTIMATED

PARAXIAL

FRACTION

SPC = 1 FOR FULL


SPC determines

EFFECT,

RADIAL

FORCE

of the ordinary

forces play a strong part in the focusing,


effect.

radial

distribution

of motion

calculated,

to lie in a conductor

calculated

in sequence starting

electron

gun calculation

one direction,
0.5. Further

a better

electrostatic

the external

electrostatic

If not opposed by space charge on the first


over focus leading to a poor

simulating

at the cathode and extending

choice is SPC=O.5

which

attenuates

forces as it gains in energy.

For other types of problems,

sheet of current

on distance

In rectangular

in only

the radial

force by

Empirically,

SPC only affects the first cycle, the program

starting

from

SPC simulates

does not involve reflection

off by SPC = 0.0.

will usually

at a satisfactory

41

it has been

force (which does not depend

which should be turned

it. SPC can be useful in arriving

involving

coordinates,

on the axis. If the problem

from the x-axis)

infinitely

the user should be aware of the fact

about the R = 0 plane, then there is a transverse


._

of all the rays

SPC = 0.5 is a less logical choice, but the beam

that SPC exists and can be changed.


an infinite

SPC = 1.0, adds a

all the current,

found that SPC = 0.5 is a good choice for gun problems


the cathode.

fields usually

with the ray nearest to the axis. In the case of an

starting

to radial

force that

on the axis. Thus it is assumed that the rays are

from the cathode,

is less sensitive

USED.

of the space charge. The full contribution,

term to the radial equation

CYCLE.

In a device in which space charge

cycle, these forces may cause the rays to strongly


initial

ON FIRST

SPC = 0 FOR NO EFFECT.

will be applied to the rays on the first cycle.

have a strong radial focusing

CHARGE

APPROXIMATION

OF THE

the fraction

SPACE

solution

forgive

Since

any misuse of

of one usually difficult

problem,

that of a long thin beam with

This can be a difficult


which frequently

problem

magnetic

to get to stabilize

finds a large fraction

fields providing

because of the poor aspect ratio

of the beam within

one or two mesh units

of the axis. However, it is usually well represented by the paraxial


so that a single cycle run, NS = 1, with SPC = 1, will frequently
solution.

of Laplaces
PHILIM

equation

was attained.

= 0.0

AZIMUTHAL

PHILIM

= X.X

PHILIM

.NE. 0 ENDS TRAJECTORY

For special applications,


the program

magnetic

field.

SAVE =l

is stopped.

PHILIM

SAVE = 0

after the first problem,


conditions.

most computer

without
-

is an electron

orbiting

coordinates

SAVE = 1 SAVES BOUNDARIES


BOUNDARY

CARDS

FROM

NEXT

to expect a second problem

and that the second problem

there is no particular

run from load modules,

in a uniform

coordinates.

It is always possible tobrun tandem

facilities,

linked with very little

AT PHI .GT. PHILIM

An example

SAVE = 1 is a signal to the program

boundary

LIMIT

has the units of PHI; radians in cylindrical

TO USE SAVE = 1, OMIT

usually

result in a good

it is possible to establish an orbit that would continue

and mesh units in rectangular

diately

approximation

In this case one must be sure that STEP is small enough and that an

adequate solution

until

the focusing.

incentive

or from a library

run imme-

will use the same

problems

although,

to do so. Programs

of compiled

expense, and separate problems

PROBLEM

subroutines

at
are

to be

can be run independently

the risk that a failure in the first problem will affect or knock out the sec-

ond one. However, in the case where successive problems use the same boundary
conditions,

considerable

the boundaries,

savings in effort and computer

which also saves the arrays of potentials

42

time can result by saving


and space charge.

The SAVE = 1 parameter

is put in the starting

conditions

of the first problem,

not the second one unless there is still to be a third problem.


the second problem

starts immediately

with

no control

cards.

title,

potential,

magnetic

accompanying

after the last data card of the first deck

The second deck is complete


fields, etc., except that

large potential

number

start

in the potential

out just

including

the boundary

cards and the

The potentials

is changed, the program

map proportionately.

as if a cold start

in every respect including

card are omitted.

changed between runs; if the largest potential


all potentials

The data deck for

Otherwise

can be
will scale

the program

was being made, except that

will

the old solution,

the last space charge array, is used as a preload.

One example

of the use of SAVE

changes of either voltage or magnetic


the Laplace solution
mann boundaries.
LAPLACE

is difficult

is to be able to trace rays with


fields. Another

small

use is in the case in which

to achieve because of extended

lengths of Neu-

In this case, it may help to run the first part with

START

and SAVE = 1 and then do the ray tracing

in the following

problem.

This saves the time and expense of doing ray tracing

in an incorrect

potential

distribution.

This procedure

is not normally

required

allows the program

to improve

the solution

charge is entered.

Note that

the PC program

that

allow the user to obtain

parameters

on successive iterations

solution

has input

items

of Laplaces

as the space
in &INPUT1

equation

using the

PASS and ERROR.

In older FORTRAN
-- trodes separated

versions of EGUN,

the special case of a pair of elec-

by a long length of Neumann

causes special problems


using START

a better

since the usual procedure

with

= LAPLACE.

convergence
An alternative

43

that

boundary
might

method,

parallel

respond

to the z-axis

to the approach

which is easier, is to intro-

duce a few boundary

points along the top or bottom

potential

numbers.

If the corresponding

potential

list, represent approximate

at that point, then the starting


normal

starting

to an appropriate

except that the potential

element of the POT

array.

senses the desired potentials


and linearly

In a problem

boundaries

with

Neumann

but

points are exactly

like

number

is given and refers

the preload,

(both FORTRAN

of each row, or row segment,

of Neumann

After

significance,

the Neumann

change accordingly.

In the newer versions of the program


routine

in the final solution

load is of very little

The special boundary

points relax as usual and the potentials

in preload

with

which must be entered in the

values for the potentials

the starting

in this special case it can be crucial.


points,

boundaries,

load to the program will be much better than the

load. Usually

the usual Neumann

voltages,

Neumann

and C), a better built-

at the left and right hand ends

interpolates

the starting

potentials.

at one end of a row, and large areas

surface in general, it may still be sometimes

useful to employ

the

above strategy.
SAVE = 2
FROM

PREVIOUS

USE ONLY

USES FINAL

SAVE = 0

WHEN

RUN TO START
START

SAVE = 2 allows consecutive


problem

as the initial

and positioning
-- below.

conditions

adjustments

DATA
THIS

RUN.

= CARDS.
runs to use the final conditions
of the succeeding problem.

Necessary scaling

are made as described under START

The SAVE = 2 goes in &INPUT5

of a preceding

= CARDS,

of the second run.

The dual use of SAVE = 1 and SAVE = 2 in one problem

is possible and is

signaled by SAVE = 3. It is more common to use SAVE = 1 on the first problem


.

44

followed
drift

by SAVE = 2 in the second. SAVE = 3 simulates

tube, periodic
MASS

= X.X

MASS

IS THE

focusing
MASS

LIKE

OR ELECTRIC

RATIO,

although

= CARDS.

WITHOUT

INERTIA;

FLUX

LINES

LINES.

ionized tritium
for starting

into the program

1.0 FOR PROTONS

OF MASS FOR RAYS

that particles

The units are in 1836 electron

Law routines

negative,

> 0 FOR IONS

CAN BE USED FOR MAGNETIC

FIELD

be 1.0 and a doubly

built

MASS

is used to signal the program

to be followed.

Childs

= 0.0

VALUES

IN MOLASSES,

MASS

section, etc.

MASS TO CHARGE

USE NEGATIVE

the repeated use of a

Ion problems

negative current

See the discussion

masses, so that

a proton

(positive

Note that

the intrinsic

are normally

The
charge

run as if charge is

charges) are permitted

about multiple

are

would

ion would be 3/2 = 1.5, for example.


still function.

is negative.

other than electrons

species with

for START

different

masses in

the section on START=CARDS.


AV = X

AV = 0

AVR = 1.0

AVR = X.X
IN PRECEDING
AV and AVR

PROGRAM
are companion

aging the contribution


confused with
-- emission

SPACE

AVERAGED

WEIGHT

OF SPACE

CYCLE

LAST

AV CYCLES

CHARGE

FOR AV.

parameters

to help improve

of space charge over successive cycles.

the different

averaging

CHARGE

process of emission averaging.

and space charge averaging

stability

It should not be

In fact, to keep the

from affecting

each other,

suggested that AV be small enough so that the emission averaging


complete

before space charge averaging starts.

45

by aver-

it is

is essentially

Note that AV is for the last AV

cycles, e.g., if NS = 7 and AV = 3, then only cycles 5, 6 and 7 are averaged.


However,

this may have a very small effect since the -trajectory

cycle 5 are not affected and the space charge determined

calculations

of

by the cycle 7 is never

used (since there is no cycle 8). Thus the effect of averaging is only observed for
AV-1 cycles.
AVR

AVR

determines

the weight

of the previous

= 1.0, the space charge from the previous

cycle is weighted

the present cycle. AVR can have any value, 0 < AVR <
Experience
one might

with

averaging

anticipate.

A poorly

and resulting
averaging.

application

designed gun, with

of averaging

does not do much to solve the inherent


self-magnetic
cycle format

problems.

cycle only with


Even better

strong spherical

to relativistic
difficulty

The solution

the paraxial

approximation

even with

high intensity

beams

caused by the fact that

has difficulty

to this situation

With

converging

is frequently

the

the two-

cycle and selfon long beam


to use the first

and SPC = 1.0 as described

in many cases, is the new feature

than

aberrations

and converge poorly

(i.e., space charge from the previous

fields from the present cycle) the program


transport

with

co.

field forces nearly cancel the space charge forces.


of the program

equally

has shown the effect to be less dramatic

crossovers, is likely to be unstable


Also,

cycle such that with

using the parameter

above.

ZDOTEQ,

described below.
BEND
GAUSS
AXIALLY

= X.X
IN THE

BEND

= 0.0

DIRECTION

SYMMETRIC

MAGNETIC
NORMAL

PROBLEMS.

BENDING

TO THE
FIELD

intended to simulate
have tight

tolerance

effects of stray magnetic


for transverse

magnetic

46

R-Z PLANE

MUST

This feature is most useful for problems with little

FIELD

IN
FOR

BE UNIFORM.

or no space charge, and is

fields. Various types of photo tubes


field effects.

Residual

transverse

fields, earths
rectangular

field, etc., can be calculated.

coordinate

be simulated

geometry,

including

a cylindrical

transversefield

beam in a

and space charge, can

as described below.

MAGMLT

= X.X

MAGMLT

= 1.0

MAGMLT

multiplies

the entire

BZA(

calculated

Note that

internally.

It also multiplies

option is used. It can be thought

MULTIPLIES

BZA ARRAY

) array after it has been read in or

the entire vector potential

of as a knob on all the magnetic

array if that
field generating

power supplies.
IPBP

= Kl,

IPBP=

K2,...K6

FOR POINT-BY-POINT
K, RHO,

ZETA,

PRINTOUT:

RDOT,

In special situations,

ZDOT,

especially

it is useful to be able to print


the last program

cycle.

0 UP TO SIX RAY NUMBERS

TDOT,

PHI, BR, BZ, STEP, BPHI

when program

out every iterative

Thus if for example

behavior

step. This feature operates on

a bug is stopping

the first cycle, it is necessary to set NS = 1 and set IPBP


trajectory

at question).

is not as expected,

the program

= (the number of the

Note that it is possible to generate a great deal of paper

this way. In some cases, one might rather have other items printed
the above list.

in

It is a simple change to substitute

than those in

ER, EZ, etc., for BR, BZ, for

example.
ZEND

CAUTION:
-

SPACE

ZEND

= X.X

IF ZEND

CHARGE

Normally
the electric

IS NOT

DISTRIBUTION

a trajectory
fields.

= 1000.0

is calculated

EXACT

END OF TRAJECTORY

THE

RIGHT-HAND

MAY

BE INCORRECT.

BOUNDARY,

THE

until the program can no longer determine

Thus the trajectories

47

usually

go up to one-half

mesh unit

beyond the boundaries.

In special situations,

this makes exact interpretation


value causes the program
through

of the results difficult.

Setting

to back up to this value when

this value of zeta.

being accelerated

such as high-resolution

This feature

as it strikes

option

VION

ZEND to a specific
a trajectory

passes

can be useful when a particle

the end wall of a device.

is still

The acceleration

metal causes the final energy to be higher than is physically


ZEND

photo tubes,

possible,

into

but the

can stop the ray at the surface.

= X.X

USE VION

VION=-lE8

TO SIMULATE

LOWEST
SPACE

POTENTIAL

CHARGE

PERMITTED

NEUTRALIZATION.

Space charge depression can be reduced in a real device by positive

ions in an

electron beam or by electron clouds in an ion beam. Since the program

normally

runs with negative charges, the above cases both result in negative space charge
depression.

If it is desired to limit

depressed potential

that

the depression, VION

is desired.

The default

enough so that it will never inadvertently


ZDOTEQ=O.l-1.0

disturb

ZDOTEQ=l.O

can be set to the lowest

value is intended
a practical

LEVEL

problem.

TO ENTER

EBQ MODE

The EBQ mode is a new EGN feature which allows the program
in the mode in which self magnetic
charge by a factor

field is accounted

(l-ZDOT*ZDOT),

name EBQ comes from the program

to be low

to operate

for by reducing

where ZDOT=v,/c.
of that name written

the space

The choice of the


by Art Paul of LLNL.

Users of EGN who have found instabilities

with long, thin semi-relativistic

should find setting

level below that of their beam, should

give improved

ZDOTEQ

results.

at a velocity

Some explanation

what took so long, may be useful.


design, meaning

finding

of why this feature

The primary

the space charge limited

48

is so special, and

purpose of this program


current

beams

is gun

and optics from a gun.

Any change of space charge forces must preserve that purpose.


test is made on every time step of every particle,
does not exceed the level ZDOTEQ.
that part where ZDOT>ZDOTEQ,
the space charge deposited
of thin relativistic
ZDOTEQ
to the drift
longitudinal

the self magnetic

is reduced.

tube, (see the final printout

electric fields become negligible

If the plot

MI

and the transverse focusing becomes


fields and space charge.

better

control

parameter

first finding

times.

on the potential

If the entire problem

card,

has been set to

lines will be called at

is at one potential,

it is usually

plots.
to find the equipotential

point for the potential

potential

point of that potential


program
.

which may be used to control the output

MI,

used in the program

a starting

- a line of constant

with.

which draw equipotential

not to call for equipotential

The method

Users should

lines.

5 6, then the subroutines

the appropriate

where the

PLOTS,

list the parameters

of the equipotential

to a value appropriate

PLOTS

FOR EQUIPOTENTIAL

The instructions

in an electron gun if the value

column for values of ZDOT),

consider this feature as a knob to experiment

INPUT

in only

field field is set to zero and

chosen. The idea is to set ZDOTEQ

EQUIPOTENTIAL

ZDOT,

The intent of this is to solve the problem

a balance of forces between self magnetic

4.2

checking that velocity,

If it does, then for that trajectory,

beams, and also to still function

is carefully

The EBQ mode

from that point.

will necessarily

to be followed,

line for V = bx

49

and then following

This does not guarantee that every

be found and plotted.

always draws the equipotential

lines consists of

If POT
POT

(2)# 0, the

(2) where b =

0.05, 0.15, 0.25, 0.,35, . . . 0.95. Also if POT


w h ere b = 0.2, 0.4, 0.6,0.8,

V=bxPOT(3)
at the points
POT

on the axis which

(3)# 0, the program

1.0. Normally

are at that potential.

draws lines for

the lines are started

The expectation

is that

(2) will b e used for the anode and POT (3) will be used for the grid, if any.

If, for example, one is designing a gridded gun to be operated


then, by first designing

the gun as a diode, and plotting

POT

(2), one gets the ideal contour for the grid to be electrically
EQUIPR

EQUIPR

= X.X

EQUIPR

is the radius

potentials

of the line along which

which are to be plotted.

that the equipotential

0 line).

lets the programmer

program

should look for the starting

LM = 303

LM = XXX

faces with POT(4),

invisible.
FOR EQUIP.

the program

lines do not intersect


indicate

LINES

hunts for the


in rectan-

the z-axis, (R =

along which horizontal

line the

points.

LENGTH

OF EQUIPOTENTIALS

LM is the array limit for the points to be plotted


a line simply stops in midstream,

(3) at 0.01 POT

It sometimes happens, particularly

gular coordinates,
EQUIPR

R-INTERSECT.

= 0.0

0.01 VA,

at VG =

for any one equipotential.

If

it may be desired to increase LM. Note that sur-

14, 24, etc., which stop trajectories,

also cause equipotentials

to stop when they get near one of these potentials.

EQLN = 0 to 20
EQLN

controls

the equipotential
- sharply

curving

EQLN

the iterative

= 1

NO. OF CORRECTIONS

corrections

line These corrections


equipotential

lines.

made as each point

prevent

The default

the lines from

deviating

value, EQLN

= 1, is usually

adequate.

EQST = X

EQST = 2

STEPS PER MESH

50

is found along

UNIT

from

EQST gives the density of points for the equipotential


length of a line is given by the ratio LM/EQST.
long), fine detail may be smoothed
ALSO

APPLIED

This footnote
routine

the parameters
surface.
variable
IZl

(but

may determine

for this application

that

CATHODE

is not plotted),

the accuracy
EQLN

and thus

of the starting

and EQST

are made

parameters.
IZl

= x, IZ2 = x, IZS = x
EQUIPOTENTIALS

= 0, IZ2 = -1, IZS = 10,

AT THE

INDICATED

VALUES

and IZ2 are the end points of a line segment, at EQUIPR,

some extra equipotential

lines will be started.

by IZS, instead of by voltage,


The default

4.3

surface for the GENERAL

like an equipotential

and EQST

It is primarily

EXTRA
IZl

EQLN

If EQST is too small (steps too

CATHODE

warns that the starting


just

The maximum

over.

TO GENERAL

is generated

plots.

OF Z.
along which

The lines will be equally

spaced

so that their density will not mean field gradient.

value, IZ2 = -1, turns this device off.

PLOTTING

CONTROLS

SCALE

= YES

SCALE

= YES allows the axis routines to adjust both the X and Y scales to

take maximum

SCALE

advantage

of the size of the paper.

the axis to have the same scale factor


- actual proportions.
between trajectories
SX = XX

Using SCALE
in problems

SX = 22

YES=DIFFERENT

MAX.

X,Y SCALES

The default

in both directions,

value constrains

thus preserving

the

= YES allows the plots to show more detail


with low height/length
HORIZ.

51

PLOT

ratios.

LENGTH

SY=XX

SY=9

MAX

VERTICAL

The default values are SX=8.5,


control

the area for each picture.

adjusted

HEIGHT

SY=6 for the EGN87c


The dimensions

program.

SX and SY

are given in inches. SX can be

to suit the length of a given problem.

Plot data generated


a format
with

PLOT

very similar

CALCOMP

by the program
to that

plotters.

to generate the plots.

normally

A simple program
plots.

at Stanford

can be programmed

subroutines.

With

to the software

supplied

is printed

Other plotter

by making

in the program
software

to convert

such as that used

the appropriate

calls to the local

the changes that resulted in the above system, a programmer

installation

the electron

used as input

file (disk) in

A separate job, or second job step, can then be run

these data to make CALCOMP

at another

are stored on an external

does not need to search for plotting

trajectory

program.

Conversion

commands

to local software

within

is usually

quite

simplified.
For the PC program,
program.

a special set of plotting

If the C program

routines

is to be used on something

MAGNETIC

Magnetic

the

routine.

FIELDS

fields play a vital role in steering and focusing many kinds of elec-

tron beam devices. The capabilities


mentation

with

besides a PC, then an

Ascii file is generated which can be read by another plotting


4.4

is supplied

in the program

and limitations

of the magnetic

will be described in this section.

field imple-

The following

areas

- will be discussed.
(a) axial, (b) 1d ea 1 coils, (c) vector potential

1. Magnetic

Field Input;

2. Off-axis

field expansions

in Cylindrical

52

Coordinates.

data;

3. Magnetic
Magnetic

fields in Rectangular

Field Input

In the present
inputting

Coordinates.

implementation

magnetic

of the program,

there are five methods

field data:

1. By reading in the field on the axis using polynomial

expansion.

2. By reading the full array fields on the axis, presumably


another

computer

3. By reading
magnet

of

program.

in vector potential

design program

4. By specifying

as found by using

data from the output

such as TRIM

ideal coils (radius,

can be wires if in Rectangular

of a two-dimensional

or POISSON.

position

and strength).

coordinates,

The coils, which

are then used to find the array

of fields on the axis.


5. The coils, as noted above, can be used with
tines to calculate

fields that are valid anywhere,

at higher radius than, the coils. The elliptic


cylindrical

symmetry,

but this method

pressed axis, IAX, which is equivalent


Description

of Axial

Magnetic

The format

polynomial

method

was briefly

described

consist

of MAGSEG

22 with origin at 23 (three integers)


coefficients,

BZ, Bl,

elliptic

including

integrals

integral

rou-

very near to, or

can only be used in

has been used with a very large deto being in Rectangular

coordinates.

Field

The data cards for an axial magnetic


data.

built-in

field are put in before the boundary


in Section 3.2. The input
segments

of data including:

and an array BC consisting

B2,..., B6; for the expression;

53

data for the


Zl to

of the seven

B=BZ+B1xDZ+B2xDZ2+...+-B6xDZ6,
where DZ = Z - 23. For the sixth order expansion, the field must start six units
behind the cathode or starting
The NAMELIST

point, and go six units past ZLIM.

&INPUT1

includes the parameter

MAGSEG

mines how many segments are to be read, each with &INPUT2

which deter-

and &END

cards.

Each segment consists of the data for Zl, 22 and 23 followed by the array BC in
NAMELIST

format.

data is formatted.

The example of the problem input in Fig. 4 shows how this


Zl and 22 are the end points of a line segment on the axis,

where (Zl 5 22) in the range -6 5 Zl, 22 5 ZLIM

+ 6. It is necessary to permit

fields to be described beyond the ends of the problem


fields can be calculated
polynomial
the input

at the ends of the problem.

of, for example,

setting the remaining


In cylindrical
gular coordinates,

With

a straight

BZ, Bl,

line which does not go through

(0,O). As

etc., can be used as are necessary, simply

by

ones to zero.

coordinates,

the field must be in the axial direction.

the default direction

to the plane of the plot,

orthogonal

23 is the local origin for the

expansion in powers of DZ = Z - 23. Having a local origin simplifies

many of the coefficients

normal

in order that the off-axis

linear coordinate
the above format,

for the magnetic

i.e., in the PHI

field is in the direction

direction,

where PHI

to R and Z, or in the R (vertical)


data can be entered with

In rectan-

is the

direction.

any degree of polynomial

- up to 6. Caution is advised if the data handling is done in the following typical


style. The data may be divided into segments ranging from a point at a time
to the whole length of the problem.

Typically,

54

magnetic

measurements

of an

axially

symmetric

permanent

then be smoothed
coefficients

magnet

by a polynomial

least squares fitting-program

read into the program.

Alternatively,

the user as in the example problem,


linear dependence,

A separate provision
this array starts
= ZLIM

with

segmented into short lengths of quadratic

or

method

will usually give

The difficulties

arise when the

allows one to read in the BZA array directly.


BZA(l)

+ 6. The program

at Z = -6 and goes to BZA(ZLIM


switches

= -1, then a different

the array BZA().

If measured and/or

format

Either

the off-axis fields. These will be described below.

i.e., if MAGSEG

inherent

and the resulting


by

of the fields on the axis.

needs to calculate

The data can

a field may be designated

and read in to the program.

a good representation
program

will be taken on the axis.

risks in expanding
lends itself readily

+ 13) at Z

to this mode by having

MAGSEG

NAMELIST,

is called to read

plotted

&INPUTS,

data are used, note especially

such data for the off-axis


to computer

with up to 15 effective decimal digits.

Note that

calculated
With

field components.

output,

properly

an appropriate

the
This

edited,

computer

< 0,

and

model, for

example, for a set of solenoid coils, this is the most general accurate way to put
in fields.

See the book by Montgomery9

for a complete

treatment

of solenoid

design.
In many cases, a set of ideal point coils can be defined to generate the fields.
The data consists
position

of radius,

z-position

does not have to be within

and strength

the RLIM

by ZLIM

should not be. Unless it is planned to use the elliptic

of up to 101 coils.

area, and in fact, probably


integral

routines,

below, the off axis expansions break down if magnetic elements lie within
of the expansion.
starting

The

described
the area

The data for ideal coils are read in as part of the &INPUT5

conditions.

55

The starting
MAGNETIC
RMAG

conditions

FIELDS

= X.X

MAGORD

or -2,

R DIRECTION

to magnetic

1: READ

= RLIM/2

MAGORD

IF MAGORD=-1
THE

METHOD

RMAG

= 2,4

pertaining

IN AXIAL

OFF-AXIS

= 6

HIGHEST

FOR RECTANGULAR

AND

THE

fields are as follows:

OFF-AXIS

FIELD

IN &INPUT2

MAG

FIELD

LISTING

ORDER

FIELD

TERM

COORDINATES,
EXPANSION

BZA IS IN

IS A FUNCTION

OF R.
IF MAGORD<

-2 FOR RECTANGULAR

Z DIRECTION

AND

RMAG

THE

EXPANSION

is used only by an output

components

of the maximum

suit the problem.

that

prints

fields.

MAGORD

This printout

components

order term,

that

is a useful diagnostic
can result

to

is the expected
device

if the inputs

in powers of R, that

will

have

be used to

It is not related to the power of the polynomial

has one of the values, 2, 4 or 6.

by the quality

of the data, particularly

If MAGORD

input.
is higher

if data from magnetic

are used, then the off-axis fields may be just plain nonsense.

If MAGORD=-1
on the Z-axis,

off-axis

is the highest

off-axis

measurements

The default value is chosen

in one of the higher derivatives.

MAGORD

than warranted

OF R.

the axial and radial

For a pencil beam, a good value for RMAG

to check on unrealistic

Usually

routine

IS IN THE

radius of the beam, but it should be adjusted

average beam radius (in mesh units).

discontinuities

BZA

IS ALSO A FUNCTION

of the magnetic field at the radius RMAG.

to be typical

calculate

COORDINATES,

or -2,

(rectangular

coordinates

is taken to be in the R direction.

ers of R, are used to generate

the array BZA(),

Off axis expansions,

the off axis fields.

56

only),

This

in pow-

case is suitable

for

quadrupole

symmetry

If MAGORD<

-2,

in rectangular
the rectangular

coordinates
coordinate

as viewed end-on to the beam.


magnetic

field, on the axis, is in

the Z direction.

Another

way of defining the axial magnetic

ideal coils.

In rectangular

coordinates,

field, is to define a set of

the ideal coils are treated

NMAG

as straight

wires.
NMAG

= X

NMAG

= 0,101

NO. OF IDEAL

COILS.

NELL

= 1

NELL

= 0

=l

CR(I)

= X.X

CR(I)

= RLIM

RADIUS OF COI~MESH

FOR ELLIPTIC

CZ(1) = x.x

CZ(1) = 0.0

AXIAL

CM(I)

CM(I)

CURRENT

= X.X

ONLY

THE

NELL=0

RECT.

COORD.

= 0.0

CASE

CAN

BE USED

POSITION

FOR

INTEGRALS
UNITS)

OF COIL

IN AMPERE

TURNS

STRAIGHT

WIRES

When the ideal coils are used, the fields on the axis are calculated

IN

using the

equation

B(AXIS)

= 0.27rCM(I)

where I is coil number,


NMAG

array limit

- CZ(1)) + CR(I)2)3/2,

GAUSS

(4.1)

e.g., CZ(2) = 20.0 mesh units.

is the number of ideal circular

in planes perpendicular
but practical

CR(I)/((Z

to the axis. NMAG

field shapes can usually

loops, centered on the axis and lying


may have any positive

be represented

by only lo-20 coils.

is 101 coils. Each coil is described by three parameters:

57

integer value,
The

CR(I)

radius of coil (mesh units)

CZ(1)

axial position

CM(I)

ampere-turns

where I

1 to NMAG

The index is not related to the strength


of obtaining
Vaughn.lO
EGUN

CR and CM values that


At SLAC,

a favorite

to the strengths

to be within

need not be an integer.

of the coils.

Some methods

fit a desired field are discussed by


the output

from POISSON

is to fit the axial field found by POISSON,

All CR() values must be positive


is not restricted

will

way of putting

or the PIC code MASK

least squares routine,

or position

of coil

RLIM,

into
by a

of a set of coils.
(not zero, or a zero divide will occur);
but may have any any positive

value.

CR
It

The CR values should be larger than the beam radius to

avoid strong local non-uniformities.


CZ() values may be positive,
restricted

by ZLIM.

space RLIM
CM()

negative or zero, integer or decimal, and are not

The program

by ZLIM,

calculates

the field only within

but the coils may be inside or outside this space.

values are unrestricted.

All the coil data are entered in the &INPUT5


Off-Axis

NAMELIST

block.

Field Expansions

The input
to Z = ZLIM
With

the working

methods

described

above result in an array of fields from Z =

-6

+ 6. The array is for the axial field and is in double precision.

this number of significant

figures, it is possible to get meaningful

results for

finite differences up to the sixth difference, which is necessary for the sixth order
derivatives
.

used to find the off-axis

fields.

58

Each difference

requires

one larger

value of n in Z f

n, the range used to find the field at Z, at any radius.

The

range Z f

6 requires that the fields be specified beyond- the limits of the problem

from Z =

-6 to Z = ZLIM +6.

To sixth order, the field expansions

B, = B,(Z)

- d4B/dz4 . R2/16 + d6B/dz6.

- R2(d2B/dZ2

B, = -R(dB/dZ
By specifying
MAGORD

are;ll

- d3B/dZ3.

MAGORD

R4/576)/4

(4.2)

R2/8 + d5B/dz5 . R5/192)/2

P-3)

= 2 or MAGORD

= 4, the derivatives

are set to zero. This results in a less accurate expansion,

data are worthy

of the high order differences.

how smoothed,

are only worthy

if the original

If they are not, then the result of the

lower order expansion is apt to be far more acceptable.


no matter

higher than

Generally,

measured data,

of second order expansion.

Synthesized

data from an ideal curve, if there is only one segment, can generally be expanded
to fourth
that

order.

Ideal coil data can be expanded

it is virtually

measured

impossible

data or arbitrary

to be fit together,
The off-axis

without

to use the full sixth

polynomials,
running

Rectangular

Coordinate

In rectangular
paper.

especially

The central

Note, however,

order expansion

with

either

if more than one segment is

the risk of having a very unphysical

fields generated by poor models, or ones with

are apt to show very wild fluctuations


-

to sixth order.

with extremely

insufficient

result.

accuracy,

large peak values.

Expansions

coordinates,
plane, with

the usual expansion is normal to the plane of the


coordinate

59

PHI

= 0, can be thought

of as the

median plane of a magnet whose pole face is normal to the z-axis, i.e., dB/dR

0.
The off-median

plane expansion

is

BPHI = Bp~1(2)

- PHI

BZ = PHI.
The alternative

expansion

plane, at R = 0. The off-axis

dB/dZ

has the median


expansion

(4.4

* d2B/dZ2

(4.5)
plane lying

normal

to the R-Z

is then in the R direction.

The fields

on the axis can be can be either in the R or Z direction.


PHI

in this discussion

coordinate

are Y, X and Z, respectively,

(Note that R, Z and

in most usual rectangular

designations.)

The second order expansion has been adequate for the applications
been made.

One example

is the alpha magnet deflection

system used to bend

the low energy SLAC beam from the gun to the line of the accelerator.
choice of angle makes the vertical
the vertical

beam, in rectangular

in such runs by the features described for CARD


Elliptic

the optimum

coordinates

angle.

can be included

starting.

Integrals

For coil input,


printed.

for

entrance angles, using the

measured field profile of the magnet, were used to determine

A proper

focusing of the pole face edge compensate

phase space of the beam. Runs at different

Space charge of a cylindrical

that have

If NELL

a table of off-axis
= 1, the elliptic

fields with

integrals

60

elliptic

integral

calculations

are used for the ray tracing.

is

Oth-

erwise, with
integral

NELL=O,

the ray tracing

uses the off axis expansions.

fields are valid in all space so that certain

problems

way that cannot be solved by an off axis expansion.


defocused by being deliberately
device called a girotron.

steered outside of a solenoid,

more time to run the problem.

The time is proportional

if the number is small, as in a pair of Helmholtz


Inputting

Vector Potential

In &INPUTl,
next.

a beam being

as in the Russian

functions

take quit a lot

to the number of coils so

coils, the time is quite acceptable.

Data

the option INTPA

The condensed instructions

&INPUTA

can be solved this

For example,

The cost is that the elliptic

The elliptic

(TO INPUT

= .TRUE.,

calls for &INPUTA

to be called

are:

VECTOR

POTENTIAL

DATA)

RRO=X.X

RRO=O.O

POSITION

OF FIRST

zzo=x.x

zzo=o.o

RELATIVE

TO ORIGIN

DELR=X.X

DELR=l.O

INCREMENT

IN R(CM)

FROM

POISSON

DELZ=Z.Z

DELZ=l.O

INCREMENT

IN Z(CM)

FROM

POISSON

RLMAG=XX

RLMAG=30

NUMBER

OF ROWS

ZLMAG=XX

ZLMAG=200

NUMBER

OF COLUMNS

A()....VECTOR
UNITS

POTENTIAL

DATA

OF A() IN GAUSS-CM.

ARRAY

ELEMENT

OF GUN PROB.

OF A() DATA

OF A, EXCEPT

A() IS A LINEAR

OF A()

OF A() DATA
A*R AT R=O

ARRAY

WITH

-.
COLUMNS

RLMAG

Use of this option


as POISSON,

LONG.

MAX

requires the output

SIZE OF A() IS 8000.


from a magnet

which solves for the magnetic

may even be partially

saturated.

form of an array of the azimuthal

The output
component

61

field including

design program,

such

iron segments, which

of such programs

is usually

of the vector potential

A().

in the
This

array is currently

set to a maximum

of 8000 elements, but may be reduced to one

element to save space for users not interested


correspond

to points in a rectangular

the mesh used for the electrostatic


program
identify

and to reduce storage


a rectangular

trajectories
DELR

will

increments

DELZ.

The array elements

mesh which does not need to coincide with

problem.

To save running

requirements

time for the magnet

for the data,

it is preferable

The array starts

RLMAG
During

at RRO,

long, and contains


operation,

four points nearest the particle

ZZO, proceeds in steps of

ZLMAG

the program

columns

separated

START=GENERAL

to find the components

GENERAL

RC, = X.Xx

RC=O.O

zc = x.xx

ZC=2+CATHODEZ
FROM

CL=X.X

LOWER

THE

CL=RLIM

FIRST

BR and BZ.

CATHODE

END OF START

SURFACE

CATHODEZ

= Z-VALUE

BOUNDARY

MAXIMUM

DATA

LENGTH

CARD.

OF STARTING

DENS=lO.

EMISSION

BETA2=1.0

BETA2=0.0

IF > 0.0, USES LANGMUIR-BLODGETT

= X.X

USE RAD

RECTANGULAR
SURFAC=X
START

SURFAC=l

FOR WIRE

COORDINATES
STARTING

GENCARD
.

62

LIMIT

SURFACE.

DENS=X.X

RAD

by

finds the differences from the

GENERAL CATHODE AND GENCARD

4.5

to

area that is expected to include the space that the electron

require.

in columns

in this option.

RADIUS

A/CM2

IN

IF BETA2

> 0.0

SURFACE

ITERATION

GENERALWITHCARDSTART

START=GENCARD'

HAVEUPTOMAXRAYCARDSWHICHSPECIFY:
1. RAYNUMBER
2. INITIAL RADIUS R
3. INITIAL

AXIAL VALUE Z

4. DISTANCEFROMCATHODEDX,CATHODEMUSTBEPOT(l)
5. EFFECTIVESPACINGBETWEENRAYS,DR.
6. PARAMETER WHICH MODIFIES CHILD LANGMUIR;ALPHAZ
NORMAL DXIS 2.0 TO 3.0 MESH UNITS.
NORMALDRISl.OBUTMAYBEVARIEDALONGTHESURFACE.
NORMALALPH2

ISl.OFORAPLAINDIODE.

FORCYLINDRICAL

COORDINATES:

ALPHZ=(ALPHA*(RADIUS

OF CURVATURE)/(STARTINGSTEP))**~

FORRECTANGULARCOORDINATES:
ALPH~=(BETA**~)*(RADIUS

OF CURVATURE)/(STARTING

This section describes the use of the GENERAL


plies to anything
cathode.

In calculating
is that
- electric

starting

conditions

of space charge limited

of a spherical

option.
using Childs

emission.

Law, the basic assumption

Mathematically,

this means that the

field on the surface of the cathode is zero. Thus, in order to calculate

the emission current,


cathode.

cathode method which ap-

that cannot be described using the assumptions

It includes the GENCARD

STEP)

the calculation

must start

This leads to the use of Langmuir

63

some finite

distance from the

diodes, or pill boxes, which become

annular

in shape in cylindrical

coordinates.

The typical

thickness

is 2.0 to 3.0

mesh units.
The Child-Langmuir

equation

for emission in a plane diode is12

J = 2.335 x 10-6V3/2/s2,

amperes per unit area

The 3/2 power dependence of the thermionic


directly

to the concept

of perveance

(4.6)

emission current

density

here defined as the constant

leads

K in the ex-

pression

I = K x V312 x 1O-6

Since K depends only on geometric


characteristic

the implied

-.

box.

factor

of 10v6, i.e., microperveance

having units

per volt .3/2

The central problem


the starting

factors, the perveance becomes an identifying

of the device. Because of common usage, perveance for the program

is expressed with
microamperes

(4-V

for the GENERAL

surface and to calculate

The starting

surface is initiated

RC = 0 and ZC = 2.0 + CATHODEZ.

cathode starting

routine

is to define

the distance x for the thickness


at the point
The default

(RC,ZC)

with

default

point represents

the axis, 2 mesh units in front of the Z value of the first boundary

of the pill
values

a point on

point.

If the

cathode does not start on the axis, the correct value for RC must be defined.
the first boundary

point does not describe the beginning

correct value of ZC must be defined.

64

If

of the cathode, then the

The term

CATHODEZ

first boundary
the cathode
starting

point.

refers explicitly

It is frequently

be the first boundary

step (or diode thickness)

a different

convenient
point,

The starting
and following

to make the R = 0 intercept

surface is calculated

but there is no rule about this.

ST, used for spherical

by starting

3. The boundary

points

intercepted

surface, extended

line at (RC,ZC)

CL. (default;

by a line drawn

CL = RLIM)

at right

angles to the

to the left as viewed along the line starting

cease to be represented

by POT(l)

by POT(l).

or POT(5).

Emission

POT(3),

number will cause the line to stop, with the exception

usually

surface that confusion would result.

tion to use POT(4)

for the focus electrode to end the starting

Tests 1 and 2, above, are included

- parameters

the length

Equipotential

EQLN

will

Any
that

used for grids, will not stop the line because it may be so

close to the starting

a more tortuous

at

No emission will occur from

surfaces; hollow cathodes or shadow grids may use POT(5).

other potential

to determine

does not

of the problem.

occur from surfaces represented

follow

starting,

an equipotential

2. The line becomes longer than the parameter

POT(5)

The

only, until one of three things happens:

1. The line leaves the boundary

(RC,ZC),

of

starting.

it, in one direction

starting

of the

of 2.0 mesh units can also be adjusted by using

value of ZC. The parameter

apply to GENERAL

to the value Z + DELTAZ

of the starting

as safety
surface.

valves.

Thus the suggessurface.

Test 3 is intended

If the starting

surface has to

curve, due to holes, wires and corners, the equipotential

and EQST may be adjusted

as described

in in the section on

Lines.

,DENS limits

the current

density to a maximum

65

value controlled

by the user.

-.

It can be used to limit

the emission

as in temperature

limited

emission.

normal use is to avoid extreme values of current from local high-field


space charge depression becomes effective
temperature

limited

as described

in under Universal

BETA2

on subsequent

Note that

by using PERVO

and HOLD

p2 and re in the Langmuir

Blodgett13

Parameters.

theory of emission between coaxial cylinders.


equations

are included

The material

in the program

emission from an array of wires in rectangular


internally

once it has been activated

is covered in Ref. 12.

for the particular

coordinates.

by the user specifying

BETA2

uses the distance from the wire, the radius RAD

and the Langmuir

equations

the next by seeing POT(5)


course POT(l).

to calculate
that

currents

the starting

case of

is calculated

a value greater than

0.0. The program

wire can be used provided

points until

iterations.

emission can also be simulated

and RAD refer to the parameter

The Langmuir

The

in each ray.

of the wire,

More than one

surface can get from one wire to

surfaces between wires. The wires that emit are of

Th e current per mesh unit in length (in rectangular

coordinates)

is

1/e = 14.66 x 10-6V3/2/(r

where r is the starting

. /?)

The more usual configuration


coordinates

unit

(4.8)

radius in mesh units and

,02 = U(1 - 0.4U + 0.344U2),

cylin,drical

amperes/mesh

is treated

where

U = .h(r/RAD).

(4-g)

of emission from a flat or concave surface in


by the program

66

if BETA2

= 0.0.

Then the

program

treats the annular pill boxes formed by dividing

a number

of equal segments.

to be the largest number


starting

(5 MAXRAY)

of rays is calculated

that can be distributed

surface into

by the program
evenly along the

line, i.e., 1 or 2 per mesh unit, not 1.5!

The program
from which
current

The number

the starting

determines

the potential

the rays are to start

and calculates

using either the equation

ordinates,

or the equation

at the point

on the starting

the starting

for cylindrical

emission,

for emission from concentric

velocity

surface
and the

if in rectangular

spheres

co-

in cylindrical

coordinates:

I = 2.335 x 1O-6

p/2
p6p Amperes/radian

r+t2)

(4.10)

where

(+x2) =

(7

0.372

+ 0.7573 - ..y

(4.11)

and

Here x is the thickness

= .q(rc - Z)/b].

(4.12)

of the pill box, re is the radius

of the cathode

and 6p are the radius and thickness

of the annular

This equation

calculates

in a one radian segment of the annular ring.

The program

prints

conditions,

the current

this current

the current

is printed

gives a measure of current

density

ring on the starting

and p

in the table of initial

conditions.

divided

radius,

by the initial

to determine
67

uniformity

surface.

Under final

p. This column

of cathode

loading.

The cathode radius rc is estimated

for general cathodes by comparing

of the cathode to the length of the starting


cathode

does not have a constant

to the simple

1/x2 dependence

surface. This may be incorrect

radius of curvature
that

the length

the discrepancy

if the

but the result is so close


does not seem generally

significant.
For cases involving

cylindrical

coordinates,

for spherical and general cathodes,

the starting

step is much smaller than the radius of curvature.

to simplify

(4.1) by expanding

r,2(-a)2

Thus, it is possible

it to second order in (z/r,):

= s2(1 + 1.6x/r,

+ 2.06z2/r,2)

(4.13)

in which x has been redefined as positive for the usual case of a concave spherical
emitting

surface.

for the correction


program.

With this change, (4.5) and (4.9) are essentially


factor,

the term in parentheses in (4.12), called ALPH2

It is this term that is called for explicitly


SURFAC

= X

SURFAC

controls the number of program cycles for which the starting

is generated

= 1

Frequently,

STARTING

SURFACE

the most satisfactory

on the first cycle, without

the starting
- the current
the starting
it will drop.

point

of the electric

and the cathode

for that

ray.

CYCLES

looking

field.

the initial

As space charge depression

surface may, or may not change, although


In any case, it is well to limit

68

surface

The starting

points from which particles

The potential

determines

surface

starting

space charge depression.

surface, it should be recalled, is only a locus of starting


out in the direction

in the

in the input for GENCARD.

SURFAC

will be regenerated.

start

the same except

difference
particle

is included,
generally

the number

between

velocity

and

the shape of

the potential

of cycles, during

on

which

the surface is recomputed


SURFAC

controls

so that the final cycles converge to a stable solution.

the number

than one, it should generally


General Cathode

be 2 or 3 less than NS, the total number of cycles.

= GENERAL

option

table of the appropriate

MAXRAY,

etc. After

successful calculation

SURFACE:

LENGTH

will appear.

Next the headings for the initial


condition

If the starting

is selected,

constants:

STARTING

by the initial

it may often be more

Diagnostics

If the START
a special

of such cycles and, while

= X.X

the program

RC, ZC, CATHODE


of a starting

LENGTH,

ZETA=X.X

will be printed

followed

data.

surface fails by not being able to trace an equipotential

least two mesh units,

print

surface, the message

ENDS AT RHO=X.X,
conditions

will

or because it is asked for points

outside

for at

of the problem,

then the message:


GENERAL
-

CATHODE

STARTING

ENDS AT RHO=X.X,
is printed.

If SURFAC

then the program

SURFACE

FAILED:

LENGTH=X.X,

ZETA=X.X.
> 1 and this failure occurs on the second program

will cycle once more with a smaller perveance

and try again to fit the starting

surface.

but in either case the complete

potential

Otherwise,

the program

map will be printed

(currently

cycle,
80%)

will terminate,

to aid in diagnosis

of the difficulty.
GENCARD

is a starting

highly nonuniform

cathodes.

A specific example would be the sharp outer corner

of a right

emitting

from the end face.

cylinder

poorly by START

option

= GENERAL

introduced

to permit

response to

This corner is usually

because of implicit

69

better

assumptions

handled

that the radius

of curvature

of the surface is much greater than the starting

was specifically

intended

for use with

applies also to thermionic


GENCARD
philosophy
GENCARD,

field emission

GENCARD
devices, but

emitters.

combines

of CARDS

high current

step.

some of the functions

of GENERAL

with

in which the user specifies all the starting

the user specifies the initial

coordinates

the basic

conditions.

In

R,, 2,; the effective distance

to the cathode DX; the spacing between rays DR; and the fudge factor ALPH2.
Thus the user has defined all the parameters
limited

problem

except

initial

energy and direction.

the second part of SUBROUTINE


GENERAL.

needed to start

CHILDA

The first part of CHILDA

which

calculates

the space charge

These are calculated


is the subroutine

the starting

by

called by

surface, and is not

needed by GENCARD.
The parameter
rectangular

ALPH2

coordinates,

(STARTING

is the term in parentheses on the right side of (4.9). In

ALPH2

STEP/CYLINDRICAL

of this is to make the normal,


else is a perturbation

4.6
-.

to the BETA2 of the literature

RADIUS)

lstpower factored

i.e., plain diode, value of ALPH2

out.

SPHERICAL CATHODE
SPHERE

START

= SPHERE

= X.Xx

RAD

SPHERICAL
= 2ZLIM

CATHODE

SPHERICAL

RADIUS

CATHODE

RMAX

= X.Xx

RMAX

= RLIM

ORAD

= X.Xx

ORAD

= CATHODEZ

70

CENTER

with

The effect

= 1. Anything

at the users control.

START

RAD

corresponds

RADIUS
OF CATHODE

CATHODEZ

IS Z VALUE

ST = 2.0

ST = X.Xx

SPHERE

ALSO

CATHODE
IF START

STARTING
WORKS

CATHODE

CENTER,

determine

the essential geometry

Obviously

the default

for the thickness

etc.

is that current

RADIUS,

CATHODE

The first two values, RAD

and RMAX,

values, 2 x ZLIM

and RLIM

respectively,

and the same geometry

step ST, is the value used


= GENERAL

these pill boxes are annular rings and the current

after printing

is calculated

of Fig. 6. Figure 7 is the plotted

START
to calculate

output

the current
Again,

operates

with

of

the same

per mesh unit in the di-

as in START

= GENERAL

Ref. 8.
the headings the spherical

cathode routines

print

a message:
ITERATION

as

= SPHERE.

= SPHERE

to the plane of the paper.

Eqs. 4.7-4.8 are used according

have almost

point as defined

pill boxes. As in the START

of Fig. 3 using START


coordinates,

6.

The default value for

in a one radian segment of that ring. The current

In rectangular

Immediately

as shown in Fig.

the first boundary

in Section 4.5. The starting

coordinates

the sample problem

normal

cathode

so the user must specify them.

in Eqs. 4.9-4.11 using the geometry

rection

SPHERICAL

of the spherical

of the Langmuir

case, in cylindrical

input

COORDINATES

the cathode center, is at CATHODEZ,

for the general cathode

~~

is elected, the program will first print the special ta-

RADIUS,

ORAD,

POINT

FOR CYLINDRICAL

for the spherical cathode:

no chance of being correct,

BOUNDARY

STEP

IN RECTANGULAR

= SPHERE

ble of parameters

OF FIRST

NO. X, I = X.X MICROAMPS,

ERV.

71

PERVEANCE

= X.X MICROP-

The current and perveance printed


geometry

by the appropriate

are the unnormalized


the perveance
The initial

equations as indicated

values. After printing

according

currents

are those calculated

to the method

that are printed

averaging process. Between the initial


above is printed,
As in START
Fig. 6

except with

= GENERAL
Basic geometry
defining

according to the fields and

ab-ove. In other words, these

this message, the program

described under PERVO

out with

the initial

and final conditions,

the normalized
the currents

for spherical

in Section 4.1.

conditions

reflect

this

the same message as

values for current

printed

averages

and perveance.

with the final conditions

are

cathode configurations

the input parameters.

2309A2

72

c
I-J.

I-_
I

lI

F igure

, 50*

Plotted

output

of sample problem shown in F ig.

B(Z) GAUSS
,150
,100

,200
73

,250

,300

2.

,350

,400

450

divided

by the initial

sure of uniformity

radius (if in cylindrical

coordinates),

and thus give a mea-

of cathode loading.

The special case of magnetic fields reaching the cathode, i.e., immersed
is treated by both SPHERE
program

and GENERAL

must use magnetic

integrate

the azimuthal

starting

according to Buschs theorem.12 The

fields on the cathode and on the starting

motion

through

the gap between

surface. If there is any inconsistency

input

problem

of this sort becomes immediately

starting

conditions

4.7

and the careful


Fortunately,

obvious on examination

any

of either the

or the plots.

starting

START=CARDS
zo=x.xx
HAVE

bunching

CARD STARTING

The program

instructions

UP TO MAXRAY

TRANSVERSE
- FORMAT
CARDS

IS FREE

IN NEW

DATA

WITH

(EV),

POSITION

ANGLE

STARTING

FRAME
(1 INTEGER,

(RADIANS),

SEGMENT),

8 FLOAT

PT.)

CURRENT

TRANSVERSE

ANGLE,

(PHI).

FOR THE NEW C VERSION

STOP READING

IF RECTANGULAR

CARDS

IN ONE RADIAN

FIELD

CARD

OLD ORIGIN

R, z, ENERGY

(MICROAMPERES

are as follows:

START=GENERAL

zo=o.o

NO., MASS,
-.

were stressed in Section 4.4.

and the

fields within

area, then peculiar

That is why the proper use of MAGORD

of fields near the cathode

surface to

the cathode

in the off-axis magnetic

f6 mesh units of the entire range of the starting


of the rays will occur.

flow

WITH

RAY NO. GREATER

COORDINATES:
74

OF THE PROGRAM
THAN

MAXRAY

PHI IS TRANSVERSE
CURRENT
SPECIAL

POSITION

IS MICROAMPERES

TESTS

IN RATNST;

UNITS.

IN ONE MESH UNIT

CROSSING

IRAT=O

3-D SPACE

CHARGE

IRAT=

IRAT=O

CROSSING

DETECTION

MAKE

RAY NUMBERS

USE BEAM
CHARGE

PAIRS

ING

EDGE

CARDS

I AND

PART

IS TO

OF A CYLINDRICAL

EDGE

ATTRIBUTES:

END

OF PART

BER,

WHICH

BEGINS

IN OTHER
NOTE

THAT

* R) WHICH
WORDS,
THIS

BY NEXT
NEXT

MAKE

I(K)

REQUIRES

OF RAY

CHARGE

CARDS
SPREAD-

DIFFERENTIATED

ALPHA

OR RADIUS,

BY
CAN BE

OF RAYS IN EACH

RAY WITH

NEGATIVE

PART.

RAY NUM-

PART.
BEAM

PER MESH
WOULD

OF

SETS

PARTS,

ANY NUMBER

CYLINDRICAL

CURRENT

BEAM

3-D SPACE

SEVERAL

CARDS.

SPACE

PRECEDE

FOR WHICH

WITH

THE

EDGE

COORD.

E. G., ENERGY

IS DEFINED

TO SIMULATE

- = 2 * I/(PI

CARDS

OF BEAM

USED SIMULTANEOUSLY

ORD. MAKE

R IN RECT.

BE SIMULATED.

SELECTED

FOR BEAM

(I=O) TO SIMULATE

RADIUS

OF BEAM

DEFINING

CHARGE

CHARGE)

NEGATIVE

SPREADING

CURRENT

SEGMENT

RAY NUMBERS:
(3-D SPACE

IF IRAT=l

DEEP

OR 3-D SPACE

IRAT=l

USE OF NEGATIVE

-.

IN MESH

SPACE CHARGE

UNIT,

HAVE

THE

= I(K)/(2*
TWICE

75

I = I/(PI
SAME
R(K)

AS MANY

IN RECT.

* R) INSTEAD
CURRENT

COOF I

DENSITY.

INSTEAD

OF I(K)/R(K).

RAYS

AS FOR CYLIN-

DRICAL

BEAM

WITH

PLY TO

OFF-AXIS PENCIL

BEAM EDGE CARDS

SYMMETRY.
IN CYL.

COORD.

(RAY

< 0) AP-

~~.

START = CARDS mode uses data cards for the initial conditions rather

The

than computing
typical

the initial

applications

conditions

from a thermionic

model.

There are several

for this feature that will be described in some detail.

There

are:

1. The simplest case of user specified data.


2. Use of cards generated by a preceding

run to restart

in a new segment of

the same problem.


3. Study thermal
4. Rectangular

and other perturbing

coordinate

application

influences on a beam.
with a cylindrical

beam, including

cylin-

drical space charge and off axis bends.


User Specified Data
If START

= CARDS has been selected, the program will respond by printing

a table of appropriate
end of the
to

parameters:

STEP, NS, Z(O), SKAL,

NAMELIST input &END

MAXRAY

cards with

than MAXRAY
termination

the starting

will terminate

card, the program

card should be used anyway.

make MAXRAY
The computer

If MAXRAY

Following

the

will expect to read up

A card with

data.

this input.

UNIT.

ray number

greater

cards are present,

the

However, no effort should be made to

agree with the number of cards used, so long as it is big enough.


can, after all, count better than most humans.

Data to be entered on the ray cards consist of a ray number and the MASS,
followed by the initial
VERSE

ANGLE

values for R, Z, ENERGY,

and TRANSVERSE

POSITION.

76

ANGLE,

CURRENT,

The format

is 15,

TRANS-

F5,7F10.5.

1. Ray Number:

the ray number

for the termination


program,

purpose

sequentially

N for the mass/charge

is a new entry and although


program,

4. Z: the initial

axial position
Th e initial

It should be obvious,
nothing

whatever

in the fixed format

for

in mesh units.
kinetic

energy of the particle

but sometimes

requires stating,

to do with the potential

at which the ray tracing

are important,

not absolute potentials.

the initial

ratio for ions. Note that this

in mesh units.

the potential

6. ANGLE:

by the

in free field, the zeroes must be included.

radial position

(EV):

Rays are numbered

it can be safely omitted

3. R: the initial

5. ENERGY

above.

and

that will be described below.

0 for electrons,

the FORTRAN

described

for user convenience,

as the cards are read in. Negative ray numbers have

special implications
2. MASS,

is only included

in electron volts.

that

ENERGY

has

values on the boundaries,

starts.

For ray tracing,

or on

only fields

angle that the ray makes with respect to the z-axis, in

radians.
7. CURRENT:

the current

ray. In rectangular
8. TRANSVERSE

in microamperes

coordinates,

ANGLE:

for a one radian segment of that

it is for a one mesh unit deep segment.

the angle included

between the ray and the R-Z

plane.
9. PHI:

the initial

transverse

linear coordinate,
the azimuthal

position.

In rectangular

measured in mesh units.

position

in radians.
77

symmetry,

In cylindrical

symmetry,

PHI

is a

PHI is

Program

Generated

During
the initial

Cards

the last program

cycle, the program

and the final conditions

These cards may be punched,

generates two sets of cards with

of each ray according

or saved as a data set in card format

access device. For the C program,

these cards are included

listing from which they can be readily extracted


to use the cards in a subsequent
saved somehow.

to the above format.


on a direct

right in the output

by a text editor.

If it is planned

run, it is only necessary to be sure they are

In a pinch, the same data are printed

in the output

and can be

hand punched.
Typically,
problem.

these cards are intended

to be used in a subsequent

Thus the results of the sample problem,

in the complete

gun with

card starting

normal to expect that a different

just

Fig. 3, are intended to be used

past the grid.

zo = x.xx
SKAL

SKAL

OLD ORIGIN
= 1.0

In words, if the first problem


problem,

is plotted

by ZO mesh units in the new coordinate

- in which
a relatively

IN NEW

there is

ZO and SKAL

FRAME

many mesh units were used to calculate

example.
.
78

the second

will be found displaced left or right

system.

mesh than the follow

MESH

on the same graph with

as the ratio of sizes of mesh units

smaller

parameters

OLD MESH/NEW

then the origin of the first problem

is interpreted

runs, it is

the data, as read in on the cards, as follows:

zo = 0.0

= X.Xx

Between

scale and origin will be used, otherwise

not. much reason for the second run. The companion


are used to modify

segment of a

Usually

ZO is negative.

(in meters).
cathode

on problem

SKAL

Thus a problem

conditions

and SKAL

will have

< 1.0 in this

Thermal

Effects

SUBROUTINE

THERM

TC=XXXX.X

TC = 0

THREE

ARE INCLUDED

MODELS

IF THE

KELVIN

KRAY=l

TWO

KRAY=S

KRAY=l

THREE

THREE

KRAY=l
RAY

SPLIT

WITH

2 PARTS

EACH

IN RAYS WITH

PLANE,
FIVE

RAY SPLIT

WITH
AND

infinitely

PUTS

CURRENTS

IN 1-5-8-5-1 RATIO
FOR 1 PART

FOR 8-PART

CENTER

RAYS.

RAY.

FOR START=SPHERE,

FOR START=CARDS
with

Cylindrical

in rectangular

because the field does not fall off by l/R.

GENERAL,

WITH

CARDS

SAVE=2.

Beams

coordinates

in the directions

RAY.

RAYS

FOR 5 PART

is that the beam consists of a

in-and-out

charge forces on such a beam are much greater

reduced, the transverse

IN R-Z

TO UNDEFLECTED

Coordinates

sheet extending

1 PART

RELATIVE

NOT

The basic assumption

IN 1-2-1 RATIO,

V(PERP)=SQRT(2KT/M),

CAN BE CALLED

Rectangular

RANDOMIZED.

RAY AND

V(PERP)=2*SQRT(2KT/M)

OR GENCARD,

SPLIT,

DOWN

NO DEFLECTION
THERM

OF CATHODE

RAY SPLIT

CURRENTS

V(PERP)=l*SQRT(2KT/M)

TC > 0

RAY SPLIT

IN UNDEFLECTED

UP AND

TEMP.

PART

FIVE

PUTS

PARAMETER

IN THIS VERSION

KRAY=2

KRAY=5

-.

IS CALLED

than

However,

of the problem.

The space

in cylindrical

symmetry

if the current

is properly

space charge forces can be made the same as they would


79

be for a cylindrical
further

expansion

beam. Further

symmetry

in the current

can compensate

for

of the beam.

Consider first a uniform


R. The current

reductions

density

density cylindrical

is J = I/rR2.

beam of thickness

beam of total current

If one wished

2R at the same current

I and radius

to have a rectangular

density,

the total

current

per unit length would be

I = 2RJ = 21/7rR
To define the rays in rectangular
n and make n rays, suitably
to use starting

coordinates,

length I(K)/R(K).

one can divide I by some integer

spaced, each with

data from a previous

a current

If one wishes

U n 1ess the rectangular

beam has reflection

symmetry

per unit
on the

created as in cylindrical

to represent both halves of the beam.

Consider

now a particle

radius R and current

of charge e on the edge of a cylindrical

I. The radial space charge force on the particle

md2R/dt2
The force on a similar particle
coordinates

of F/n.

run, then each ray has a current

z-axis, there would have to be twice as many trajectories


symmetry

(4.14)

(equal densities)

= eI/(27rRic,).

next to an infinite

beam of
is

(4.15)
current sheet in rectangular

is

md2Y/dt2 = eI/(2ico).
To make d2R/dt2 = d2Y/dt2 we have only to require
80

(4.16)

I = I/rR

(4.17)

(equal forces) .-

This is just one half of the result for equal densities in (4.13). Thus, if the results
from the previous run were treated as described above, except divided
then the initial

by two,

space charge force on the rays would be the same as in cylindrical

coordinates.
A special feature allows the user to designate groups of rays, as few as one
per group, to be bounded by beam edge cards which
As the beam edge cards spread apart, the current
reduced proportionately.

designated

on all rays within

a group is

The groups may cross or overlap, but should not cross

their own beam edge rays. The initial


chosen so that

do not carry current.

conditions

of the beam edge rays can be

they do not cross the rays of the group.

by being inserted,

the members of their group.

with

Beam edge cards are

negative rays numbers,

in pairs just

before

Successive groups would thus be separated by the

pair of beam edge cards for the next group.


Beam edge cards may also be used in cylindrical

coordinates.

In this case,

the effect would be of an off-axis pencil beam, i.e., not an annular ring. Assuming
that the thickness of the pencil is small compared to the radial displacement,
same factor of one-half should be applied to the initial
for rectangular

currents

the

as was derived

coordinates.

IF IRAT=
1) R-Z: MAKE
FOR WHICH
INGS WILL

(R-Z AND
RAY

PHI CROSSOVERS)

NUMBERS

FINAL

NEGATIVE

CROSSOVER

BE LISTED

SHOULD

AND PLOTTED.
81

FOR

SEQUENTIAL

BE DETECTED.

NEGATIVE

RAYS
CROSS-

RAY NUMBERS

SHOULD

BE IN PAIRS.

A RAY WITH

TO FIND

R=O,ALPHA=O

CROSSOVERS

PRECEDING

WITH

Z AXIS,

RUN

THE RAY TO TEST

AXIS

CROSSING.
2) PHI:

LEAVE

RAY

TO DETECT

LAST

A special application
this application,
The program

NUMBERS
CROSSING

sequentially
direction)

instruction

comments

from the same point

detect crossovers.

in &INPUT5.

This feature

of the scintillator

is used to find

surface in image

Pairs of trajectories,

different

initial

conditions

WITH

END POINT
Laplaces

INPUT

equation

problems.

(energy and
The program

NO RAY TRACING
NUMBER

LAPRH=O

CARDS

started

EQUATION APPLICATIONS

NS = 7

LAPRH=l

For

a table of their coordinates.

= LAPLACE

NS = X

tential

with

RAYS

INTEGER.

are focused to a crossing, which must be located exactly.

START

-.

appear above.

No space charge is involved.

LAPLACES

DATA

TRANSVERSE

code is set to IRAT=

the position

finds such crossovers and prints

4-8

OF PHI=PI*

the beam edge control

tubes.

FOR

of beam edge cards is to specifically

the locus of foci to determine


intensifier

POSITIVE

OF LAPLACE

USE LAPRH=l

(R,Z SPACE

CHARGE)

CYCLES
TO START

READING

FOR NON-ZERO

POINTS.

BY R > RLIM.
has many applications

Some examples

besides solving

are temperature

distributions

electrostatic

po-

and magnetic

- fields.

As a reminder,

by Laplaces

equation

one usually

means V2r$ = 0, while

Poissons equation is V24 = p. The program always solves Poissons equation but
.

82

with p = 0 on the first iteration.

However, if one selects START

one can then add data cards with

the coordinates

space charge term for any non-zero point.

(RjA),

= LAPLACE,

and the right hand or

These data are appended after the end

of the starting

namelist

and are terminated

new parameter

LAPRH

signals the program

by R > RLIM.

In the C program,

to begin reading the data cards for

the right hand side.


The program
tracing.

will then cycle for NS cycles on just

It prints the potential

map, or POTLIST,

to show how things may be changing.

Following

a list of the fields, i.e., the derivatives


Fields at specified interior
go through
be fitted

such points.
according

Choose it carefully,

sary to set SAVE=1

4.9

by making

a dummy

boundaries,

boundary

= 2.0 and can


i.e., along mesh

to 100% of the field on the first boundary

point.

i.e., not where the field is near zero.

To do ray tracing

tions.

on all the boundaries.

points have DELTAZ

to the same rules as Neumann

lines. The fields are normalized

a second problem,

the last cycle, the program prints

of the potentials,

boundary

no ray

before and after the last cycle

points can be obtained


Dummy

these data, with

with the solution


in &INPUT5

without

found by LAPLACE,

of the first, LAPLACE,

boundary

problem

data, but with ray tracing

See the discussion under SAVE=1

DIELECTRIC

it is simply

neces-

followed

starting

by

instruc-

in Section 4.1.

BOUNDARIES

The input provision


be used for the particular

for special boundary


case of a dielectric

are only affected on the boundary


this feature is to specify dummy

points, described in Section 3.2 can


boundary.

of the dielectric.
boundary

83

points,

The difference equations

The normal method


i.e., points with

of using

DELTAR

DELTAZ
point)

= 2.0, which can be put in point-by-point

method

sufficient

equations

and vertical

were derived

dielectric

for most applications

curved dieletric

the fitting

(three-

as lines.

The difference
horizontal

or with

are relatively

by Seeger13 for the special cases of

boundaries.

These relatively

because the actual position


less important

simple cases are

and angle of even a

to the fields in the vicinity

fact that the boundary

is located nearby. Thus a good approximation

a stepwise simulation

of the dielectric

mesh point does very little


The coefficients

and a small displacement

than the

results from
to the nearest

to the fields a few mesh units away.

of the difference equation

are given by Eq. (3.3) and can be

expressed as:

LEFT

= RIGHT

= R

(Vacuum)

(4.18)

UP = R + l/2
DOWN
For a horizontal

dieletric,

and 6%is the constant

LEFT

= RIGHT

= R - l/2

where ~1 is the dielectric

constant

for the upper region, the coefficients

= [E~(R - l/2) + E~(R + l/2)1/2

(4.19)

= q(R - l/2)

For a vertical

dielectric

become:

(Horizontal)

UP = e2(R + l/2)
DOWN

for the lower region

boundary,

the coefficients
84

become

-.

LEFT

= qR

UP = (~1 +
DOWN

RIGHT
EZ)(R

= ERR (Vertical)

+ l/2)/2

(4.20)

= (cl + e2)(R - l/2)/2

where ~1 is the dielectric

constant

for the left side region and ~2 is the constant

for the right side region.

For rectangular

coordinates,

set all the Rs and (R f

1/2)s to unity.
The term

LEFT, RIGHT, UP and DOWN refer to the points, 1, 2, 3 and 5

respectively

in Fig. 2. The notes summarizing

instructions

are reprinted

(4.18) and

(4.19) in the program

below:

SPECIAL BOUNDARY POINTS, USE 999 IN COLUMNS 3-5 TO END


BOUNDARY INPUT.
BOUNDARY MUST INCLUDE ALL POINTS

TO

BE USED AND ALL

POT NUMBERS.
THEN INCLUDE ANY NUMBER OF CARDS

WITH

R, Z AND FOUR

DIFFERENCE NUMBERS FOR LEFT, RIGHT, UP AND DOWN, SEQUENTIALLY.

END WITH R>RLIM


FOR GENERAL NEUMANN, NUMBERS SHOULD ADD TO 4 * R OR 4
-.

IF RECTANGULAR

COORDINATES.

TERMS ARE 4 * TAN@/l+TAN@


HORIZONTAL

DIELECTRIC

AND

4/TAN@, WHERE TAN@ < 1.

BOUNDARY:

LEFT = RIGHT = (El * (R - 0.5) + E2 * (R+0.5))/2


UP = E2 * (R + 0.5)
.

85

DOWN = El * (R - 0.5)
WHERE El OR E2 = 1.0 FOR VACUUM AND E2 IS UPPER MATERIAL.
VERTICAL DIELECTRIC BOUNDARY:
LEFT = El * R

RIGHT = E2 * R

UP = (El + E2) * (R + 0.5)/2


DOWN = (El + E2) * (R - 0.5)/2
WHERE E2 IS RIGHT HAND MATERIAL

86

5. TRAJECTORY

CALCULATIONS

The program uses a four step Runge-Kutta

- -

method of solving the relativistic

differential equations given below. Suitable substitutions

are used to reduce the

three second-order equations to six first-order differential equations.


The independent variable is time but the time interval is calculated from the
allowed iteration step and the velocity.

It is necessary to use fairly short steps

because of the auxiliary calculations that must be made at each mesh unit. Thus
it is generally not helpful to use any self-checking corrector solving routine.
If some unusual application requires shorter iteration steps, the results usually
show this by their internal inconsistency.
The relativisitic

differential equations are derived in Appendix I and are

2 = a(1 - ,@)li2 [-E,(l

ii = a(1 - p2)li2

[-&(1

- i)

+ i&r

- h2) + ii&

+ i@,

+ hi&

A = d1 - P2)12[-E#(l - A) + i&,

- cliB# + CAB,]

+ c,kB4 - ciB,]

+ &&, - &B, _ &$]

where
87

(54

A2
+ R
(5.2)

-g

(5.3)

p2 = i2 + h2 -I- A2

and

p = v/c

(5.4

The constant a! = eX/m,c2 where e is the magnitude of the electron charge (the
- sign is in the equation), moc2 is the rest energy of the particle and X is the
constant of proportionality
coordinates.

Thus

2 = AZ,

By an arbitrary
volt.

between the real coordinates and the dimensionless

?-=A&

a=

XA

and

et = XT

P-5)

choice, X = 5.11 x lo5 mesh units so that cx = 1.0 mesh unit per

Inspection of the differential

equations shows that they are dimensionally

correct if the electric fields are specified in volts per mesh unit.
Dimensionally

E = vB, so that in mksa units E is in volts per meter, v is in

meters per second and B is in webers per meter2. Then cB has units of volts per
meter. To convert to program fields of volts per mesh unit, fields are multiplied
by the value UNIT in meters per mesh unit. Magnetic field input to the program
is in gauss, which is the common engineering unit, and is internally

converted to

webers/meter2.
The azimuthal magnetic field B4 comes from the current in the electron beam
and is called the self-magnetic field of the beam. The magnetic field created by
an axial current is

PO I webers/meter2.

B$ = Gr

(5.6)

The field is assumed to be due to an infinite conductor which is a pretty good


88

approximation

in the area in which the field is significant.

After multiplying

by the scale factor and expressing r in meters which requires multiplying


the scale factor also, the scale factor cancels as might be expected.

B+

r by

Thus the

scale factor only enters for external magnetic fields. The current I in (4.19) is the
summation

of the current in the trajectories at lower radii than the trajectory

being calculated, but including the one being calculated.


Two field components are neglected. The azimuthal electric field is neglected
because of the axial symmetry
contribution

assumed. The axial magnetic field can have a

from the beam due to azimuthal velocity of the beam. The magni-

tude has been shown to be less than one gauss in most practical cases and so is
neglected.
The space charge is calculated to supply the right side of Poissons equation
which is

vq7

= E = .L
60

The element of area for J is r


radius.

veo

(5.7)

1.0 square mesh units where r is the particle

The velocity is only the Z-component since the space charge is being

spread between adjacent points on the same column. The one mesh unit space
between adjacent points accounts for the 1.0 in the area expression above.
In the finite difference form, (3.3) replaces (5.7), and the right hand side
becomes

RO =

36~ x lOgI
ABS(ZDOT)

(3.77 x 10-4)1(K)
x 1O-6
ABS(ZDOT)
x 3 x 10s =
89

(5.8)

--

where RO is to be spread between two points in inverse ratio to the distance


the ray is between them, I(K) is the current in the one radian segment of the
ray (in microamperes)

and ZDOT is the velocity in units of c. If the angle of

inclination, dR/dZ, exceeds 45, the calculation is made for RDOT. The absolute
value of ZDOT is used to allow a negative ZDOT. The explicit value of R in (3.3)
is canceled by the R which would convert the current to current density, thus
avoided special problems as R + 0.
In practice, however, there are still some space charge problems near the
axis. In rectangular coordinates, if the axis is a plane of symmetry,

then any

trajectory between R = 0 and R = 1 has a mirror image between R=O and R=-1.
(A reminder again...when in rectangular coordinates, the axis still retain their
cylindrical labels.) To account for all the space charge on the axis, the calculated
charge is doubled. In cylindrical
space-charge proportionately
a very accurate solution.

coordinates, the algorithm for distributing

the

to the distance between the adjacent points is not


Good smooth laminar flow near the axis results by

simply making the space charge on the axis equal to that found for the first row.

90

~I_

~.

6 . T R A J E C T O R YA N A L Y S IS ._

- -

E G U N d o e ss o m ea n a l y s iosf th e q u a l i tyo f th e b e a mto fi n d th e e m i tta n c eo f


th e e n s e m b ol ef p a rti c l e s F. o r th o s en o t fa m i l i a rw i th th e c o n c e pot f e m i tta n c e ,
d i s c u s s i ocnas n b e fo u n d i n a n y b o o k a b o u ta c c e l e ra tod re s i g ns ,u c ha s th a t b y
S te ffa n . R e c e n vt e rs i o n os f th e p ro g ra m i, n c l u d i n Eg G N 8 7 c ,u s e th e c o m m o n
d e fi n i ti o no f e m i tta n c e ;1 8

E = 4 x [ < x 2 > < x l 2 > - < x x x > 2 ]1 /2

w h e reth e < > re p re s e na tv e ra g ea sn dth e X a n dX te rm s a re th e w e i g h te sd u m s ,


a n d s u m so f s q u a re so ,f th e o rth o g o n aql u a n ti ti e xs o r y . B e c a u s th
e e p ro g ra m
i s u s i n gp a n d p , i n c y l i n d ri c ac lo o rd i n a te th
s ,e x a n d y te rm s a re fo u n d fro m
x = p c o s4 , a n d s i m i l a er x p re s s i o nwsh, e re4 i s th e n e t a z i m u th aal n g l e In. s te a d
o f s ta rti n g m a n y p a rti c l e sa t ra n d o mi n i ti a lv a l u e so f 4 , i t i s s u ffi c i e ntot n o te
th a t e a c hb ra c k e at b o v ec o n ta i n as c o s 24 , w h i c ha v e ra g etos 0 .5 . T h e s eh a l v e as re
fa c to re do u t o f th e s q u a rero o t a n d c h a n g the e c o e ffi c i e nfot u r to a tw o . T h e fo u r
i s th e re to s i m u l a tea s q u a re d i s tri b u ti o na, s i n a u n i fo rm b e a m ,a s c o m p a re d
to a n rm s d i s tri b u ti o n T. h e u n i ts o f e m i tta n c ea re m i l l i m e te r-m i l l i ra d i awnhsi ,c h
u s e sth e s c a l efa c to r th a t i s d e fi n e fo
d r th e p ro b l e m E. m i tta n c ec a l c u l a ti o na sre
d e fi n e ad s th e a re ao f a n e l l i p s ew ,h i c hi n v o l v easfa c to r o f 7 ~w h i c h b, y c o n v e n ti o n
a n d to a v o i dc o n fu s i o ni s, s ta te d e x p l i c i tl yi n th e o u tp u tu n i ts ,a n d i s th e re fo re
o m i tte d fro m th e a b o v e x p re s s i o n .
E x p e ri e n chea ss h o w nth a t th e e m i tta n c ev a l u e cs a l c u l a tei dn th i s w a y a re i n
re a s o n a b al eg re e m e w
n ti th w h a t s h o u l db e e x p e c te fro
d m w e l l d e s i g n ee dl e c tro n
g u n s T. h e re s u l tsa l s oa g re ere a s o n a b wl yi th p ro g ra m th
s a t a re m o res ta ti s ti c a il n
91

concept. If it is planned to compare emittance numbers, the user should endeavor


to have a reasonably large number of trajectories, that is, perhaps at least thirty,
so as to have some statistical

validity.

The emittance calculation also gives a value for the invariant or normalized emittance which is given by;

where p = V/C and 7 = (1 -

p2)-li2.

Th1s q uantity has the property that it is

invariant to further acceleration. That is, of course, provided the acceleration and
transport

of the beam are not accompanied by aberrations that further degrade

the quality of the beam. The momentum used to find the product ,87 is that of
the first trajectory.
At the end of each run, after the last set of trajectory

plots have been gener-

ated, two extra plots are created;


1. One is of the final current density as a function of final beam radius. This is
a rather crude profile of a histogram of currents found in ten bins between
p = 0 and the largest value of p.
intensity.

It is normalized to 1.0 at the peak

The result is frequently a sort of Rocky Mountain

still resembles the actual current distribution

profile which

to some degree.

2. The second plot is of final p = dp/dz us. p. This is essentially a plot of


phase space from which the emittance, as discussed above, can be understood. A very good beam, with low emittance and no aberrations, would
have all the points plotted in this way, lie in a straight line. Most electron
guns, particularly

if there is significant area convergence between the area


92

of the cathode and that of the beam, will exhibit some spherical aberration, in which the rays from the outer part of the beam cross over the inner
ones. The EGUN program invariably shows at least some such aberration
at the outer edge of any gun. This may be due to the way space charge is
allocated near the edge, or it may be real, or some of both.
There is one more plot available, for azimuthal

motion.

If the parameter

IPHI has been set to one of the ray numbers, a single curve will be plotted of the
azimuthal position us. Z. This is either the angle PHI, or the position PHI if in
rectangular coordinates. The plot is made for the ray designated by IPHI.
The current density profile, which was described above, should not be confused with the emission current density which can be found by examining the
values for I(K)/R

that are printed with the final conditions of each cycle. The

initial set of currents are the I(K) va 1ues that are actually used by the program,
and are the currents (microamperes) in a one radian segment of the ring of charge.
Since current does not change during transport, the final data would be the same
as the initial current, thus wasting space in the output.
bers are the initial currents divided by the initial
proportional

Instead, the final num-

radius, to give values that are

to initial current density, for example at a cathode, and can be used

to diagnose cathode emission uniformity.


To emphasize the importance of uniform emission density, and also to close
this section, it is appropriate

to pass on one piece of wisdom gained from

simulating many electron guns. That is, to make a good electron gun, meaning
one with good beam quality, strive to get the space charge limited emission as
uniform as possible. The best guns are usually uniform to within 10% across the
face of the cathode.
93

REFERENCES
1. W. B. Herrmannsfeldt,

_ -

Electron Trajectory Program, SLAC 226, Stanford

Linear Accelerator Center, Stanford, CA 94305, November 1979.


2. B. W. Kernighan and D. W. Ritchie, The C Programming

Language, Pren-

tice Hall.
3. Metawindow

is a registered trademark of the Metagraphics

Software Cor-

poration, PO Box 66779, Scotts Valley, CA 95066.


4. Judith Colman, The Use of the IBM-PC

Computer in Accelerator Design

Calculations, Proceedings of the 1986 Linear Accelerator Conference, Stanford Linear Accelerator Center, Stanford, CA 94305, June 1986. Ms. Colmans address is Neutral Beam Division, Brookhaven National Laboratory,
Upton, NY 11973.
5. Forsythe and Wasow, Finite Difference Methods for Partial Differential
Equations, Wiley and Sons.
6. Vladimir

Hamza, NASA TN D-1323, TN D-1665, TN D-1711, Lewis Re-

search Center, Cleveland, Ohio, (1963).


7. C. Weber,

Numerical Solution of Laplaces and Poissons Equations and

the Calculation

of Electron Trajectories and Electron Beams, Volume I,

Focusing of Charged Particles, A. Septier, Ed., Academic Press (1967).


8. Richard S. Varga, Matrix

Iterative Analysis, Prentice Hall.

9. D. Bruce Montgomery,Solenoid

Magnet Design, Wiley-Interscience,

John

Wiley and Sons, New York (1969).


10. J. R. M. Vaughn,
Computer

Representation

Programs,n IEEE Trans.


94

of Axisymmetric

Magnetic

Fields in

on Electron Devices, ED-19,No.

2,

--

_ -

..

Feb. 1972, pp. 144-152.


11. K. R. Spangenburg,Vacuum Tubes,McGraw

Hill, New York (1948).

12. K. R. Spangenburg,FundamentalsMElectronDevices,McGraw

Hill, New

York (1957).
13. I. Langmuir and K. B. Blodgett, Phys. Rev. 22, 347 (1923).
14. G. R. Brewer, High Intesity Electron Guns, Focusing of Charged Particles,
Volume II, A. Septier, Ed., Academic Press (1967).
15. H. Busch, Ann. Physik 4,8& 974 (1926). See the above reference by Brewer
for a treatment of this subject.
16. J. A. Seeger, Proc. of IEEE, 56, 1393, (1968).
17. K. G. Steffen, High Energy Beam Optics,Interscience
Wiley and Sons, New York (1965).
18. P. M. Lapostolle, IEEE Trans l8, 1101, (1971).

95

Monographs,

John

APPENDIX
DERIVATION

OF EQUATIONS

._

- -

OF MOTION

The equations of motion are derived from the relativistic

Lorentz force equa-

tion
d(mv3=

dt
where e is the magnitude

-e(Jl?+vxd),

(1)

of the charge of an electron.

vector V, expressed in cylindrical

coordinates

The electron velocity

is

v= u,i + u,+ + u&.

(2)

Here uZ, ur and u4 are unit vectors and 2G= r$ is the azimuthal
velocity.

or peripheral

The left side of Eq. (1) can be found from

(3)
where me is the electron rest mass. Differentiating

Eq. (3) yields

where

!LL= uz2 + ur(r- nj2) +


which becomes
96

u&+6

+ 4)

..
$; = u,; + ur(Y- b2/r) + u&i/r

_ -

+ ii).

(6)

From
2) = (i2 + f2 + iL2p2

where v is the scalar velocity,

we have

dv
dt

Substituting

(7)

= +ii

@I

+ ii: + q.

Eqs. (6), (7) and (8) in Eq. (4) yields

!.k.$=m,(l-~)~32[1

-p

+ ir+ q (z&i + u,i + u&L)


(9)

+{1-~}{u,i+..(i-ir2/r)+u~(i++a)}].

Equation

(9) can be expanded and grouped by vector components

C@$=m0(1-$)-32[uz{

+ 214 $i(Z
1

&+ci)+i(l-g+;)}
- -T

+ ur { $i(BI+&)

( l-

2)

+ ir) + y-* (1-g)

A similar vector component

yielding

+r -(l-g+!T)}

(10)

+z(1-$+$)}I.

expansion can be made for the right side of Eq. (1)

yielding
97

-db-4

dt

= -e

Equating

uz(Ez + iB# - id,)

vector components

+ u,(E,

+ id,

- 234) + u#(Ed + iB, - iB,)

1
(11)
.

we have finally

} =-e(Ez++Bd-&B,),
mO
(l- $)m3
{(l--p+cz
2v2i2)z++~+giii

(14

mo(1-!!!)m32{$+~~+
( l-s+2v2 ia)r++y

iL2( 1 -

V2
c2 >,

(13)

2
- C2 )I

(14

= - e(E, - 334 + id?,),

and

= - e(E4 + 23, - iB,).

For computer
normalized

form.

programming
Accordingly,

2 = AZ,

We differentiate

it is convenient

to express the variables

in a

we let

r = XR,

a=

XA and ct = XT.

with respect to 2 = et/X to get


98

(15)

. -

..
z= -c2z
A

i=&,

c2ii
1:= cl& r=x

(16)

and

From the definitions

in Eqs. (16) it follows that

212
pLCZ=i2+@ffp.

Note that the time derivatives


with

respect to T=ct/X.

(lg),

and (17) yields

of the normalized

Making

mOc2

displacements,

the normalizing

[(l - p2 + i2)Z

X(1 - /32)3/2

(17)
Z, R and A, are

substitutions

+ iitli2

+ iAA]

p2 + Itt2)ii + M;I

k2
- &l

in Eqs.

(18)

=-- E,+ckB,p-CAB, 1,
m0c2
X(1 - p2)W
=-

e E,C

ILki

+ (1-

[
ciB++ckB,

(12),

- pz)

1,

1 (19)

and

m0c2
X(1 - /32)3/2
=-

. . ..

AZZ+AI#+(1-/?2+A2);i+

e Eg+ciB,-c$!B,
[

1.

(20)

Our goal is to get separated equations solved for the second order derivative
99

of each of the orthogonal

variables.

To solve the eqtiations,.we

arrange them in

the form

A$+

B#

+ Cl;i = D1

A2.2 + Baii + C,A: = D2

(21)

A32 + B35 + C3k: = D3


and apply the standard
Arranging

determinant

method of solving simultaneous

equations.

Eqs. (US), (19) and (20) in the form of Eq. (21) yields

(I- p2+ i2)i + ihii + i/iii = -eX(l


- p2)3/2(&+ &B4 - &jr),
m0c2
Iii2

+ (1 - p2 + IP)ii

A2
= (1 - p2)F
- -f&(1

+ hii

(22)

- py
(23)

x (E, - ciBd + CAB,),


and
. . ..

AZ2

. .

+ /i&ii

+ (1 - p2 + i2)i

= -(l

- p2)y

- --$(l

- p2)32
(24)

x (E+ + ciB, - cIiB,).


The determinant
A =(I

=(l

of the coefficients
- p2 + i2)

-p2

+ $)(I

-p2

+ ili

piA2

- ik(l

- p2 + )I

+ ik

[i&i

- Ai(1

- p2 + ,I

- p2 + i2)(1
- .&-?(l

=(l

[(I

is

- py(l-

- P2)(1-

- p2) - &$(l
p2 + 22 + $
100

+ ~2) -/$d2]

p2 + fp + $)
- py
+ AZ)

_ -

which is simply
A = (1 - /?2)2.
to let cx = eA/moc 2. The axial acceleration

It is convenient

Ag

(25)

= D1(B2C3

- C2B3)

2, is given by

D2(C1B3 - B1C3) + D3(B1C2 - C1B2)

which becomes
(1 - p)2

=[-a(1

- /32)3/2(Ez + ckB4

x [(l - p2 + 2)(1

- CAB,)]

- p2 + 2)

- Iw]

A2
+ [(l - pa)% - a(1 - /?2)3/2(Er - ciB4
x [hiA
+ [-(1

- iiql
- p2 + AZ)]
. .
- p2,y

x [ili2A
Simplified,

- a(1 - /32)3/2(E4 + ciB,

- (1 - p2 + S)iA]

the above equation


.f =a(1

- ,O)/[-(Ez

that

+ cliB#

- eiB,)(l

- p2 + Ii2 + /i2)

+ (IQ, + ciB, - diB,)ii].

(1 - p2 + k2 + A2) = 1 - i2, we have finally

.if = a(1 - p2)1/2[-&(1

The radial acceleration

Ai

- &B,)]

yields

+ (E, - ciB$ + ciB,)iIi


Noting

+ CAB,)]

= D&W2

- i2) + iEiE,

+ iiE,

- c&B4 + CAB,]

k, is given by

- A2C3)

+ Dz(A&3 - A3C1) + D3(A2C1 - A1C2)


101

(26)

which becomes

(1 - p2)2iz =[-a(1

- p2)3/2(Ez

x [Ii&i2

+ clfLBO - CAB,)]

-lii(l-p2+A2)]
k2

+ [(I - P2)x - ~(1 - p2)3/2(Er x [(l - p2 +9)(1-p


. .
+[-(l-&y

+ CAB,)]
(27)

a(1 - p2)32(E4 + ciB, -

cliB,)]

-kA(1-p2+i2)].

the above equation

yields

ii = a(1 - /3')'/'[

ciB4

+ A") - 921
-

x [i21Li

Simplified,

_ -

..

(E, + ciB#

E, - ciB+ +

- CAB,)

ii

CAB, )(l-P2+ia+2)

+ (E4 + ciB, - &B,)

&A]

A2
+R(1-p2+i2+A2)+~.
Noting

that

(1 - p2 + .k2 + A) = (1 - k2), we have finally

ii = a(1 - P2)1/2[-Er(l - li2) + iIiE,

The azimuthal

acceleration

lbiE$

+ ciB#

A2
- CAB,] + --.

2, is given by

A;l. = Dl(AzB3 - AsB2) + D2(A&


102

- AIBB) + D3(A1B2 -

A2Bl)

(28)

which becomes

..

_ -

p2)3/2(Ez+ chBg - c/iB,)][hi2i - ii(lA2


+ Kl - P2)jj- - cr(l- /32)3/2(Er- ciBd + CAB,)]

(l-

p2)2;1 =[-cx(l-

p2 + h2)]

x [ki2d-A~(l-p2+i2)]
. .
+ [(l - pz)Jg
x [(lSimplified,

p2 + 9)(1-

p2)"/"(E4 + ciB, - &B,)]

p2 + I?)

- i2Ei2].

the above equation yields

A=a(l-p)

2 1'2[( E,+chB4-ciB,)ii+(E,-eiBm+
E4+ciB,-eliB,

- !g (I_
Noting

- a(1 -

that

p2

) (l-82

+ i2 + fi2)

+i2

ciB,)&

+I?)]

A,.

(1 - p2 + ,k2 + k2) = (1 - A2) we have finally

2=a(l-~2)1'2[-E&-i2)+~AE,+~~E,-c~B,+cBB,]

103

-g.

(29)

APPENDIX
GENERAL

We will first illustrate

NEUMANN

the derivation

II

boundary

of the difference equations and then give the

is drawn as shown by the dashed line. A point at a is chosen to lie on the

Since point

through

the point

4 at the intersection

a lies on the normal to the boundary,

Define tan CI!as the slope of the boundary

Starting

If a boundary with normal deriva-

array equal to zero is desired along a line as shown, then a problem

normal to the boundary


and 2.

- -

BOUNDARIES

rules for defining the difference equation coefficients.


tive of the potential

._

near point

between points

it follows that V, = Vi.

4.

from

v, =

(30)

v5

we have

va- v5 = v2 - va
a2
a5
-.

where, for example, a5 is the distance from point


104

a to point

(31)
5.

The mesh interval

is taken to be unity.

Cross-multiplying,

we have

~~_

a2V, - a2V5 = a5V2 - XV,


or
(ia+iiqV,
--

But, a2 + a5 = fi

=z&

(32)

+a2V5.

and V, = Vi, hence


l/s4

(33)

= a5V2 + a2V5.

From the law of sines,

a2

=
sin(7r:
sin (Y

1
- CX)

1
1
=
cos%cosa!+sin~sina
cos 2 - a

which becomes

a2 =

6 2sina

fit ana!
= l+tancr

(34

fi
=
ltana
l+tancr
l+tana!
1
(

(35)

sina+coscr!

Then the other segment is

a2454545

The complete

difference equation
&v4

which in the notation


0.v1+4-

The factors
to four,

from Eq. (4) is


=

JZtanav2+

l+tancr

l+tan

v5,

used in the main text is


tan LY:
v2+ov3+4*
l+tana!

of 4 are inserted

1
l+tana!

to make the sum of the difference

as is needed in rectangular

coordinates.
105

(36)

v5 =4-F/4.

In cylindrical

coefficients

coordinates,

equal

this sum

should be 4 - R. Note that the derivation


For a negative
slope.

That

slope, the similar

presented-above

derivation

is, use only positive

uses Vi

are interchanged,

tan CY), goes with the point nearest to the normal


the difference

generated

if both DELTAR

Neumann

boundary

applications

and Vs, with

the same values of

values of tan Q that are less than 1.0. If the slope is

greater than 1.0, the two coefficients

For CY = 45,

was for the slope, tan Q <l.

terms

and DELTAZ

both

so that the larger term,

are exactly

are 0.0, that is, the conditions

it is possible to use a 45 Neumann

to the boundary.

equal 2.0, which

are in fact the conditions

l/(1

for a 45 Neumann
boundary

the terms
for a double

boundary.

In many

and avoid the complications

of this section.
Note that in application,
defined as Neumann
generated

boundary

difference coefficients

special boundary
with

the points used for general Neumann

coefficients

points during the boundary


are then over written

card.

106

input process. The internally

by the method

at the end of the regular

a 999 entry on the last input

points must have been

boundary

supplied

input,

to input

by signalling

/**************************

EGNDOC***********************

EGN ELECTRONOPTICSPROGRAM:
EGN87Cl: C LANGUAGE,VERSIONI, I JUNE 1987
DESIGNEDFOR USE ON PC'S OR ANY SYSTEMSUPPORTING
C
EGUN: FORTRANVERSIONCOVERED
BY THIS MANUALALSO.
_ ..
W. B. HERRMANNSPELDT(415) 926 3342
HOMEPHONE: (415) 941 0436 BITNET MAIL: WBHAPAT SLACVM
STANFORD
LINEAR ACCELERATOR
CENTER
STANFORD
UNIVERSITY
STANFORD,CA 94305
G. A. HERRMANNSFELDT(217) 384 4014
HOMEPHONE(217) 384 4014 BITNET MAIL: HRMNSFLDT
AT 43240.HEPNET
DEPT. OF PHYSICS
UNIVERSITY OF ILLINOIS
URBANA,ILLINOIS 61801
******Fe*****************
************************
EGN87Cl FEATURESINCLUDE:
** POSTPROCESSOR
FILES CAN BE MADE. DATA IS CALLEDBY IZSAV- TERMS.
SEE POSTPROCESSOR
BELOW.
** MASSOF IONS CAN BE INDIVIDUALLY DESIGNATED
FOR EACHTRAJECTORY.
ION CHARGEIS GIVEN BY THE SIGN OF THE CURRENT.
** EBQ MODE;ALLOWSSELECTIVESWITCHINGFROMTHE USUALWAYOF
ACCOUNTING
FOR SELF-MAGNETIC
FIELDS, TO THE MODEIN WHICHSPACE
CHARGEIS REDUCEDTO ACCOUNT
FOR THE ATTRACTIVEFORCESDUE TO THE
SELF-MAGNETIC
FIELD. SEE THE DISCUSSIONFOR THE PARAMETER
ZDOTEQ
IN THE SECTIONBELOWON UNIVERSALPARAMETERS.
** EMITTANCECALCULATION
HAS BEEN CONVERTED
TO THE RMSDEFINITIONS
COMMONLY
USEDFOR NORMALIZED
AND UNNORMALIZED
EMITTANCE.
IF MIXED SPECIESARE USED, EMITTANCEWILL BE CALCULATED
ONLY
FOR THE FIRST SPECIES, I.E., CHARGEAND MASSLINE RAY(l).
WHENTHE FIRST 2ND SPECIESRAY IS ENCOUNTERED,
THE EMITTANCE
CALCULATION
WILL STOP, SO THE SPECIESSHOULDBE SORTED.
TO AVOID HAVINGTHE PROGRAM
SORTRAYSBY RADIUS, USE IRAT=I.
** THE CHILD'S LAW STARTROUTINESARE ALWAYSSINGLE SPECIES, MASS
DEFINEDBY PARAMETER
MASS, NEGATIVECHARGE(POSITIVE CURRENT).
TO MANEIT EASIER TO GENERATE
INPUT DATA FOR DIFFERENTSPECIES,
THE CARDOUT
PUNCHEDFILE, 008, HAS BOTHINITIAL AND FINAL CARDS.
PLOTSCAN BE MADEOF PHI VS. Z, FOR ONECHOSENTRAJECTORY.
PHI IS IN MILLIRADIANS IN R-Z COORDOR MESHUNITS IN RECT. COORD.

-107-

SUBROUTINES
MAIN
SUBROUTINEANALYZ(M1)
SUBROUTINETIMTST(IT,NL)
SUBROUTINECHILDA (*)
SUBROUTINEDISTNC(Rl,Zl,R2,Z2,RHO,ZETA,DIST)
SUBROUTINECHILDB
SUBROUTINEBSET(K,BOOL, * )
SUBROUTINECHILMG(BR2,RHO,ZETA,*)
SUBROUTINEPRFILE
SUBROUTINEPOTLST
SUBROUTINERHALST
SUBROUTINEPOISSN (N,*)
SUBROUTINEBOUND(POTN,MAD,*,*)
SUBROUTINECOEF(*)
SUBROUTINETRAJCT
SUBROUTINEPLOTS
SUBROUTINEEQUIP (FZ,ND)
SUBROUTINELAPLAC (*)
SUBROUTINEFRAME
SUBROUTINEDSPROC(IEQQ,EQB,RHO,ZETA,PU,*)
SUBROUTINELISTL (ss,RHO,ZETA,)
SUBROUTINECOORD(N,RHO,ZETA)
SUBROUTINEMAGFD(ZLIM,*)
SUBROUTINELISTMG
SUBROUTINEPRTIAL(RHO.ZETA,PU,*)
SUBROUTINETOUCH(I,L,RHO,ZETA,PU,EEV,RHI,ZETI, * )
SUBROUTINERZP(Z,E,B,C)
FUNCTIONROMXX(B)
SUBROUTINERATNST(IRAT)
SUBROUTINEPERVNC(MI,*)
SUBROUTINETHERM
SUBROUTINELOOPS(RHO,ZETA,HR,HZ)
SUBROUTINESCALE2 (XX,AXLEN,NPTS,XD,XL)
SUBROUTINEWRPLOT(I,L,A,B,c,D,xX,YY)
SUBROUTINEREADA
SUBROUTINECALBRZ(RHO,ZETA,BR,BZ,*)
FUNCTIONDELIEI
FUNCTIONDELIKI
**************

**********e***

..

INSTRUCTIONS **********************

SAMPLEPROBLEM:
INJECTION GUN MODEL4-1A GRID-CATHODE
REGION (WBH) MOD.I~-20-67 MI=O
&INPUT1
RLIM=72,ZLIM=40,POTN=4,POT=O.O,5OOO.O,O.O,O.O,MI=l,~GSEG=l,TYME=l5,
&END
&INPUT2
Zl=20,Z2=40,Z3=20,BC=O.O,25.0,
&END
IO
1
0.0
-0.99
I
16
I
2.0
-0.4
I
37
3
0.99
-0.1
4
38
4
2.0
-1.0
4
48
10
2.0
-0.8
4
55
14
0.99
-0.6
4
56
15
2.0
-1.0
-108-

57
2.0
-0.4
15
4
4
58
15
2.0
-0.3
2.0
4
59
15
-0.4
60
2.0
-1.0
4
15
-0.99
61
14
2.0
4
-0.2
61
13
-0.8
4
62
-0.7
2.0
4
12
-0.7
62
6
2.0
4
62
0
-0.7
0.0
4
66
0
2.0
0.0
0
0.99
2
71
0
0.0
2
71
0.99
IO
2.0
71 26
0.99
2
2.0
0.99
71 27
0.99
2
70 27
-0.2
0.99
2
2.0
2 69
26
0.8
2 49
-0.3
17
0.2
2 41
2.0
13
0.8
2 40
2.0
13
0.4
2 39
2.0
13
0.3
2 22
II
2.0
0.2
0
0.0
2
IO
0.3
0
0
8
0.0
2.0
0
0
0.0
2
2.0
888
&INPUT5
IZI-I,
IZ2=2, IZS=IO, RAD=257, RMAX=37.5, UNITIN=O.OI, SPC=O.O,
&END
ANOTHERTITLE CARDFOLLOWED
BY DATA FOR A SECONDPROBLEMCAN GO HERE
CARDNO. I CONTAINSTITLE ON ONE CARD
&INPUT1 CARDNO. 2; &INPUTI,
CARDNO. 3 CONTAINSRLIM, ZLIM, POTN, POT(l), POT(2),...
POT(POTN).MI,MAGSEG,LSTPOT. IAX, (ALL IN NAMELISTFORMAT.)
******************************************
DEFAULT.MAX
NAMELISTITEM
*************
***********

COMMENT
*******

HEIGHT OF PROBLEM
RLIM=XX
RLIM=100,100
WIDTH OF PROBLEM
ZLIM=100,300
ZLIM-XX
(SIZE LIMIT (RLIM+I)(ZLIM+2) < QMESH)
DEPRESSED
AXIS
l-AX=0
IAX-XX
SPECTRALRADIUS FOR CONVERGENCE
XR=0.995
XR=O.SXX
SEE SPECTRALRADIUS DISCUSSIONBELOW.
NUMBEROF PASSESTHOUGHPOISSN
PASS=2
PASS=X
FOR THE INITIAL SOLUTIONTO LAPLACE'S EQUATION..NOSPACECHARGE.
NUMBEROF POTENTIALS
POTN=IOI, 101
POTN=XX
POT(l)=X.X TO POT(POTN)DEFAULTTO ZERO,POTENTIALSIN VOLTS
(USE NEGATIVEPOTN TO SIGNAL RECTANGULAR
COORDINATES)
PLOT INSTRUCTION,SEE TABLE
MI=1
MI=X
IF MI IS NEGATIVE, PROGRAM
WILL ONLYPROCESSBOUNDARY
DATA.
IF PROGRAM
ONLYPROCESSES
BOUNDARIES,BECAUSEOF MI<0 OR
DUE TO A BOUNDARY
ERROR,PLOTS SHOULDSTILL BE GENERATED.
USE MI<0 FOR CHECKINGBOUNDARIES
AND CHECKINGSCALING OF
PLOTS BEFORERUNNINGENTIRE PROBLEM. PLOT SCALINGPARAMETERS
ARE NOWABLE TO BE READ IN FROMBINPUTI;
-109-

sx=x
SY=X
SCALE='YES'

SX=8
HORIZONTAL
PLOT WIDTH (INCHES)
SX=6
VERTICALPLOT HEIGHT (INCHES)
SCALE=' '
FILLS FRAME, BOTHVERT. AND HOR.
(MAKESSCALEFACTORSUNEQUAL)

NUMBEROF SEGMENTS
OF MAGNETIC
FIELD DATA TO BE-READNEXT-.
INTPA=.TRUE. INTPA=.FALSE. CALLS INPUTA TO READVECTORPOTENTIALS
LSTPOT=l ONLYPRINT FIRST POT MAP
LSTPOT=X
LSTPOT=O ONLYPRINT PRELOADPOT MAP
LSTPOT=X
LSTPOT=O PRINT NONE, =2, PRINT FINAL, =3 PRINT FIRST AND LAST

MAGSEG=X

MAGSEG=O

MAX PROBLEM
RUN TIME MIN.
TYME= 20.0
TYME= X.X
EXPECTEDPOTENTIALS
POT(I) = CATHODE
POT(2) = ANODE
POT(~) = GRID (CONTROLS
EXTRAEQUIPOTENTIALS)
POT(4) = FOR A SURFACEWHICHWILL STOPRAYS-NOTA GRID.
POT(4) ALSO STOPSEQUIPOTENTIALLINES WITHIN ONEMESHUNIT
GRID-NOTFOR FOCUSELECTRODE
POT(5) = FOR A SHADOW

QUADAPERTURE
AQUAD=X.X
AQUAD=O.O
POT(6),POT(7) FOR QUADRUPOLE
POTENTIALS
IF AQUAD.GT. 0.0 FOR QUADRANT
SYMMETRY
PRELOAD
OTHERPOT( ) VALUESAS DESIRED
TABLEFOR VALUESOF MI;(USE MI = 0 FOR NO PLOTS)
CYCLETO BE PLOTTED INIT P FINAL ALL
FINAL ONLY
WITH EQUIPOTENTIALLINES
2
3
I
5
SEPARATEEQUIPOTENTIALPLOT 4
6
NO EQUIPOTENTIALPLOTS
7
8
9
&END
***SPECTRALRADIUS AND CONVERGENCE
OF POISSON'SEQUATION***
THE EGN PROGRAM
USES A POISSONSOLVERTHAT INVERTSA
MATRIXFOR EACHSUCCESSIVECOLUMN
OF THE POTENTIALARRAY.
ALTERNATECOLUMNS
ARE SOLVEDAS A SET OF SIMULTANEOUS
EQUATIONS,ASSUMINGTHAT POTENTIALVALUESFOR POINTS IN
ADJACENTCOLUMNS
ARE CORRECT. THIS ASSUMPTION
REQUIRES
A RELAXATIONFACTOR,HERECALLEDTHE SPECTRALRADIUS,
WHICHCAN BE CALCULATED
TO FIND AN OPTIMUMVALUEFOR ANY
GIVEN GEOMETRY,
BUT WHICHHAS FOR MANYYEARSBEEN SET TO
THE VALUEXR=O.995, WHICHREPRESENTS
A REASONABLE
VALUE
FOR LARGEPROBLEMS. SINCE XR MUSTBE LESS THAN 1.0, THIS
VALUEAPPROACHES
THE MAXIMUM,AND FOR SOMEPROBLEMS
IT
IS LARGERTHAN THE OPTIMUM. FOR THE PC VERSIONOF EGUN
THE SPECTRALRADIUS HAS BEEN MADEAN INPUT VARIABLE, BUT
USERSSHOULDTREATIT WITH CARE. FOR THE TEST PROBLEM,
GIVEN ABOVE, THE BEST CONVERGENCE
WASFOUNDFOR XR=0.960,
BUT FOR OTHERMODESTSIZED PROBLEMS,TOOSMALLA VALUE
OF XR CAUSESTHE SOLUTIONTO DIVERGEAFTERREACHING
A MINIMUMVALUE.
EACH ITERATION OF POISSON'SEQUATIONRECALCULATES
EVERY
OF 3
POINT ONCE. EACHCALL TO POISSN MAKESA MINUMUM
ITERATIONSAND A MAXIMUMOF 25. THESEARE INTERNAL
CONSTANTS
THAT CAN BE CHANGED. THE MAXIMUMWAS50 FOR
THE LARGEMACHINECODE. FOR EGN87C, THE DEFAULTIS TWO
-llO-

CALLS TO POISSN INITIALLY, (PASS=2) WITH UP TO 25


ITERATIONSEACH. MOREPASSESCAN BE USED TO GET A
BETTERSOLUTIONTO LAPLACE'S EQUATIONFOR PROBLEMS
THAT
DO NOT HAVE SPACECHARGEAND THUS NEED ONLY ONE OR TWO
CYCLESWITH RAY TRACING. ONLY ONEPASS MAY BE ENOUGH
FOR A PROBLEMWITH LOTS OF SPACECHARGETHAT ISONLY - GOINGTO CHANGEA GOODSOLUTIONOF LAPLACE'S EQUATION.
THE DIAGNOSTICPRINTED ON EACHPASS THROUGH
POISSN IS
THE NUMBEROF ITERATIONSN, AND ERR = XEP WHERE
XEP IS THE LARGESTPOTENTIALCHANGEIN THE ENTIRE
PROBLEMDURINGTHE NTH ITERATION.
__________-_________----------------------------------------------

MAGNETICFIELD METHODS
I) INPUT2 . . . POLYNOMIALSEGMENTS. . . MAGSEG=NIN &INPUT1
2) INPUT3 . . . AXIAL FIELD
. . . MAGSEG=-IIN &INPUT1
3) INPUTA . . . VECTORPOTENTIALARRAY... INTPA=.TRUE. IN &INPUT1
4) INPUT5 . . . COIL DATA...FINDS AXIAL FIELDS
5) INPUT5 . . . COIL DATA...ELLIPTIC INTEGRALS
USE (I) OR (2) FOR RECTANGULAR
SYMMETRY
____------_______-_--~~~~~~~~~~~---------~~~~~~~~~~~~--------MAGNETICFIELD DATA (READ IN MAGSEGSEGMENTS)IN NAMELISTFORMAT
THIS APPROACH
IS VIRTUALLY IMPOSSIBLETO USE IN A PHYSICALLY
REALISTIC WAYAND IS NOT RECOMMENDED
EXCEPTFOR SIMPLE
CASESSUCHAS UNIFORMFIELDS.
&INPUT2 ( FOR EACH SEGMENT)
USE &END AFTER EACH SEGMENT
USE NAMELISTFORMATFOR THREEINTEGERS, AND AN ARRAYBC
OF SEVENCOEFFICIENTSOF VALUE BZ, Bl, B2, . . . . B6
B =BZ+Bl*DZ+B2*DZ**2+...+B6**6 WHEREDZ=Z-Z3
Z TAKES THE VALUES 'Zl' TO '22' WITH ORIGIN AT '23'
FOR SIXTH ORDEREXPANSION,FIELD MUSTSTART 6 UNITS BEHIND
CATHODE,OR STARTINGPOINT, AND GO SIX UNITS PAST ZLIM.
INPUT FOR IDEAL COILS IS IN &INPUT5 SECTIONBELOW.
****

RECTANGULAR
COORDINATE
MAGNETICFIELDS ****

IN RECTANGULAR
COORDINATES
MAGNETICFIELD IS IN THE
TRANSVERSE
(PHI) DIRECTIONUNLESSMAGORD
< 0. (SEE MAGORD,BELOW)
IF MAGNETICFIELD IS IN THE PHI DIRECTION,
THEREIS NO TERMFOR SELF MAGFIELD, EVEN IF INPUT FIELD IS ZERO.
WITHOUTINPUT FIELD SELF-FIELD IS IN PHI DIRECTION. SELF-FIELD IS
CALCULATED
FROMCURRENTIN RAYS BETWEENZ-AXIS AND KTH RAY
THIS IS THE SAMEIN CYLINDRICALCOORD.
INCLUDINGHALF OF IO(K).
IF MAGORD=-IOR -2, RECTANGULAR
COORDINATE
MAGNETICFIELD IS IN
THE RADIAL (VERTICAL) DIRECTION.
IF MAGORDC-2,EG. MAGORD=-4,FIELD IS IN THE AXIAL (Z) DIRECTION
&INPUT3
POINT BY POINT INPUT OF MAGNETICFIELDS:
IF MAGSEG< 0, E.G., MAGSEG=-1,THENUSE &INPUT3 TO READARRAY
BZA=(FIELD ON THE AXIS STARTINGAT Z=-6 TO Z=ZLIM+G)
(USUALLYBZA IS THE OUTPUTOF A SEPARATECOMPUTER
CODETHAT
THE USER SUPPLIES)
&END
-lll-

.-

______________--____--------------------------------------------

&INPUTA

(TO INPUT VECTORPOTENTIALDATA)


RRO=O.O
POSITION OF FIRST ELEMENTOF A(),IN MU
RRO=X.X
RELATIVETO ORIGIN OF GUNPROB.
zzo=o. 0
zzo=x . x
DELR=X.X DELR=I.O INCREMENTIN R-(CM) FROMPOSSON/EDIT
DELZ-1.0 INCREMENTIN Z (CM) FROM.POISSUN/EDIT
DELZ=Z.Z
RLMAG=XX RLMAG=30 NUMBEROF ROWSOF A() DATA
OF A() DATA
ZLMAG=XX ZLMAG=200 NUMBEROF COLUMNS
VECTORPOTENTIALDATA ARRAYOF A, EXCEPTA*R AT R=O.
A0
UNITS OF A IN GAUSS-CM.A() IS A LINEAR ARRAYWITH
COLUMNS
RLMAGLONG. MAX SIZE OF A() IS 8000.

BOUNDARY
INPUT
~~~~~~~----~~__--------~~~~~--------~~~~~-------~-~~~~~-~--------~
BOUNDARY
INPUT (3 INTEGERS,2 FLOATINGPOINT NUMBERS)
POT. NO., R, Z, DELTA R, DELTA Z
FORMATIS FREE FIELD IN C, AND 315, 5X, 2F10.5 IN FORTRAN
TO TERMINATEINPUT, USE POT. NO. >POTN, E.G. 200.
IF 999 IS USED, SPECIAL BOUNDARIES
WILL BE READ, SEE BELOW.
--------~~__--------~~~~------~~~~~~~~~----~~~~~~~~~~~~~~~~

-------

STARTINGCONDITIONS,DEFAULTSETTINGSAND DEFINITIONS
------~~~~~_-------~~~~~~~-------~-~~~~~~~~~--------~~~~~~~~~~~~~~
&INPUT5 (INSERT HERE)
&END (INSERT AFTERSTARTINSTRUCTIONS)
INSTRUCTION
DRFAULT,MAX COMMENT
UNIVERSALPARAMETERS
AXIAL-CURRENT/(2PI)
AMPAX=O
AMPAX= x.xX
USE AMPAXTO PUT ADDITIONALCURRENTIN A CENTERCONDUCTOR.
AMPAXONLYAFFECTSSELF-MAGNETIC
FIELDS IN SUBROUTINE
TRAJCT.
USE IN CYLIND COORD.OR IN RECTANGULAR
COORD.W/O THE (2 PI).
ZEROUSES LAPLACE/%
PERVO'HOLDS' FOR HOLD
ITERATIONS
INITIAL ENERGYAT CATHODEIN EV
PE=O.I
PE = X.X
MULTIPLIES ERRORTEST
ERROR= 1.0
ERROR= X.X
METERS/ MESHUNIT
UNIT = 0.001
UNIT = x.xXx
INCHES/MESHUNIT
(SEE UNIT)
UNITIN = x.xXx
LSTRH-0 IF >I, PRINTS SPACECHARGEMAP
LSTRH=X
MAXRAY=27,101 MAXIMUMNUMBEROF RAYS
MAXRAY =X.X
IF MAXRAYIS NEGATIVE, THE NUMBEROF RAYS=ABS(MAXRAY)
MESHUNITS / STEP
STEP = 0.8
STEP = 0.xX
NUMBEROF ITERATIONS
NS = 7
NS = X
ESTIMATEDSPACECHARGE
SPC = 0.5
SPC = o.XX
SPC SIMULATESPARAXIALAPPROXIMATION
ON FIRST CYCLE.
SPC IS THE FRACTIONOF THE RADIAL FORCEUSED.
SPC=I.O FOR FULL EFFECT, SPC=OFOR NO EFFECT
AZIMUTHALLIMIT
PHILIM=O.O
PHILIM=X.X
PHILIM .NE. 0 ENDSTRAJECTORY
AT PHI .GT. PHILIM
SAVE-1 SAVESBOUNDARIES,
SAVE-O
SAVE = I
TO USE SAVE=I, OMIT BOUNDARY
CARDSFROMNEXTPROBLEM.
SAVE=2USESFINAL DATA
SAVE-O
SAVE=2
FROMPREVIOUSRUN TO STARTTHIS RUN.

PERVO= X.XX
HOLD= X

PERVO= 0
HOLD= I

-112-

USE ONLYWHENSTART='CARDS'.
SAVE=3 COMBINESSAVE-I AND SAVE=2
SAVE=3
SAVE=0
MASS= x.x
MASS= 0 (FOR ELECTRONS)
MASS> 0 FOR IONS
SEE NEWFEATUREFOR MULTIPLE SPECIESWITH DIFFERENTMASSES
IN CARDSTART SECTION.
.
IF INDIVIDUAL MASSESARE SPECIFIED, DO NOT SET MASSPARAMETER
HERE
USE THIS ONE FOR SINGLE SPECIES RUNSOR CHILD'S LAW STARTS
MASSIS THE MASSTO CHARGERATIO, 1.0 FOR PROTONS
USE MASS<0FOR RAYS WITHOUTINERTIA, LIKE THEY ARE IN MOLASSES
CAN BE USEDFOR MAGNETICFLUX LINES OR ELECTRICFIELD LINES.
AV = X

SPACECHARGEAVERAGED
LAST AV ITERATION
AVR = X.X
WEIGHTOF SPACECHARGE
AVR = 1.0
IN PRECEDINGPROGRAM
CYCLEFOR AV.
BEND = X.X
BEND-O.0 MAGNETICBENDINGFIELD
IN GAUSSIN THE DIRECTIONNORMALTO THE R-Z PLANE
FOR AXIALLY SYMMETRICPROBLEMS. FIELD MUSTBE
UNIFORM. THE EFFECTSOF SELF-MAGNETICFIELD ARE LOST
AND SPACECHARGEIS STILL AXIALLY SYMMETRICSO THAT
IF BEAM IS DEFLECTED,CHARGEDISTRIBUTION IS PROBABLY
INCORRECT.AN AXIAL FIELD MUSTBE INCLUDEDIN THE
INPUT, EVEN IF IT IS ZERO , E.G., BC=O IN INPUTP.
MAGMLT=X.X
MAGMLT=I.O
MULTIPLIES BZA ARRAY
MPLT=X
MACFIELD PLOT, SEE PLOT CONTROL
MPLT-I
AV = 0

IPBP=KI,KZ,...KG
IPBP()=O
up TO SIX RAY NUMBERS
FOR POINT
BY-POINT PRINTOUT:K,RHO,ZETA,RDOT,ZDOT,TDOT,PHI,BR,BZ,STEP,BPHI
ZEND=X.X
ZEND-1000.0 EXACTEND OF TRAJECTORY
CAUTION: IF ZEND IS NOT THE RIGHT-HANDBOUNDARY,THE SPACE
CHARGEDISTRIBUTION MAY BE INCORRECT.
VION=X.X
VION=-IE8
LOWESTPOTENTIALPERMITTED
USE VION TO SIMULATESPACECHARGENEUTRALIZATION
ZDOTEQ=O.I-1.0
ZDOTEQ-1.0
LEVEL TO ENTEREBQ MODE
EBQ MODE: A NEWEGN FEATURE, ALLOWSPROGRAM
TO OPERATEIN THE MODE
IN WHICH SELF MAGNETICFIELD IS ACCOUNTED
FOR BY REDUCINGTHE SPACE
CHARGEBY A FACTOR(I-ZDOT*ZDOT), WHEREZDOT IS VZ/C. THE CHOICEOF
THE NAMEEBQ MODECOMESFROMTHE PROGRAM
EBQ WRITTENBY ART PAUL OF
LLNL, FOR RELATIVISTIC ELECTRONBEAMS. usERs OF EGN (THIS PROGRAM)
WHOHAVE FOUNDINSTABILITIES WITH LONG, THIN, SEMI-RELATIVISTIC
BEAMSSHOULDFIND SETTING ZDOTEQAT A VELOCITY LEVEL BELOWTHAT OF
THEIR BEAM, SHOULDGIVE IMPROVEDRESULTS. SOMEEXPLANATIONOF WHY
THIS FEATUREIS SO SPECIAL, AND WHATTOOKSO LONG, MAY BE USEFUL.
THE PRIMARYPURPOSEOF THIS PROGRAM
IS GUNDESIGN, MEANINGFINDING
THE SPACECHARGELIMITED CURRENTAND OPTICS FROMA GUN. ANY CHANGE
OF SPACECHARGEFORCESMUSTPRESERVETHAT PURPOSE. THE EBQ MODE
TEST IS MADEON EVERYTIME STEP OF EVERYPARTICLE, CHECKINGTHAT THE
VELOCITY (Z-COMPONENT)
DOESNOT EXCEEDTHE LEVEL ZDOTEQ. IF IT DOES,
THEN FOR THAT TRAJECTORY,IN ONLY THAT PART WHEREZDOT .GT. ZDOTEQ,
THE SELF MAGNETICFIELD IS SET TO ZEROAND THE SPACECHARGEDEPOSITED
IS REDUCED. THIS SHOULDWORKFINE FOR THIN BEAMSIN A DRIFT TUBE,
AND IS ALSO SUPPOSED
TO WORKFOR A GUN IF ZDOTEQIS CAREFULLYUSED.
THE IDEA IS To SET ZDOTEQTO A VELOCITYAPPROPRIATETO THE DRIFT
TUBE WHERETHF,LONGITUDINALSPACECHARGEFORCEBECOMESNEGLIGIBLE
-113-

AND THE TRANSVERSE


FOCUSINGBECOMES
A BALANCEOF FORCESBETWEEN
SELF-MAGNETICFIELDS AND SPACECHARGE. USERSSHOULDCONSIDERTHIS
FEATUREAS A KNOBTO EXPERIMENTWITH.
____________________----------------------------------------------

INPUT FOR EQUIPOTENTIALPLOTS


____________________---------------------------------------------R-INTERSECTIONFOR
EQUIPR = X.X
EQUIPR = 0.0
EQUIPOTENTIALLINES
LENGTHOF EQUIPOTENTIALS
LM = XXX
LM = 300
NO. OF CORRECTIONS
EQLN = 0 TO 20
EQLN = I
EQST = 2
STEPSPER MESHUNIT
EQST = X
EXTRAEQUIPOTENTIALSAT
1z1=0,1z2=-I
THE INDICATED VALUESOF Z.
IZS=IO
EQUIPOTENTIALLINES ARE DRAWNAT 5, 15, 25.......85,
95 PERCENT
OF DIFFERENCEBETWEENPOT(2) AND POT(I).
ALSO LINES ARE AT 20, 40, 60, 80 AND 100 PERCENTOF DIFFERENCE
BETWEENPOT(3) AND POT(l).
____________________---------------------------------------------PLOTTINGCONTROLS
____________________---------------------------------------------SCALE = 'YES'
SCALE- '
' 'YES'- DIFFERENTX,Y SCALE
sx = xx
SX = 8
HORIZONTALPLOT WIDTH (INCHES)
SY = xx
SY = 9
VERTICAL PLOT HEIGHT (INCHES)
DESIGNATESA SINGLE
IPHI =X.X
IPHI = 0
TRAJECTORYFOR A PHI VS Z PLOT
Izl=x,Iz2=x,Izs=x

MPLT=X

MPLT=I

IF =I,
11=O,
11'2,
II =3,

PLOT AXIAL FIELD, AT R=O


SUPPRESSMAGFIELD PLOT
PLOT BZ AT R = RMAG
PLOT BR AT R = RMAG

DATA FOR POST PROCESSORS


IS SAVEDIN A BINARY FILE.
SPECIFY IZSAVI, IZSAVP AND IZSAVS FOR A LOOPFROMZ=IZSAVI TO
Z=IZSAV2 IN STEPS OF IZSAVS. AT THE NEXT INTEGRALSTEP AFTER
ZETA=Z, THE DATA SAVEDINCLUDESZ, K(ray number), IO(current),
RHO, ZETA, RDOT, ZDOT. TDOT, BR, BZ and BPHI.
POST PROCESSORS
CAN BE CUSTOMIZED
TO PARTICULARAPPLICATIONS.
EXAMPLESARE: READAND PRINT DATA SORTEDBY Z, CALCULATE
WAISTS AND EMITTANCES,DO SPECIAL CALCULATIONS
FOR GYROTRONS.
------_-----_------_-----~----------_-----_----__---~~----~~----MAGNETICFIELDS; METHODONE; READ IN AXIAL FIELD IN SECTION3(ABOVE)
------__---___---__----~~---~~~~-_--_________-_____-_-----------RMAG= RLIM/P OFF-AXIS MAGNETICFIELD
RMAG= x.x
AT R=RMAG
(RMAGONLYAFFECTSTHE LISTING)
HIGHESTORDERFIELD TERM
MAGORD
= 6
MAGORD
= 2,4
IF MAGORD=-IOR -2 FOR RECTANGULAR
COORDINATES,BZA IS IN THE
R-DIRECTION AND THE OFF-AXIS EXPANSIONIS A FUNCTIONOF R.
IF MAGORDC-2
FOR RECTANGULAR
COORDINATES,BZA IS IN THE
Z-DIRECTION AND THE EXPANSIONIS ALSO A FUNCTIONOF R.
EXPANSIONSIN RECTANGULAR
COORDINATES
ARE TO SECONDORDERONLY.
NO. OF FIELD COILS FOR METHODTWO
NMAG= X NMAG= 0,101
__--_--- _---_-- _---_--- _--__--_----v--e---__________--__---------114-

METHODTWO; READ IN POSITION AND STRENGTHOF NMAGIDEAL COILS.


IF NELL=O, PROGRAM
CALCULATESBZA ARRAYAND PROCEEDS
AS IN METHODONE
IF NELL=l, THIS METHODCALCULATES
FIELDS USING THE COMPLETE
ELLIPTIC INTEGRALFUNCTIONS. FIELDS ARE THENVALID IN ALL SPACE.
**** THIS VERSIONINCLUDESSERIES EXPANSIONSFOR THE INTEGRALS***
IF MANYCOILS ARE USED, THE ELLIPTIC INTEGRALSWILL.SLOWEXECUTION
IF COIL INPUTS ARE USEDFOR MAGNETICFIELDS. THE PROGRAM
WILL LIST THE OFF-AXIS FIELDS BY BOTH OFF-AXIS EXPANSIONS
AND BY USING ELLIPTIC INTEGRALS,AT R=RMAG,EVEN IF NELL=O.
THIS PROVIDESAN INTERESTINGCHECKON THE VALIDITY OF THE
OFF-AXIS EXPANSIONSIN THE USER'S SPECIAL SITUATION.
NELL=1
CR(I) = X.X
CZ(1) = x.x
CM(I) = X.X

NELL=O, =I FOR ELLIPTIC INTEGRALS


CR(I) = RLIM RADIUS OF COIL (MESHUNIT)
AXIAL POSITION OF COIL
czw = 0.0
CM(I) = 0.0
CURRENTIN AMPERE-TURNS

THE NELL=0 CASE CAN BE USED FOR STRAIGHTWIRES IN RECT. COORDINATES.


------------------------------------------------------------------

START GENERAL
----------~~~~~~~------------~~~~~~~~~~----------~-~-----~--~~--~~
START= 'GENERAL'
START= 'GENERAL' GENERALCATHODE
RC = X.XX
RC = 0.0 LOWEREND OF STARTINGSURFACE
zc = x.xX
zc = 2+CATHODEZ CATHODEZIS Z VALUE OF
BOUNDARY
FROMFIRST DATA CARD.
CL = x.xX
CL = RLIM
MAXIMUMLENGTHOF STARTING
SURFACE
DENS = xX.x
DENS= 100.0
MAXIMUMEMISSION (A/CM**2)
BETA2 = 1.0
BETA2= 0.0
IF > 0.0 USES LANGMUIRBLODGETTFORMALISM
--RAD = X.X
USE RAD FOR WIRE RADIUS IN
RECTANGULAR
COORDINATES,
BETA2 > 0.0
STARTINGSURFACEITERATION
SURFAC = X
SURFAC -1
_____-------~-~~~~~~~------~~~~~~~~~~~~~~
USE POT(5) FOR NON-EMITTINGSURFACE,E.G.
HOLLOWCATHODEOR SHADOW
GRID. DO NOT USE
POT(3) OR POT(5) FOR FOCUSELECTRODE. . .
USE POT(4) TO STOPELECTRONS
ON IMPACT.
________________-___---------------------------------------------START GENCARD
__________----------~~~~~~~~~~
___________-------_-------~-~~~~~~~~
START= 'GENERAL' GENERALWITH CARDSTART
START = 'GENCARD'
HAVE up TO MAXRAYCARDSWHICHSPECIFY:
I) RAY NO.
2) MASS, 0.0 FOR ELECTRONS
3) INITIAL RADIUS R
4) INITIAL AXIAL VALUE Z
5) DISTANCEFROMCATHODEDX (CATHODEMUSTBE POT(~)).
6) EFFECTIVE SPACINGBETWEENRAYS DR.
7) PARAMETER
WHICHMODIFIES CHILD LANGMUIREQUATION,ALPH2.
NORMALDX IS 1.0 TO 2.0 MESHUNITS.
NORMALDR IS 1.0 BUT MAY BE VARIED ALONGTHE SURFACE.
NORMALALPHZ IS 1.0 FOR A PLAIN DIODE.
FOR CYLINDRICALCOORDINATES:
ALPHZ=(ALPHA*(RADIUSOF CURVATURE)/(STARTING
STEP))**2
-115-

FOR RECTANGULAR
COORDINATES:
ALPH2=(BETA**2)*(RADIUS OF CURVATURE)/(STARTING
STEP)
WHEREALPHA AND BETA ARE AS DEFINED IN THE LITERATURE,E.G.,
SPANGENBERG
FOR BETA AND BREWERIN SEPTIER, VOL II, FOR ALPHA
FORMATIS FREE FIELD; RAY NO.,MASS,R,Z,DX,DR,ALPH2

____-------~-~~~~------------~~~~~-~-------~~~~~~~~~~~~~~~~~~~~~~~

_ START SPHERE
..
_______________--_______________________-------------------------START = 'SPHERE'
START= *GENERAL' SPHERICALCATHODE
RAD = x.xX
RAD = 2*ZLIM
SPHERICALRADIUS
RMAX= X.XX
RMAX= RLIM
CATHODERADIUS
ORAD= X.xX
ORAD= CATHODEZCENTEROF CATHODE
ST = X.XX
ST = 2.0
STARTINGSTEP
--------------------------------~~~~~~~~'SPHERE' ALSO WORKSFOR CYLINDRICALCATHODEIN RECTANGULAR
COORDINATES
______---------~~___------------~~~~~~----------~~~~~~~~~~~~~~~~~~
START CARDS
______________---___---------------------------------------------START = 'CARDS'
START= 'GENERAL' CARDSTARTING
zo = x.xX
zo = 0.0
OLD ORIGIN IN NEWFRAME
SKAL = x.xX
SKAL = 1.0
OLD MESH/NEWMESH
HAVE UP TO MAXRAYDATA CARDS(I INTEGER, 8 FLOATINGPOINT)
RAY, MASS, R, Z. ENERGY(EV), ANGLE(RADIANS),CURRENT(MICROAMPERES
IN ONE RADIAN SEGMENT),TRANSVERSE
ANGLE. TRANSVERSE
POSITION(PH1)
FREE FIELD FORMATIN C REQUIRESNINE (9) ENTRIES PER TRAJECTORY.
STOP READINGWITH RAY NO. GREATERTHAN MAXRAY.
INITIAL TRANSVERSE
VELOCITY HAS THE SIGN OF THE TRANSVERSE
ANGLE
**
**
**
**
*'

NEWEGN FEATURE; MASSMUSTBE SPECIFIED FOR EACH RAY.


PUT MASSON CARDSTART DATA AFTER RAY NUMBER.
NOTETHAT ELECTRONS
HAVE MASSCODENUMBER= 0. PROTONSMASS=I.
USE NEGATIVECURRENTS
FOR POSITIVE IONS.
MASS=l.5 WOULDBE LIKE DOUBLYCHARGED
TRITIUM.
IF CURRENTIS NEGATIVE, POSITIVE CHARGEIS ACCELERATED. THIS CAN
BE USED TO TRACKIONS IN THE FIELDS FROMAN ELECTRONBEAMPROBLEM
(USE SAVE=I) OR SECONDARY
ELECTRONS
FROMAN ION BEAMPROBLEM.
IF RECTANGULAR
COORDINATES:
I) PHI IS TRANSVERSE
POSITION IN MESHUNITS.
2) CURRENTIS MICROAMPERES
IN ONE MESHUNIT DEEP SEGMENT.
CARDSSHOULDBE SORTEDACCORDINGTO INITIAL VALUE OF RHO. USE
IRAT=I TO DEFEATTHE BUILT IN SORTROUTINEWHICH SEQUENCES
RAYS
****SPECIAL TESTS IN RATNST; CROSSINGOR 3-D SPACECHARGE**
3-D SPACECHARGE
IRAT=O
IRAT=l
CROSSING
DETECTION
IRAT-O
IRAT=
USE OF NEGATIVERAY NUMBERS:
(3-D SPACECHARGE)
A) IF IRAT=I
I) MAKERAY NUMBERS
NEGATIVEFOR BEAMEDGECARDS.
USE BEAMEDGECARDS(IO-O) TO SIMULATESPACECHARGESPREADING
OF A CYLINDRICALBEAMOF CURRENTI AND RADIUS R IN RECT. COORD.
PAIRS OF BEAMEDGECARDSPRECEDESETS OF RAY CARDSDEFINING
PART OF BEAM IN WHICH3-D SPACECHARGESPREADIS TO BE SIMULATED
SEVERALPARTS, DIFFERENTIATEDBY SELECTEDATTRIBUTES; EG., ENERGY,
ALPHA OR RADIUS, CAN BE USED SIMULTANEOUSLY
WITH ANY NUMBEROF RAYS
IN EACH PART. END OF PART IS DEFINEDBY NEXT RAY WITH NEGATIVERAY
NUMBER,WHICHBEGINS THE NEXT PART.
-116-

2) TO SIMULATECYLINDRICALBEAMSPACECHARGEIN RECTANGULAR
COORDINATES
MAKECURRENTPER MESHUNIT, I' = I/(PI*R)
INSTEAD
OF I' = 2*I/(PI*R)
WHICHWOULDHAVE THE SAMECURRENTDENSITY.
IN OTHERWORDS,MAKEI'(K) = I(K) / (2*R(K)) INSTEAD OF I(K)/
R(K). NOTETHAT THIS REQUIRESTWICE AS MANYRAYS AS FOR
CYLINDRICALBEAMWITH SYMMETRY.BEAMEDGECARDS(RAY NO. < 0)
ALSO APPLY TO OFF-AXIS PENCIL IN CYLINDRICALCOORDINATES.(R-Z AND PHI CROSSOVERS)
B) IF IRAT=
I) R-Z: MAKERAY NUMBERS
NEGATIVEFOR SEQUENTIALRAYS FOR
WHICHFINAL CROSSOVER
SHOULDBE DETECTED.CROSSINGSWILL BE
LISTED AND PLOTTED. NEGATIVERAY NUMBERS
SHOULDBE IN PAIRS.
TO FIND CROSSOVERS
WITH Z AXIS, RUN A RAY WITH R=O,ALPHA=O
PRECEDINGTHE RAY TO TEST AXIS CROSSING.
2) PHI: LEAVE RAY NUMBERS
POSITIVE FOR TRANSVERSE
RAYS TO
DETECTLAST CROSSINGOF PHI=PI*INTEGER.
IF SAVE=2, RUN STARTSWITH FINAL RAY DATA FROMPREVIOUSRUN.
DO NOT PUT SAVE=2 ON THE FIRST RUN OF A SET.
--------------~~~~~~~~~~~~~~~~~~~--------~~~~~~~~~~~~~~~~~~~~~~~~~
THERMALEFFECTS
-----------------------------------------------------------------SUBROUTINETHERMIS CALLEDIF THE PARAMETER
TC>O.
TC=XXXX
.X
TC=O
KELVIN TEMP. OF CATHODE
THREEMODELSARE INCLUDEDIN THIS VERSION
TWORAY SPLIT, RANDOMIZED
KRAY=2
KRAY=I
KRAY=3
THREERAY SPLIT
KRAY=l
FIVE RAY SPLIT
KRAY=S
KRAY=l
TWORAY SPLIT DIVIDES CURRENTS
EQUALLYINTO 2 RAYS WITH EQUAL
ANGULARDEVIATIONSFROMTHE INITIAL DIRECTION. THE AMOUNTOF THE
DEVIATION FOLLOWSA RANDOMIZED
DISTRIBUTION BASEDON A ONEDIMENSIONALRMSDISTRIBUTION.
THREERAY SPLIT PUTS CURRENTSIN 1-2-I RATIO WITH 2 PARTS IN
UNDEFLECTED
RAY AND I PART EACH IN RAYS WITH V(PERP)=SQRT(PKT/M)
IN R-Z PLANE, UP AND DOWNRELATIVE TO UNDEFLECTED
RAY.
FIVE RAY SPLIT PUTS CURRENTSIN 1-5-8-5-1 RATIO WITH
V(PERP)=2*SQRT(2KT/M)FOR 1 PART RAYS AND V(PERP)=l*SQRT(2KT/M)
FOR 5 PART RAYS. NO DEVIATION FOR CENTER8-PART RAY.
THERMCAN BE CALLEDFOR START='SPHERE', 'GENERAL', 'CARDS',
OR 'GENCARD'. IT CANNOTBE USEDFOR START='CARDS'WITH SAVE=2.
START LAPLACE
NO RAY TRACING
START= 'GENERAL'
START = 'LAPLACE'
NUMBEROF LAPLACECYCLES
NS = 7
NS = X
LAPRH=O USE LAPRH=I TO STARTREADING
LAPRH=I
DATA CARDSWITH (R,Z, SPACECHARGE)FOR NON-ZEROPOINTS.
END CARDINPUT WITH ANY SINGLE NUMBER.
FREE FIELD FORMAT.
FOR A BEAMGOINGNORMALTO THE R-Z PLANE, SPACECHARGEIS
RO(R,Z)=-120*PI*I/AREA(MU**2)*BETA....IN
RECTANGULAR
COORD.
WHEREAREA(SQ. MESHUNITS) FOR A UNIFORMBEAMOF CURRENTI(A).
*****LAPRH IS A NEWINPUT FEATURE*****
PRINTED OUTPUTINCLUDESA TABLE OF SURFACECHARGEFOR EACH
SURFACE# (POT #). TO FIND CAPACITANCE,DIVIDE BY VOLTAGE.
-117-

________________-----------------------------------------

--------

SPECIALBOUNDARY
POINTS (INCLUDINGGENERALNEUMANN
BOUNDARIES)
---------~~~~~~~-------------~-~~~~~~------------------~~~~~~-~~~
USE 999 IN COLS. 3-5 TO END BOUNDARY
INPUT. BOUNDARY
MUSTINCLUDEALL POINTS TO BE USEDAND ALL POT NUMBERS.THEN
INCLUDEANY NUMBER
OF CARDS'WITHR,Z AND FOURDIFFERENCE
NUMBERS
FOR LEFT, RIGHT, up, AND DOWN,SEQUENTIALLY. - NUMBERS
SHOULDADD TO 4*R OR 4 IF RECTANGULAR
COORDINATES.
END WITH R>RLIM.
________________---------------------------------------------FOR GENERALNEUMANN,SEE APPENDIXII OF USER'S GUIDE
TERMSARE 4*(TAN A)/(l+ TAN A) AND 4/(1 + TAN A) WHERETAN A <l
------------~-~~~___~------------~~~~~~~~~~~~~~--~---------------HORIZONTAL
DIELECTRICBOUNDARY
LEFT=RIGHT=(EI*(R-.5)+E2*(R+.5))/2
UP = E2*(R+.5)
DOWN= El*(R-.5)
WHEREEl OR E2 = 1.0 FOR VACUUM
AND E2 IS UPPER'MATERIAL'.
__---------_______---~~~~~~~~~~~~~~~-------~~~~~~~~~~~~~~~~-~--VERTICALDIELECTRICBOUNDARY
RIGHT = E2*R
LEFT = EI*R
DOWN= (El+E2)*(R-.5)/2
UP= (El+E2)*(R+.5)/2
WHEREE2 IS RIGHT HAND 'MATERIAL'.
---------~~~~~~~~~~~~~~~~~~~~~~~~-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SUMMARY
OF FILE I FORMATFOR PLOT DATA OUTPUT
________________-------------------------------------------------WRPLOT(I,L,A,B,C,D,(X(J),J=I,L),(Y(J),J=l,L)
WHERE:
I=0 THROUGH
9
FOR 1=0,7,8 PLOT A LINE
L=NUMBER
OF DATAPOINTS TO BE PLOTTED
X. Y ARE ARRAYSOF LENGTH>= L, WITH X,Y DATA
-FORI=l, PLOT X AXIS, FOR 1=2, PLOT Y AXIS
L-NUMBEROF COMPUTER
WORDSIN TITLE
FOR IBM/360 L=(N+3)/4 IF N-NUMBER
OF CHARS
A=scALE (DATA UNITS/INCH)
B-AXIS LENGTH(INCHES)
c=x cooRD OF Y AXIS, OR Y COORDOF x (OTHERCOORDIS 0.)
D-DATAVALUETO APPEARON LOWEREND OF AXIS
FOR 133, END OF PICTURE, GET A CLEANAREAON PAPER, ETC.
A,B,C,D,X,Y=O.O
L=l;
FOR 1=4, CLOSEPLOT, THIS IS THE LAST RECORD
OF THE FILE
L=l;
A,B,C,D,X,Y=O.
FOR 1=5, PLOT POINTS (OR X'S, OR SOMESYMBOL)
SAMEAS FOR I=O (LINES)
L,A,B,C,D,X,Y
FOR I-6, SET SCALEFACTOR
A=X AXIS LENGTH
B-Y AXIS LENGTH
c=sx (FROM&INPUTSOR ~INPUT~)
,,
w
D=SY
w
PLOT AREAMUSTBE AT LEAST -0.5<X<A+0.5 -O.S<Y<B+O.S
C AND D CAN BE USEDIF NEEDED.
THE TITLE ON THE AXIS SHOULDBE UNDERTHE X AXIS,
AND TO THE LEFT OF THE Y AXIS (THE PROGRAM
CAN PLOT
MORETHANONEY AXIS ON A PLOT, SO BE CAREFUL.)
I LESS THAN0, OR GREATER
THAN8 SHOULDN'THAPPEN,BUT CHECKIT.
-118-

MAX SIZE OF POTENTIALARRAY.101, ADJUSTPOTN=IOI,POT(IOI),LLL=l,lOl


MAX BOUNDARY
SIZE; 1101, ADJUSTBONDI,BONDZ,BOND3
DBoNRl,DBOND%,
~cx(llOl),~CY(llOl),ORDER(llOl+l2l),XT(llOl+l2l,6)
MAX RLIM 120, ADJUST 0RDER(1101+121),XTn(1101+121),CLn(121),
MAX NUMBEROF RAYS; 101, ADJUSTAL(lOl),IO(lOl),II(lOl),RR(lOl),RMIN(I
~ND(lOl),RMAX2(lOl),CRHO(lOl),CRHZ(lOl),CRHR(lOl),
CPHZ(lOl),CPHI(lOl),RDOTL(lOl),ZDOTL(lOl),TDOTL(lOl),~HIL(lOl),
TPHI(lOl>,W(lOl),XO(9,lOl),ZZ(lOl),II(lOl),LL(lOl),IRMIN=lOl
MAX SIZE OF PROBLEM;16000, ******ORIGINALLY 8100******
<= 16000
IN FORTRANVERSION, ADJUST TYPE(llOOO),U(llOOO),RH(llOOO)
MAX ZLIM; 300, ADJUSTBX(301+2),BY(301+2),RZX(2*301+2),RZY(2*301+2)
IBZA=301+14 , RARR(301)
RZY INIT. LOOP=1,2*301+2,
BZA(301+14),
LENGTHOF EQUIPOTENTIAL
LM-301
MAX NUMBER
OF COILS; 101, ADJUST CM(lOl),CR(lOl),CZ(lOl),LLL=l,lOl
NUMBEROF COLUMNS;401,ADJUST LINC(3,401),
(SHOULDBE LARGERTHAN ZLIM)
RARR(3,301) ONLYFOR RECT. SPRD. IN CYL. COORD.
************************
EGNDOC**************************/

MAX

-119-

APPENDIX
BOUNDARY

In the following

IV

A metal boundary

EXAMPLES

examples, we will try to illustrate

arise in generating a boundary

._

most of the situations

that can

data set.

above the point marked 1, if at potential

#3, and if the line is

assumed to be 0.6 mesh units (mu) above the point, would have a boundary

data line

as shown:

The applicable

rule is that

the mesh point

at R=3,

Z=2

the boundary,

from the inside, and is defined as a boundary

DELTAR=0.6

is the distance from the boundary

or DELTAZ.

120

point.

point to the boundary.

distance is greater than one mesh unit, as it is in the Z-direction,


2.0 is used for the DELTAR

is the nearest point

to

The distance
When this

then the code number

Metal

A metal boundary

POT

to the left of the point marked

is assumed to be 0.4 mu left of the point,

DELTAR

2.0

1, n if at potential

would have a boundary

If the metal boundary

Boundary
DELTAZ

-0.4

#3, and if the line


data line as shown.

Inside Corner
POT

DELTAR

forms an inside corner at the point marked

0.6

I
DELTAZ

-0.4

1, if at potential

#3, and if the line is assumed to be 0.4 mu left of the point and 0.6 mu above the point,
it would have a boundary

data line as shown.

121

--

A point

on the axis, or on any other segment

of Neumann

boundary,

numbered

2 above, uses a code number for DELTAR=O.O,

boundary,

and could have a data line as shown. If the Neumann

line, then DELTAZ=O.O.

The entry POT=0

0 for the lack of anything

If a metal boundary
marked

it would have a boundary

for a horizontal
boundary

Neumann
is a vertical

could be any value, but is frequently

made

better.

intersects

1, if at potential

as the point

#l,

the axis, and the nearest boundary

point is at the point

and if the line is assumed to be 0.4 mu left of the point,

data line as shown.

122

Metal with
POT
1

The point

at 4 above has two intercepts

defined as DELTAR=0.3

and DELTAZ=-0.1,

with

Two Intercepts

DELTAR

-0.1

0.3

the same boundary

and if POT=l,

DELTAZ

segment,

there would

here

be a data

line as shown.

Double Neumann
POT

Corner

DELTAR

0.0

DELTAZ

0.0
.-

If two Neumann

boundaries

intersect

as at the point

data line as shown.

123

6, it would

have a boundary

Outside Corner
2

POT

DELTAR

-0.4

2.0

2.0

0.3

The outside corner in the figure above requires the two boundary
to be defined.
intercept
is potential

The point marked

the mesh within

0 is not a boundary

#2, the boundary

points at 1 and 2

point...the

one mesh unit of the point marked

DELTAZ

boundary

does not

0. If the sharp corner

data for the points at 1" and 2 are respectively

as

shown.

A thin sheet, or ideal grid, at potential

Thin Foil or Ideal Grid


DELTAR

POT

DELTAZ

2.0

0.4

2.0

0.4

2.0

-0.6

2.0

-0.6

#3, must be defined on both sides as shown.

124

Thin Sheet on a Mesh Line


POT

2.0

0.99

2.0

0.99

13

0.5

2.0

2.0

-0.99

2.0

-0.99

If the thin foil, or ideal grid of the last illustration

DELTAR

is moved so that it lies directly

a mesh line, then the points under the foil are no longer boundary
bottom

of the foil is terminated

data lines shown.

The DELTAZ

at R=1.5,

DELTAZ

points.

on

If now the

the five numbered points would use the five

values of 0.99 would result in an effective thickness

of

the foil of 0.02mu.

Grid Wire on a Mesh Node


POT

DELTAR

DELTAZ

2.0

0.95

-0.95

2.0

2.0

-0.95

0.95

2.0
- /

An individual

grid wire, lying directly

on the mesh node marked with

would be defined by the four adjacent points as shown.

125

the letter

G,

Grid Wire on Mesh Line


POT

DELTAR

DELTAZ

2.0

0.4

2.0

-0.4

A grid wire can lie on a mesh line, instead of on a mesh node as in the preceding illustration.

There seems to be no particular

advantage or disadvantage

Note however that if there are grid wires on adjacent

to either configuration.

mesh lines, the effect is the same

as the ideal grid, no field can leak thrrough.

Grid Off Mesh, Not a Boundary


POT

A grid wire that does not intersect


the wire has to be moved a little,
resolution

DELTAR

DELTAZ

any mesh line cannot be defined as surface.


or the scale of the mesh has to be adjusted,

is needed.

126

Either
or more

Imaginary

or virtual

boundary

Imaginary

Boundary

Points

POT

DELTAR

DELTAZ

2.0

2.0

2.0

2.0

2.0

2.0

points can be used to step along a mesh line, or by any

other path by one mesh step at a time, as shown in the table. They are defined by having
DELTAR=DELTAZ=2.0,
difference
point.

equations,

and can have any value for POT. From the standpoint
virtual

boundary

points

are indistinguishable

of the

from any interior

They may be used to step along to a grid wire or other separated element.

If the virtual
a dielectric,

boundary

coefficient

RIGHT

11.75

11.75

21.0

2.5

11.75

11.75

21.0

2.5

11.75

11.75

21.0

2.5

LEFT

UP

DOWN

are used to define a surface of

points are defined after the end of the regular points,

when a 999 is used to end the input.


a dielectric

Points for Dielectric

points in the previous illustration

then special boundary

Special Boundary

The coefficients

for the upper material

127

of E2=6.0.

shown correspond

to R=3 and

45 Neumann
I- ~~~~

A Neumann

boundary

and DELTAZ=O.O.
next example,
lines, boundary

Boundary

POT

DELTAR

0.0

0.0

0.0

0.0

0.0

0.0

at 45 to the mesh can be defined by making both DELTAR=O.O

This is a special case of the General Neumann

for the case tuna


fitting

DELTAZ

= 1.0. Since Neumann

Boundary,

boundaries

cannot be used for the 45 Neumann

as in the

must lie on mesh

boundary.

Special Points for General Neumann

After

a Neumann

coefficients

boundary

LEFT

the point with

input.

5.856

0.0

0.0

10.144

4.391

0.0

0.0

7.609

2.928

0.0

0.0

5.072

the difference

Point input which follows if a

The expressions which define coefficients

the two interior

left and down in this example, are 4R/(l+M)


boundary

DOWN

has been defined, as in the 45 illustration,

999 card is used to end boundary

Here the Neumann

UP

can be redefined using the Special Boundary

the two terms linking

RIGHT

points away from the boundary,

and 4 R M/(l+M),

is at 30 to the horizontal.

128

for

where M=(Itan

a(/.

Parallel
POT

The example shows how to put in a boundary


and 2, respectively.
boundary

are Neumann

1, cause the fitting


5, fitting

0.0

-0.99

2.0

-0.99

0.0

-0.99

0.0

2.0

0.0

0.99

2.0

0.99

0.0

0.99

0.0

2.0

0.0

2.0

for two parallel

DELTAR

Input

infinite

DELTAZ

plates at POT=1

Since the plates are at Z=O and 5, these surfaces are behind

and so the DELTAZ

surface at R=5

Plate Boundary

routines

values pointing
boundaries.

to them are 0.99. The axis and the top

The skipped

to be invoked.

Similarly

points

after the point

after the points marked

is used. If the axis were any longer than in this little

point after the one marked

the

7 would also cause fitting

129

to be used.

example,

marked
3 and

a skipped

Das könnte Ihnen auch gefallen