New Electrostatic Element Procedures for COSY Infinity

Total Page:16

File Type:pdf, Size:1020Kb

New Electrostatic Element Procedures for COSY Infinity

New Electrostatic Element Procedures for COSY Infinity

J.A. Maloney

TRIUMF

1. Abstract

COSY Infinity (COSY) [1] is a DA-based beam simulation code that allows calculation of transfer maps for beam optical systems to any arbitrary order. Presently, the current beam physics package for COSY (COSY.fox Version 9.1 – January 2013) approximates fringe fields for both electrostatic and magnetic beam elements using the same model. Also, although COSY allows simulation of elements from measured magnetic field data, it lacks similar functionality for electrostatic elements. New procedures have been developed for COSY that allow more accurate modelling of fringe fields for electrostatic elements and also for specifying an electrostatic element from measure data.

2. Introduction

a. COSY Modelling of Electrostatic Elements

COSY’s modelling of most elements is based on determination of fields and potentials in the beam line midplane. COSY uses a curvilinear coordinate system where s is the forward trajectory of the reference particle, and x and y represent the transverse horizontal and vertical dimensions, respectively. The plane defined by y=0 is in this coordinate system corresponds to the x-z plane in Cartesian coordinates. COSY simulations require a reference particle that has an orbit be confined to this plane. This condition (y=0) allows the LaPlacian to be expressed as:

Where h is the momentary curvature. This allows the form of the potential to be expressed, and from this the electric and magnetic fields can be determined, using the midplane as a boundary condition. COSY then uses Maxwell’s equations to determine the potential and fields in all space via integration [2]. To specify electrostatic elements, COSY.fox defines either (1) the midplane electric field components, Ex and Ez, or (2) the electrostatic potential. For example, the potential of an infinity long electrostatic quadrupole in the midplane is

where V0 is the voltage at the poletip and D is the aperture (the distance from the optical axis to the poletip.

Most electrostatic elements are specified in COSY via the potential in the midplane in this manner. Although useful, the analytic expressions for these elements are idealized. In practice, a “pure” quadrupole, for example, is at best an approximation. Additionally, these procedures assume that the reference orbit enters normal to the surface of the element and that it is centered along the element’s optical axis. Including misalignment errors is possible in COSY, but the problem is more pronounced with bending electrostatic elements. When deflected as it enters and exits a bending electrostatic dipole, particles feel a longitudinal electric field as well as the transverse component. COSY’s internal SA and TA procedures can be used to correct this in the case of a steering dipole.

A more substantial issue arises in the case of bending elements. In the “no fringe field” case, a particle travel straight until in enters the element, then experiences a constant transverse bending force (Ex) due its electrostatic rigidity, and finally leaves via another straight path.

This “hard edge” case is unfortunately not physical. The transverse fields will drop off at the entrance and exit of the element. As a reference particle enters the element through the fringe field region, it also experiences a longitudinal electric field (Ez) that accelerates the particle. This effect is balanced by a decelerating longitudinal electric field as the particle encounters the exit fringe field so that energy is conserved. Since, however, the bending orbit is based on particle momentum, this creates and issue for calculating the reference orbit. COSY approximates this by “jumping” back to the orbit after the entrance fringe field, and also before the exit fringe field by adjusting the local coordinates of the reference particle.

This is a substantial source of error cause in the transfer map calculation.

b. COSY Modelling of Fringe Fields

In the current version of beam physics package for COSY Infinity (COSY.fox ver. 9.1 – January 2013), the modelling of fringe fields is accomplished by using an ENGE function of the form:

where is the field inside the element and D is the aperture (defined as the distance from the reference orbit to the poletip). Within COSY, default values are used for the coefficients of this ENGE function based on other magnetic systems. This values offer a good approximation of the field drop off before and after an element.

In practice, however, the ENGE function may not always be sufficient. While the function can be matched to the drop off on one particle trajectory, it will not match for offset particle trajectories. These variation generally effect only higher order aberrations. [3]

Unfortunately, COSY models these fields for electrostatic benders with the ENGE coefficients it has measured for the drop off of the field from a magnetic dipole. To obtain a more accurate model, it is possible to manual enter the ENGE coefficients into COSY if they can be determined from another model or analytic solution. [3]

c. Motivations for COSY modifications

An optical layout of the ARIEL HRS has been designed using COSY Infinity, including correction of nonlinear effects through 5th order [4]. This design utilized COSY’s existing modelling for electrostatic elements and fringe fields.

The HRS layout includes a multipole electrostatic corrector has been modelled in OPERA. This design allows for correction of nonlinear effects through 5th order. The geometry of the corrector’s poletips, however, does not create “pure” multipoles that would match the internal models in COSY. Additionally, grounding shunts used to shorten the fringe field length are also inconsistent with COSY’s internal models.

Using the OPERA model, a data file is generated with the values of the electrostatic fields and potentials in the midplane, including the fringe field regions. Additionally, physical measurements may be available at a later time from the actual corrector. By augmenting COSY’s beam physics package (COSY.fox), this data can be used to make a more accurate model of the element. These same modifications could also be utilized in simulating other beam lines that have electrostatic elements, such as the NIER spectrometer.

As additional motivation, more accurate modelling of electrostatic elements has other applications. One is the modelling of a parallel plate deflector or other bending elements where the reference orbit does not maintain a constant radius of curvature. The increased accuracy of fringe field modelling for electrostatic elements could also be important in high precision EDM beam lines.

3. New Procedures ELFF and MELP a. Creating the model

For both the ELFF and MELP procedures, detailed in section 3.c and 3.d, the electrostatic potential in the x-z midplane needs to be determined. For the CANREB multipole corrector, a design model from OPERA [5] was used and the potential is output into a text file for points on a grid encompassing the element and the fringe field region. It would also be possible to use measured data from an actual element.

Once the potential data is determined, it needs to be represented in a format that is useful to COSY. In the case of the MELP procedure, the data points from the grid can be used as input for the COSY procedure. This process is described in more detail in Section 3.d

The ELFF procedure takes a different approach. Using separation of variables, it represents the potential in the x-z midplane as the product of two functions with one independent variable for each. The grid of data points can be used to determine this function.

The x, z, and potentials from the data grid from the OPERA model of the CANREB multipole corrector were imported into MATLAB [6] and plotted as a 3D contour. An example of this is shown in the figure below: E l e c t r o s t a t i c P o t e n t i a l i n x - z m i d p l a n e f o r t h e f u l l s h u n t e d H R S m u l t i p o l e c o r r e c t o r

6 0 0 0

4 0 0 0 )

V 2 0 0 0 e (

l a i t n e

t 0 o P

- 2 0 0 0 1 0 0 5 0 - 4 0 0 0 0 0 - 1 0 0 - 5 0 - 2 0 0 - 3 0 0 - 4 0 0 - 1 0 0 X p o s i t i o n ( c m ) Z p o s i t i o n ( c m ) e l e m e n t c e n t e r e d a t z = 0

Then a polynomial was used to fit the potential curve as a function of x in the center of the corrector (a location corresponding to z=0). An example of this is shown in the figure below:

B e s t f i t o f P o t e n t i a l a l o n g x a t z = 0 i n x - z m i d p l a n e f o r f u l l H R S m u l t i p o l e

6 0 0 0 untitled fit 2

5 0 0 0 L i n e a r m o d e l P o l y 4 : V0 vs. x0 f ( x ) = p 1 * x 4 + p 2 * x 3 + p 3 * x 2 + p 4 * x + p 5 4 0 0 0 C o e f f i c i e n t s ( w i t h 9 5 % c o n f i d e n c e b o u n d s ) : 3 0 0 0 p 1 = 1 . 2 7 e - 0 5 ( 1 . 0 4 5 e - 0 5 , 1 . 4 9 5 e - 0 5 ) p 2 = 0 . 0 0 4 8 3 ( 0 . 0 0 4 7 1 3 , 0 . 0 0 4 9 4 7 ) p 3 = - 0 . 0 2 5 9 9 ( - 0 . 0 4 7 9 4 , - 0 . 0 0 4 0 4 3 ) 2 0 0 0 p 4 = - 1 . 6 ( - 2 . 4 3 8 , - 0 . 7 6 1 2 ) V e

p 5 = 2 1 . 2 3 ( - 1 6 . 7 4 , 5 9 . 2 ) n i

l a

i 1 0 0 0 t G o o d n e s s o f f i t : n e

t S S E : 3 . 0 3 3 e + 0 4 o

P 0 R - s q u a r e : 0 . 9 9 9 7 A d j u s t e d R - s q u a r e : 0 . 9 9 9 6 R M S E : 4 3 . 5 4 - 1 0 0 0

- 2 0 0 0

- 3 0 0 0

- 4 0 0 0

- 1 0 0 - 8 0 - 6 0 - 4 0 - 2 0 0 2 0 4 0 6 0 8 0 1 0 0 x p o s i t i o n i n c m a t z = 0

The 3D contour was fit using the product of the determined x-dependent polynomial and a z-dependent “top hat” function. This procedure maintains the greatest accuracy for the function in the middle of the element. The quality of the fit can be assessed by studying the R2 for the fit, where a value of 1 is a “perfect” fit to all points. In the example, an R 2 value of 0.9981 was determined.

V vs. x, z

6 0 0 0

4 0 0 0

2 0 0 0

V 1 0 0 0

5 0 - 2 0 0 0 0

- 4 0 0 0 - 5 0 0 - 5 0 - 1 0 0 - 1 5 0 - 2 0 0 - 2 5 0 - 1 0 0 - 3 0 0 x - 3 5 0 - 4 0 0 z G e n e r a l m o d e l : f ( x , y ) = ( ( 2 1 . 2 3 ) + ( ( - 1 . 6 ) * x ) + ( ( - . 0 2 5 9 9 ) * x * x ) + ( ( . 0 0 4 8 3 ) * x * x * x ) + ( ( . 0 0 0 0 1 2 7 ) * x * x * x * x ) ) * ( 1 / ( 1 + e x p ( a 1 - ( a 2 * y ) ) ) ) C o e f f i c i e n t s ( w i t h 9 5 % c o n f i d e n c e b o u n d s ) : a 1 = - 1 4 . 4 ( - 1 4 . 7 3 , - 1 4 . 0 6 ) a 2 = 0 . 0 9 1 4 ( 0 . 0 8 9 2 5 , 0 . 0 9 3 5 4 )

G o o d n e s s o f f i t : S S E : 2 . 5 5 e + 0 6 R - s q u a r e : 0 . 9 9 8 1 A d j u s t e d R - s q u a r e : 0 . 9 9 8 1 R M S E : 5 4 . 4 9

b. Using a 2 vs 6 parameter ENGE function

Consideration was given in the modelling to using a full 6-parameter ENGE function, such as the one used internally by COSY.fox, or a 2-parameter “top hat” function. MATLABs curve fitting function allows for custom equations, but in many cases it had difficulty fitting the contour plot to a 6 parameter ENGE function for the z dependency.

Studying the off-axis horizontal electric field (Ex) a comparison was made to the 2 vs 6 parameter fit. An example of the 6-parameter fits is shown below: 4 x 1 0 E x a l o n g z i n x - z m i d p l a n e - o f f s e t 7 c m h o r i z o n t a l l y f r o m o p t i c a l a x i s

0 untitled fit 3 Ex8 vs. z8 - 1 G e n e r a l m o d e l : f ( x ) = ( - 7 8 7 4 6 ) / ( 1 + e x p ( ( a 1 ) + ( a 2 * x / 2 2 0 ) + ( a 3 * x * x / 2 2 0 / 2 2 0 ) + ( a 4 * x * x * x / 2 2 0 / 2 2 0 / 2 2 0 ) + ( a 5 * x * x * x * x / 2 2 0 / 2 2 0 / 2 2 0 / 2 2 0 ) + - 2 ( a 6 * x * x * x * x * x / 2 2 0 / 2 2 0 / 2 2 0 / 2 2 0 / 2 2 0 ) ) ) C o e f f i c i e n t s ( w i t h 9 5 % c o n f i d e n c e b o u n d s ) : a 1 = - 7 . 5 7 1 ( - 1 5 . 4 8 , 0 . 3 3 3 8 ) - 3 a 2 = 2 7 . 3 1 ( - 2 6 . 2 2 , 8 0 . 8 3 ) a 3 = 1 6 5 . 2 ( 2 1 . 3 3 , 3 0 9 ) m / a 4 = 2 8 0 . 5 ( 9 2 . 1 3 , 4 6 8 . 8 ) V

n - 4 i a 5 = 2 1 3 . 2 ( 9 5 . 3 8 , 3 3 0 . 9 )

x a 6 = 5 6 . 6 ( 2 9 . 2 1 , 8 3 . 9 9 ) E

- 5 G o o d n e s s o f f i t : S S E : 1 . 1 4 2 e + 0 6 R - s q u a r e : 1 - 6 A d j u s t e d R - s q u a r e : 1 R M S E : 1 8 0 . 6

- 7

- 8

- 4 0 0 - 3 5 0 - 3 0 0 - 2 5 0 - 2 0 0 - 1 5 0 - 1 0 0 - 5 0 0 z p o s i t i o n i n m m ( z = 0 i s c e n t e r o f e l e m e n t )

This was compared to a 2-parameter fit for the same data:

4 x 1 0 E x a l o n g z i n x - z m i d p l a n e - o f f s e t 7 c m f r o m o p t i c a l a x i s

0 untitled fit 3 Ex8 vs. z8 - 1

- 2

- 3 G e n e r a l m o d e l : m

/ f ( x ) = ( - 7 8 7 4 6 ) / ( 1 + e x p ( ( a 1 ) + ( a 2 * x / 2 2 0 ) ) ) V C o e f f i c i e n t s ( w i t h 9 5 % c o n f i d e n c e b o u n d s ) : n - 4 i

x a 1 = - 1 2 . 0 9 ( - 1 2 . 3 5 , - 1 1 . 8 3 )

E a 2 = - 1 6 . 9 2 ( - 1 7 . 2 8 , - 1 6 . 5 5 ) - 5 G o o d n e s s o f f i t : S S E : 7 . 7 7 7 e + 0 6 R - s q u a r e : 0 . 9 9 9 9 - 6 A d j u s t e d R - s q u a r e : 0 . 9 9 9 8 R M S E : 4 4 6 . 5

- 7

- 8

- 4 0 0 - 3 5 0 - 3 0 0 - 2 5 0 - 2 0 0 - 1 5 0 - 1 0 0 - 5 0 0 z p o s i t i o n i n m m ( z = 0 i s c e n t e r o f e l e m e n t )

In both cases the fits were nearly perfect for the data points given. The value of R2 for the 6-parameter fit was 1 compared to .9999 for the 2 parameter fit. The extra computation time and accuracy of using the 6-parameter function seems unnecessary, and the 2-parameter “top hat” function was chosen for the z-dependency. It would be a relatively straight forward modification, however, to add a full 6 parameter ENGE function to the ELFF procedure if it were needed.

c. COSY Modifications To add functionality of these 2 new procedures, several modifications should be made to the COSY.fox beam physics package. These changes assume that the current version (COSY.fox Version 9.1 – updated January of 2013) is being used. The changes are listed in RED and comments to assist user in understanding the changes are listed I BLUE.

Add the procedures in RED to the procedures for electrostatic elements in COSY.FOX (Version 9.1, Jan 2013). Make sure to recompile it before using it. Do not add the comments in BLUE .

PROCEDURE ELFF B1 B2 B3 B4 B5 B6 B7 A1 A2 L S1 S2 D;

{Non-bending Electrostatic element from potential function}

{Specifies 1/2 of an electrostatic element of multipole order 2 and higher via a function that denotes the potential in the x-z midplane. Assumes non-bending reference orbit}

{J. Maloney triumf.ca 05/03/2014}

VARIABLE LLPI 1 ;

PPOL(1):= B1; PPOL(2):= B2; PPOL(3):= B3; PPOL(4):= B4; PPOL(5):= B5; PPOL(6):= B6;

PPOL(7):= B7; PPOL(8):= A1; PPOL(9):= A2; NSDP:=-15; LLPI:= LPI; LOFF:=2; CE:='ELFF';

IF S1<0; DL S1; LOCSET 0 S1 0 S1 0 0; SDELE S1 S2 D/100 D/20 D/10 D;

ELSEIF S1=0; LOCSET 0 -L 0 -L 0 0; SDELE S1 S2 D/100 D/20 D/10 D; DL -(S2-L); ENDIF;

LPI:=LLPI; UPDATE 0 1 1; ENDPROCEDURE;

PPOL are global COSY variable used to pass parameters to other subroutines, particularly those used to integrate fields and potentials.

NSDP is a variable used to flag the appropriate method to determine fields and potentials for elements. Negative values are used for s- dependent elements based on information from the x-z midplane and they are call in procedure POTXZ

LOFF is an internal flag set to 1 or 2. 2 should be used for any element that is s dependent and/or bending

LOCSET sets a local coordinate system for COSY integration. It is parameterized in terms of X Z P S V T. When parameters are set to zero, the values are controlled by the global reference orbit. Setting a negative value for Z and S tells COSY that its integration begins at some different location than the start of the element. In the first IF, the values are negative due to the negative drift before the entrance to the element. In the second case, they are adjusted so that z=0 is defined as the exit to the element.

LOCSET has been redefined to have fewer parameters in this version of COSY.fox than in prior versions SDELE is an S-dependent procedure to integrate the fields/potentials specified for the x-z midplane. The first and second parameters represent the initial and final points for integration along the reference orbit. The 3rd through 5th parameters specify the minimum, suggested, and maximum step size used in the variable step size integrator. The final terms is the off plane aperture that is used to set the integration boundaries.

PROCEDURE MELP L A NX NZ DX DZ SIGMA D SX SZ SPHI;

{ELEMENT DETERMINED BY MEASURED ELECTROSTATIC POTENTIAL DATA}

{NEW PROCEDURE - J. Maloney triumf.ca 03/05/2014}

VARIABLE DS1 1 ; VARIABLE IX 1 ; VARIABLE IZ 1 ;

IF (SIGMA<0.5)+(SIGMA>5.0) ;

WRITE 6 ' *** ERROR IN MELP, SIGMA < 0.5 OR SIGMA > 5.0' ; ENDIF ;

IF (DX<0)+(DX=0)+(DZ<0)+(DZ=0) ;

WRITE 6 ' *** ERROR IN MELP, DX =< 0 OR DZ =< 0' ; ENDIF ;

MFP(1) := 0 ;

LOOP IX 1 NX ; LOOP IZ 1 NZ ; MFD(IX,IZ) := A(IX,IZ) ; ENDLOOP ; ENDLOOP ;

PPOL(1) := NX ; PPOL(2) := NZ ; PPOL(3) := DX ; PPOL(4) := DZ ;

PPOL(5) := SIGMA ; NSDP := -16 ; LOFF := 2 ; DS1 := MIN(DX,DZ) ;

LOCSET SX SZ -SPHI*DEGRAD 0 0 0 ; CE := 'MELP' ;

SDELE 0 L DS1/100 SQRT(DS1*L/5) L/5 D ;

IF MFP(1)>0 ; WRITE 6 (' --- WARNING IN MELP, OUT OF RANGE OF DATA AT '&

SF(MFP(1),'(I8)')&' POINTS') ; ENDIF ; ENDPROCEDURE ;

Add these lines (in RED ) to the existing POTXZ procedure in COSY.fox before the “ELSEIF TRUE; …”. Line :

{Code for new procedures - J. Maloney triumf.ca 30/50/2014}

ELSEIF NSDP=-15; {Electrostatic Potential Function in Midplane}

V:=PPOL(1);

V:=V+PPOL(2)*x;

V:=V+PPOL(3)*x*x;

V:=V+PPOL(4)*x*x*x; V:=V+PPOL(5)*x*x*x*x;

V:=V+PPOL(6)*x*x*x*x*x;

V:=V+PPOL(7)*x*x*x*x*x*x;

V:=V/(1+exp(PPOL(8)+(PPOL(9)*z)));

ELSEIF NSDP=-16 ; {Measured Electrostatic Potential Data}

V:= GAUSS(x,z,PPOL(1),PPOL(2),PPOL(3),PPOL(4),PPOL(5),MFD,J);

{MFD(1):=MFD(1)+J;}

write 26 cons(x) cons(z) cons(v);

Care should be taken in specifying the ENGE coefficients since the function uses A2*z instead of the more traditional A2*(z/2D) where 2D is the full aperture (the full width).

My testing had verified that the data array can be as large as 700x700 now without error. Not sure why this works for potentials and not for the magnetic field data. It may be that the variation between data points is an issue.

In principle, this procedure could also be modified to allow input of Ex and Ez for the grid as well, but specifying as electrostatic potential is more direct and clean.

The write command will generate a file (fort.26) with data for X, Z and V through the element. This can be compared to the imported data set.

In the existing POTXZ procedure in COSY.fox, comment out the last line of the ELSEIF NSDP=-5 subroutine. This will look like this:

{MFD(1) := MFD(1)+J ;}

**** This line produces and error when not commented out saying that J is not specified as an array and is being added to the global array MFD. This line was not included in prior versions of COSY.fox and I believe it may be intended to hold a derivative or error parameter. In the existing code, J is defined as a scalar and set to zero and then used to hold the error flag (J=1 is the error flag) in the function GAUSS. I have put in a similar line of code and commented it out in my field data element. ****

d. Instructions for using ELFF and MELP PROCEDURE ELFF B1 B2 B3 B4 B5 B6 B7 A1 A2 L S1 S2 D

allows you to specify an electrostatic element by expressing the potential (in kV) in the x- z midplane as a function of the form:

where B1 through B7 are the polynomial coefficients for the “x” dependency and A1 and A2 are parameters for a 2-parameter “top hat” function for the “z” dependency. L represents the effective length of the element itself in meters. S1 and S2 are the beginning and final points along the reference orbit for integration of the fields/potential. D represents the aperture (from the reference orbit to the poletip) in meters. This element assumes a non-bending reference trajectory in the x-z midplane.

Since it is generally difficult to specify an element with both entrance and exit fringe fields in a single function of this type, an element can be split into 2 parts. The first part will include the entrance fringe field. This can be done by specifying a value for S1 that is negative distance in meters from the physical entrance to the element. S2 will represent the distance in meters from the entrance to the element. L will represent the actual length from the entrance to S2.

For the exit fringe field, S1 should be set to 0. L will be the distance to the exit of the element and S2 will represent the total length for integration of the reference orbit.

As a comparison, keep in mind that COSY.fox internally integrates for a minimum distance of 5*D for the fringe fields outside the element and 3*D for the fringe fields inside the element. This element could be used without fringe fields by setting S1=A1=A2=0 and L=S2. Then the values of polynomial coefficients will also need to be multiplied by 2. This, however, wold merely remove the z dependency and make the potential function identical to those already included in COSY.fox for electrostatic multipoles This “hard edge” case is uninteresting except as a benchmark of the new procedure in comparison to other elements already existing in COSY.fox.

For entrance and exit fringe fields, the sign of A2 will also need to be changed. Generally the value of A2 should be negative for entrance fringe fields and positive for exit fringe fields.

PROCEDURE MELP L A NX NZ DX DZ SIGMA D SX SZ SPHI

allows you to specify an entire electrostatic element, including any bends or fringe fields, by inputting data for the electrostatic potential at points in a rectangular grid in the x-z midplane. This procedure mirrors the input methods COSY uses for the MF procedure to specify an element by the magnetic field in the midplane. COSY uses its Gaussian wavelet function to interpolate the potential between the specified points as COSY integrates along the reference orbit itself.

L represents that actual path length for the reference particle trajectory as it travels through the element. A is an array that specifies the electrostatic potential in the rectangular grid. NX and NZ represent the number of grid points along X and Z, respectively. DX and DZ are the spacing, in meters, between each point. The first entry (1,1) is the value at the lower left-hand point on the grid. X represents the horizontal offset from the reference orbit and z represents the Cartesian coordinate in the general direction of the beam propagation. The actual point that the reference particle orbit enters the element is specified with the parameters SX and SZ and should correspond to offset in meters within the grid. SPHI represents the angle of the particles trajectory (in radians) at this point from the z direction. SIGMA is a parameter used by the Gaussian interpolator. It should have a value generally between 1.2 and 1.8. Smaller values of this parameter represent a coarser grid of data point. D represents the aperture in meters from the reference orbit. One helpful diagnostic from this procedure is the output generated by COSY.fox to a file named fort.26. This file will contain the calculated values of the local horizontal offset (x), local Cartesian z, and electrostatic potential at points along and near the reference trajectory. Since these are calculated using the Gaussian interpolator from the data grid provided they provide a possible diagnostic tool.

Also, MELP will return error messages similar to those used in the MF procedure if the grid spacing creates potential jumps that are too drastic, the choice of SIGMA is too large or small, or if the spacing between points is entered as a negative or zero value.

e. Benchmarking

The initial testing of the ELFF procedure was with the trivial case of an electrostatic quadrupole without fringe fields. A short drift was placed before and after the element. This was compared to the internal procedure EQ in COSY.fox. The resulting transfer maps were identical. A more elaborate test was done by adding basics fringe fields to the EQ model using the FR 1 model in COSY. The ELFF model used only a 2-parameter “top hat” function, but the results were still very closely matched:

--- BEGINNING COMPILATION

--- BIN FILE READ: C:\Program Files (x86)\COSY 9.1\cosy

--- BEGINNING EXECUTION

Map using EQ and FR=1

-1.131068 -0.8786041 0.0000000E+00 0.0000000E+00 0.0000000E+00 100000

-0.3177786 -1.130968 0.0000000E+00 0.0000000E+00 0.0000000E+00 010000

0.0000000E+00 0.0000000E+00 5.957681 2.774008 0.0000000E+00 001000

0.0000000E+00 0.0000000E+00 12.43414 5.957422 0.0000000E+00 000100

0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 1.000000 000010

0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.9999997 000001 ------

Map using ELFF and 2 parameter ENGE function

-1.130922 -0.8785777 0.0000000E+00 0.0000000E+00 0.0000000E+00 100000

-0.3175417 -1.130922 0.0000000E+00 0.0000000E+00 0.0000000E+00 010000

0.0000000E+00 0.0000000E+00 5.957490 2.773727 0.0000000E+00 001000

0.0000000E+00 0.0000000E+00 12.43514 5.957490 0.0000000E+00 000100

0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 1.000000 000010

0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.9999997 000001

------

=== COSY RUN FINISHED ===

To test MELP, an array of data points was analytically generated to model the electrostatic quadrupole and COSY’s internal fringe field. Then the results were compared to the basic simulation using EQ, FR 1 and drifts. Testing was done for grids of different mesh densities and also with variations in the SIGMA fit parameter. For example, here is a comparison using SIGMA of 1.8, horizontal spacing of .25 cm and longitudinal spacing of 1.25 cm between data points;

--- BEGINNING COMPILATION

--- BIN FILE READ: C:\Program Files (x86)\COSY 9.1\cosy

--- BEGINNING EXECUTION

Map using EQ and FR=1

-1.131068 -0.8786041 0.0000000E+00 0.0000000E+00 0.0000000E+00 100000

-0.3177786 -1.130968 0.0000000E+00 0.0000000E+00 0.0000000E+00 010000

0.0000000E+00 0.0000000E+00 5.957681 2.774008 0.0000000E+00 001000

0.0000000E+00 0.0000000E+00 12.43414 5.957422 0.0000000E+00 000100

0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 1.000000 000010

0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 0.9999997 000001 ------

Map using measured potentials

-1.167639 -0.8961179 0.0000000E+00 0.0000000E+00-0.5391790E-01 100000

-0.2909835 -1.079748 0.0000000E+00 0.0000000E+00-0.8809345E-01 010000

0.0000000E+00 0.0000000E+00 5.837715 2.596748 0.0000000E+00 001000

0.0000000E+00 0.0000000E+00 12.09258 5.550351 0.0000000E+00 000100

0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00 1.000000 000010

0.8717215E-01 0.2072441E-01 0.0000000E+00 0.0000000E+00 1.000657 000001

------

=== COSY RUN FINISHED ===

Adjusting the grid size means varying degrees of interpolation by COSY as it integrates along the reference path. Like the MF procedure for magnetic field data, the computation time involved in the MELP procedure is much greater than the function based procedure or COSY’s own internal modeling. For example, this previously mention model, with an 82 x 320 grid took approximately 12 seconds to compile as compared to the near instantaneous run of the internal procedures. Additional comparisons are being made with more complicated models, including electrostatic deflectors.

f. Conclusions

Some preliminary conclusions can be drawn from the initial testing of these new elements. The current procedures in COSY allow only basic modelling of electrostatic elements consistent with very general analytic functions. Additionally, although COSY does have fringe field modelling, the default model is not accurate for electrostatic elements. Lastly, the adjustment made by COSY to account for longitudinal fields in electrostatic elements is a potential source of error.

Using a function to model elements, including fringe fields offers a quick and more consistent method of modelling these elements. This works similar to the internal procedure for general optical elements in COSY.fox, GE, but is based on a fit to data in the whole midplane rather than just along the reference orbit. This is important for many non-bending electrostatic elements where the potential along the optical axis is very close to zero.

For more accurate modelling, particularly for bending elements, the data grid based MELP procedure allows for modelling complex and even non-symmetric electrostatic elements. COSY assumes that the reference particle travels at a constant radius of curvature through these deflecting elements, but MELP allows modelling of elements where the reference particle follows a parabolic orbit instead. It also allows modeling of beam elements where the potential cannot be accurately expressed as a simple analytic function.

One drawback to the MELP procedure is the greater amount of computation time involved due to the extra interpolation that COSY must perform. Also, this procedure will be sensitive to error if the spacing on the data grid is too large. These issues, however, are not unique and already exist with using the current MF procedure to model magnetic elements form measured magnetic field data.

4. References

[1] K. Makino, M. Berz, COSY Infinity Version 9, Nuclear Instruments and Methods A558 (2005) 346-350.

[2] M. Berz, Advances in Imaging and Electron Physics, Vol. 108, (1999) pp. 125- 126.

[3] R. Baartman, End Effects of Beam Transport Elements, July 2001.

[4] CANREB HRS, TRI-DN-

[5] OPERA - Software for electromagnetic design, Cobham, plc., http://magnet-design- software.com/product/

[6] MATLAB, The Mathwork, Inc., http://www.mathworks.com/products/matlab/

Recommended publications