12
88 MODELLING OF UNDULATOR SOURCES K. CHAPMAN, B . LAI and F. CERRINA Electrical and Computer Engineering, University of Wisconsin, Madison, WI 53706, USA 3. VICCARO Advanced Photon Source, Argonne National Laboratories, Argonne, IL 694'39, USA Received 25 April 1988 and in revised form 27 April 1989 We present a new code capable of realistically modelling the radiation from ideal undulator sources, including explicit electron emittance effects. The code has been developed as part of the SHADOW X-ray optics ray tracing program, in order to predict the performances of undulator-based optical systems. The approach is based on a simplified field distribution that allows an efficient calculation of the trajectory and of the radiation field . We show explicitly that the undulator radiation pattern is shift-invariant with respect to the electron trajectory angles, so that the emittance effects canbe included without recomputing the radiation distribution. Furthermore, the time consuming computation of the undulator emission patterns is decoupled from the . Monte Carlo sampling of the wavefront, leading to a very fast code . This is achieved by computing the three-dimensional source probability distribution function and by using an inversion algorithm to generate a random variate with the same distribution as the source . The physical basis of the code and the algorithm used are discussed in detail and some results presented. 1. Introduction The use of undulators in electron storage rings is becoming widespread because of the unique characteris- tics of the radiation emitted by those devices [1] . An undulator is typically formed by a periodic array of alternating dipole magnets installed in a straight section of a .^ . elcctroa storage ring [2], so that the field will cause the relativistic electron beam to oscillate around its central orbit . The resulting trajectory is almost sinusoidal, thus leading to emission of radiation by the electrons in the portion of the trajectory where the acceleration is not zero. Because of the periodic nature of the electron motion, there will be some wavelengths for which the radiation will be in phase over several periods . These wavelengths will be reinforced by an interference process, while others will be suppressed . This is the basic principle of operation of undulator sources . In contrast to a bending magnet source, the radiation will be emitted at a few discrete wavelengths and will be centered into a narrow cone along the undulator axis (because of the rapid onset of destructive interference) [3,4]. The theory of the radiation bright- ness and its application to the case of synchrotron radiation sources is presented in several papers by Kim ï4] ; c'-m -outputer model presented here follows the same approach. As will be shown in detail below, it is important to notice that the spatial extent of the radiation source 0168-9002/89/$03 .50 < Elsevier Science Publishers B.V . (North-Holland Physics Puolishing Division) Nuclear Instruments and Methods in Physics Research A283 (1989) 88-99 North-Holland, Amsterdam ("source size") is given by the electron beam cross section, while the angle of emission ("source aperture") is given by a convolution of the radiation opening angle and the electron beam divergence . Sources of small aperture allow the design of smaller optical elements : this is of critical importance because the aberrations in an optical system are a high-power function of the optical element size (typically third power) . Further- more, the cost is also a strong function of the element size . Because of the large power emitted by the synchro- tron sources it is necessary to limit as much as possible thermal loading fo the optical surfaces that may lead to surface distortions of sensitive optical elements such as diffraction gratings or monochromatizing crystals . The undulettors emit radiation in narrow bands making them well suited as sources for monochromators. It is of crucial importance to model and predict the performances of an optical system designed around an insertion device such as an undulator . In particular, the effect of the high power density on the optical surfac7 .es must be understood and controlled so that the resolu- tion will not be degraded in actual operation . This can be done ~)y modelling the beam generation at the source an, . = ts propagation through the optical system. A com- puter code capable of performing this task is SHADOW [5], a Nvell-established X-ray optics modelling code de- veloped by our group . The rest of this paper deals with the description of the newly implemented undulator source model for SHADOW .

Modelling of undulator sources

Embed Size (px)

Citation preview

Page 1: Modelling of undulator sources

88

MODELLING OF UNDULATOR SOURCES

K. CHAPMAN, B. LAI and F. CERRINAElectrical and Computer Engineering, University of Wisconsin, Madison, WI 53706, USA

3. VICCAROAdvanced Photon Source, Argonne National Laboratories, Argonne, IL 694'39, USA

Received 25 April 1988 and in revised form 27 April 1989

We present a new code capable of realistically modelling the radiation from ideal undulator sources, including explicit electronemittance effects. The code has been developed as part of the SHADOW X-ray optics ray tracing program, in order to predict theperformances of undulator-based optical systems. The approach is based on a simplified field distribution that allows an efficientcalculation of the trajectory and of the radiation field. We show explicitly that the undulator radiation pattern is shift-invariant withrespect to the electron trajectory angles, so that the emittance effects can be included without recomputing the radiation distribution.Furthermore, the time consuming computation of the undulator emission patterns is decoupled from the. Monte Carlo sampling ofthe wavefront, leading to a very fast code . This is achieved by computing the three-dimensional source probability distributionfunction and by using an inversion algorithm to generate a random variate with the same distribution as the source . The physicalbasis of the code and the algorithm used are discussed in detail and some results presented.

1. Introduction

The use of undulators in electron storage rings isbecoming widespread because of the unique characteris-tics of the radiation emitted by those devices [1] . Anundulator is typically formed by a periodic array ofalternating dipole magnets installed in a straight sectionof a. .̂ elcctroa storage ring [2], so that the field willcause the relativistic electron beam to oscillate aroundits central orbit. The resulting trajectory is almostsinusoidal, thus leading to emission of radiation by theelectrons in the portion of the trajectory where theacceleration is not zero. Because of the periodic natureof the electron motion, there will be some wavelengthsfor which the radiation will be in phase over severalperiods. These wavelengths will be reinforced by aninterference process, while others will be suppressed .This is the basic principle of operation of undulatorsources. In contrast to a bending magnet source, theradiation will be emitted at a few discrete wavelengthsand will be centered into a narrow cone along theundulator axis (because of the rapid onset of destructiveinterference) [3,4]. The theory of the radiation bright-ness and its application to the case of synchrotronradiation sources is presented in several papers by Kimï4] ; c'-m -outputer model presented here follows thesame approach.

As will be shown in detail below, it is important tonotice that the spatial extent of the radiation source

0168-9002/89/$03 .50 < Elsevier Science Publishers B.V .(North-Holland Physics Puolishing Division)

Nuclear Instruments and Methods in Physics Research A283 (1989) 88-99North-Holland, Amsterdam

("source size") is given by the electron beam crosssection, while the angle of emission ("source aperture")is given by a convolution of the radiation opening angleand the electron beam divergence . Sources of smallaperture allow the design of smaller optical elements :this is of critical importance because the aberrations inan optical system are a high-power function of theoptical element size (typically third power) . Further-more, the cost is also a strong function of the elementsize . Because of the large power emitted by the synchro-tron sources it is necessary to limit as much as possiblethermal loading fo the optical surfaces that may lead tosurface distortions of sensitive optical elements such asdiffraction gratings or monochromatizing crystals . Theundulettors emit radiation in narrow bands making themwell suited as sources for monochromators.

It is of crucial importance to model and predict theperformances of an optical system designed around aninsertion device such as an undulator. In particular, theeffect of the high power density on the optical surfac7.esmust be understood and controlled so that the resolu-tion will not be degraded in actual operation. This canbe done ~)y modelling the beam generation at the sourcean,. = ts propagation through the optical system. A com-puter code capable of performing this task is SHADOW[5], a Nvell-established X-ray optics modelling code de-veloped by our group. The rest of this paper deals withthe description of the newly implemented undulatorsource model for SHADOW.

Page 2: Modelling of undulator sources

The principle of operation of undulators is decep-tively simple . The equations controlling the radiationpattern and emission rate cannot be put in closed formand, furthermore, the undulator source does not havethe scaling properties of the conventional bending mag-net sources (making it necessary to recompute the sourcemodel for any change in the operation point) [6,9] .From a computational point of view, calculations basedon exact field and trajectory models quickly becomevery lengthy. It is thus essential to define a model basedon a simplified field distribution that can model accu-rately the properties of the undulator to the degreeneeded for optical analysis. We notice also that anoptical simulation code such as SHADOW needs togenerate thousands of rays in order to model the source- direct calculations are inefficient and prohibitivelytime consuming. We have then separated the task intotwo parts ; we first compute the source brightness andfrom it was generate a probability distribution fun .ion(PDF) that can be used by a very efficient Monte Carlocode to generate the source model [8].

The paper is organized as follows. After presentingthe basic assumptions of the ray optics model, wediscuss the trajectory calculations and we compare ourresults with those obtained by other codes . In the sec-tion on the radiation we present the model and theresults obtained, again comparing with other authors.We then discuss the effect of finite electron beamemittances on the spectrum. Finally, we present anddiscuss the implementation of the Monte Carlo methodleading to the generation of a random variate with aprobability density function (pdf) given by the undula-tor spectral characteristics, i.e ., the source modellingalgorithm. Some examples of ray tracings will concludethe presentation .

2. Electrons and photons : the ray optics model

In the development of the source model we assumethat the electrons are radiating independently from eachother but coherently along, the trajectory. Implicit inthis is the assumption that the undulator field is perfect(no random errors) and that the emission of a photon isa small perturbation on the electron orbit . In this model,each photon is generated along the trajectory but be-cause of the interference process leading to the rein-forcement/suppression of certain wavelengths no exactorigin can be defined . In keeping with the principles ofray optics [10,11] we identify the origin of each photonwith the transverse position of the radiating electron .The apparent source location (i .e ., the photon beamwaist) will be located then at the electron beam v ,aist[10] . The main difference with the case of a bendingmagnet (or a wiggler) source is the lack of interferenceprocesses in these cases, leading to a well defined origin

K Chapman et al. / Modelling ofundulator sources

for each photon . The statistical analysis of the particlebeam propagation is easily extended to photon beams.In the current framework, we assume that the spatialpart of the source is determined by the cross section ofthe electron beam while the angle part is given by amore complicated interplay of the electron trajectoryangles and of the radiation emission pattern, to bediscussed below. Whatever the details, the photon beampropagation is represented by the evolution in phasespace; of a volume enclosing the ensemble of pointsdescribing a sample of the real source . Typically, anundulator source will define a very small phase space(in comparison to a bending magnet) because of thenarrow emission angle . The key parameter is the densityof system points in the phase space, i .e., the brightness .The brightness is conserved in the propagation througha lose" ;ss nondispersive system. In particular, the fluxtransmitted by an optical system is given by the integralof the brightness function [4]N(hw)

f

B(x, x'; y, y' ; hw) dx dx' dy dy'- Acceptance

over the optical system acceptance volume in phasespace. To avoid losses of flux, the extension of thesource phase space should always be smaller than theoptical system acceptance . We notice that the far-fieldintensity pattern is obtained instead by integrating overthe spatial variables (x, y), making it independent ofthe beam cross section . L is important to realize thattnis model is an approximation of the more completephase-space description of synchrotron radiation opticspresented in ref . [4] .

3. Trajectory

89

Basic to the modelling of spectral distribution ofradiation from an undulator is an accurate calculationof the electron trajectory . We will show that by ap-proximating the magnetic field and performing a changeof variables the computation of the coupled differentialequation typically encountered in trajectory calculationsis eliminated . All calculations will use the definitions ofposition and angle variables as shown in the undulatorgeometry of fig . 1 .A sinusoidal magnetic field perpendicular to the

undulator axis, such as21Tz �

By = Bo cos ~

y,0

forces the electron travelling along z to oscillate alongthe x-axis. This f eld does not satisfy the irrotationalitycondition, ® x B = 0 . A nonzero B~, component is re-quired to satisfy the condition, but it can be easily

Page 3: Modelling of undulator sources

90

F=yrn =e(-,8,,B.ic+ BXRî)

Fig. 1 . Coordinate system and variables used in the calculations (upper panel) and relevant position vectors (lower panel) .

shown that it is a second order term at most and can besafely neglected for small amplitudes.

The force on the electron is given by the Lorentzequation (in combination with eq . (2)) :

(where m denotes the r,:st mass of the electron) . The xcomponent of the acceleration is given by:

`vile the velocity along y is a constant of motion(F,, = 0) in the simplified field of eq. (2) . A simpleexpression is thus obtained for the x component, sincenow the acceleration along x is a function of variable zonly :

Al(c) = - y

f.,(Z) 80 ces~o

.

K. Chapman et al. / Modelling of undulator sources

We can further simplify the calculation of ßx by rewrit-ing the time derivative as a position derivative :

t3X(z)=CAdz PX(z) .

(6)A simple integration gives the final expression for the xcomponent of the velocity :

eB0

A(,

2rrzßx (Z) _ -

sinvmr 21T

Since

z -

Nr~~

~x (Z)

+ 13X0- 7

the velocity along

can be obtained directly using eq .(7) . We proceed now to change variables and write thetrajectory as a function of position., z . This leads to thetime being written as :

~

, .c ,10

..

PAZ )

Page 4: Modelling of undulator sources

Similarly, we now write x as a function of z, leading tothe following integral :

z'Jo ß2(z )fo,

identical krocedure solves for y in terms of z,

Y(z)-Yo=ßyJZdz ,

(11)

o ß.(z )The trajectory of the electron in the undulator is thus

fully specified, as a function of the coordinate z, by eqs.(9)-(11) . We stress that the simplicity of the equationsdefining the trajectory is a consequence of the fact thatin an undulator the magnetic field component along thez-axis " - negligible . This leads to the separation of theproblem into independent equations that can be in-tegrated directly . The integration process is further sim-plified by the change of variables from t to z . In anundulator with a field such as that of eq . (2), the motionof the electron is strictly periodic . We can then computethe trajectory over a single period and repeat the resultsover the length of the undulator .

Although simplified, the integrals still cannot becomputed in closed form. We resort then to a numericalcomputation scheme. The velocities of the electron arecomputed at a prefixed number of points along oneperiod and stored in double-precision (64 bits) varia-bles. The integration is performed using the subroutineQSF from DEC's SSP library; it employs a combinationof Simpson rule and Newton 3,/8 rule. The electrontrajectory is stored on disk, for further processing, as abinary unformatted file containing the position andvelocities along the trajectory as a function of theposition along the undulator axis (i .e ., Z) . The code alsoco*nputes useful beam and undulator p.tr:meters thatare written at the beginning of the trajectory file, as wellas to a user defined ASCII file for reference.

E

x

0 .

KChapman et al. / Modelling ofwidulator sources

0

002

004

0.06z (meters)

Fig. 2. Trajectories computed in a single perioa. Solid line :output from Luccio's code, crosses : pregent calculations .

91

We tested the accuracy of our code by comparing itsresults with those generated by other, exact, codes . Fig .2 shows the trajectory for the on-axis case where thesolid line represents data from a code developed byLuccio [71 while the crosses are those generated bNFPATI-l, for a few values of K . The agreement is verygood and confirmed by a more detailed analysis .

4. Radiation

The intensity of radiation at a distance far from theinstantaneous point of the electron position is related tothe detailed trajectory [121. Before presenting our al-gorithm, let us review briefly the basic principles of theemission process . Fig. 1 illustrates the relative positionvectors for the observer RP, trajectory r(t' ), and dis-tance between trajectory and observation points R(t' )= R P - r(t') . The accelerated electron emits radiationat time t' and position r(t' ), which arrives at theobservation point R P , at some later time t . The time ittakes the field to reach the observer is R(t')/c, whereR (t') is the distance between a point on the trajectoryand the observation point .We begin by defining the field created at a position

R by an electron located at a point r along the trajec-tory ; the expression describing the field at the source isoften written in the form :

E(t) =

e

n X [ (n - j8) X P](12)

4ir E oc

R(1 _n . ~e )a

l .It is more convenient to work in the frequency domain .By making the conversion from t to r `, and insertingthe expression for the field, the following form is ob-tained :

,Ü(W) -

e

~+ 00 d

(nX(nX J9 ))

41r 2~ ,s cc

- ��

át 7R (1 -n-)

)

The integral can be readily integrated by parts as-suming far-field approximations where R (i') = R P sothat for small opening angle ~o , (t') and n( t' ) areapproximately constant in time. This enables us toremove R outside the integrand . The approximation inR cannot be taken to the phase term because theexponential term is very sensitive to sm-..1 variations into®'. phase. YfBLCgflcatig0g by parts and. iaoi °sáag tbat the fieldmust be zero at t _ + oc, we obtain-

E( 'w) =

twe_

+~[nX (n X

)]4 ,nc o 2iT cR

(13)

(14)In the phase term we can wate:

-n . r(t') .

(15)

Page 5: Modelling of undulator sources

92

The first dot product contributes a constant phase term,which we can ignore.

The final form of the far-field approximation is,

,Ü(W) =

iwe

+00 [n X (n X .8)14Rtco 2~ cR

P

- oo

Xe[-"'(''-A-r(r')1c)l d t '.

(16)

The integration is over time and proceeding with thechange of variables corresponding to the argument ofthe trajectory parameters we substitute, dt' = dz/(cßz ).We further change the limits of integration to the regionof the undulator, L, because there is no magnetic fieldoutside the undulator and thus no radiation; we neglectthe effect of any fringing fields. For simplicity wedenote the constant in front of the integral as FO, andthe phase term as ~(z),

4(z) _ -w

tf -n(z)

.r(z)

1

c l -

The form of eq . (16) becomes,

K. Ch.apman et

E(w)

FOJ_~ 22[n x (n x ~) ]_

e'O(Z)

.c

a- 0 - w

k

wO2Y2

az

k

[1 + K2/2 + Yz® 2 ].

Mo lsin[

2c(cT-A.- n)]

E(w) = FO

sin[ 2c(cT-XO .n)]

al. / Modelling of undulator sources

Because of the fast oscilia ions of the integrand, themain contributions to the emission spectrum will comefrom the region in which the phase is stationary [151,i.e .,

(19)

The integration taken over the entire undulator in-cludes all NO peso&. Let us define T as the time it

takes to travel one period of the trajectory and XO theperiod directional along the z-axis. The phase is peri-odic in z, with period A O . This allows us to reduce theintegral of eq . (4) to a sum of integration taken over oneperiod . The final form becomes:

2.+ÄU

r dzX f-

L/

[n X (n X P)] e `P (_ )__ .

(20),,-1,/2

The physical model behind this description is thus thatof a collection of N radiators emitting in phase. This issimilar to what is observed in diffraction grating theory[91, solid-state physics [141, and is a manifestation of thediffraction nature of the undulator source [13] . The firstfactor (the grating-like) is purely kinematical in natureand simply defines the position in energy of the emis-sion peaks ; notice that it gives the same intensity for all

the harmonics. The second factor, the integral, de-termines the repartition of energy among the differentharmonics. For example, the grating term is insensitiveto the detailed shape of the magnetic field within eachperiod, while the second is strongly affected by it. Thus,undulators with the same periodicity but with, for ex-ample, different field distributions will have differentintensities in the various harmonics. Again, this effect isvery similar to the repartition of energy among thedifferent orders of a diffraction grating or the differentBragg reflecitons from a crystal.

Finally, the power per solid angle per energy intervalis expressed in terms of the transformed field as

a2W

2RpeO IE(w) I 2a J aw =

fLOC

.

From this we find the final expression :

a 2Wap aW

Again, we check the accuracy of our calculations bymaking a comparison between our results and those ofother well-established codes. We elected to use one ofthe cases illustrated by Tatchyn [91 as our prototypicalsystem . We computed the on-axis and off-axis spectraat (0 = 60 p rad, q = 60 ~trad) spectra in the region500-5500 eV. The results are shown in fig. 3. We alsocompare the emission pattern from the undulator in theregion of the first, second and third harmonics, as

w2e 2

sin[__

2c (Tc - AO -n)J

16 T3eoe3

sin 2w (Tc - AO - n)-

X ~

-L/2+X

o

'O(Z)

dz12 .

2000 3000

F 11 ,

(21)

(22)

Fig. 3. undulator spectrum computed by Luccio's code (lowercurve) and our code (upper curve) for two different observa-

tion angles. The curves have been offset for clarity .

Page 6: Modelling of undulator sources

Fig . 4.

Fig. 5 .

Fig . 6.

K Chapman et al / Modelling of undulator sources 43

shown in figs. 4-6 . The output from our code is essen-tially identical to that of refs . [7,9] .

5 . Electron beam etui

nce effects

So far we have considered only the case of idealelectron trajectories, i .e., zero emittance beams . Let usfirst consider the effect of the finite spatial extent of thebeam in (x, y). The beam cross section is a doubleGaussian of standard deviation (ax , ay ). Since we haveassumed that the field in eq . (2) is translationally in-variant in (x, y), the offset in the trajectory of theelectrons due to the finite beam size will have no effectin the equations of the spectra. This can be seen directlyfrom eq. (20) where an offset in r will result in aconstant phase term . We do not expect any spectralmodifications as long as the beam size can be consid-ered small relative to the magnetic field extension .

Let us consider now the case of an electron incomingwith a velocity ß = (ßr , ßy , ßZ ) where ft, fty <<&. Theangles subtended will be a.,, ay as shown in fig . 1 . Letus consider separately the effect on the undulator spec-trum of ay and a,r 0 0. In the first case (ay $ 0), thevelocity component By is parallel to the magnetic fieldB so that the Lorentz force due to ft, will be zero . Asmall force will be present if we consider the initialcomponent of B along the axis needed to satisfyMaxwell's equation but its magnitude is a second-orderterm . Furthermore, we neglect variations of the mag-netic field in directions orthogonal to the undulatoraxis . From the point of view of the electron traversingthe undulator at this off-axis angle there will be thefollowing two effects. The first will be a lengthening ofthe magnetic period by a 1/cos a,, = 1 + a?/2 factor,again a second-order effect . The second, a reduction inthe apparent value of the magnetic field by the samefactor. Overall, these effects are negligible if we considerthat û is at most a fraction of a milliradian, so that thecorrections are in the parts per million range . As aconsequence, eq . (22) should be invariant under rotationof the reference frame bringing the undulator axis alongthe electron initial velocity to the first order . The radia-tion pattern law is thus shift-invariant [15) . Explicitly

stated, the radiation pattern described by eq . (22) abovewill depend only on the difference between the observa-tion direction and the initial electron direction . Thisclearly reduces the computational problen, io- a fV ;ir-

dirnensioral space to a much more manageable two-di-mensional space . This result can be considered as aspecial case of the general phase-space (position andangle) shift invariance discussed by Kim in ref . [4) .

Figs . 4-6. Emission patterns (far field) for the undulatorsource at the 1st, 2nd and 3rd harmonics.

Page 7: Modelling of undulator sources

94

A particle beam is characterized by having a con-tinuous distribution of velocities, thus affecting theoverall emission spectrum. We consider the electronbeam to be an incoherent source, so that each electroncan be assumed to radiate independently and the over-all spectral properties will be determined by the sum ofall the individual spectra intensities. This can be stated,for a shift-invariant system, in terms of the convolutionof the one-electron spectra with the angle distributionof the electron trajectories, i .e.,

N(n, hw) = fdv�N(n - ve, hw)F(ve),

(23)

where n is the vector directed to the observer and ve isa unit vector along the electron velocity . In the case ofsmall angles we obtain, in Cartesian units,

N(ox , oy , ho)

= fdax daYN(oX -a. , oy -ay , hw)F(ax , ay),

(24)

--- F represents the angular distribution of the elec-tron trajectory . It is easier to understand this result interms of the (0, w) plots described by eq. (19) . TheGaussian distribution of the electron velocities will in-troduce a broadening of the surfaces of constant phase,thus leading, for example, to a wider range of photonenergies emitted within a given angle . This conclusionhas several impsrtant consequences . First, the photonbeam brightness will be reduced relative to that of acollimated electron beam because of the redirection ofsome of the emission away from the observer position.For a Gaussian beam, the angular standard deviationcan then be obtained by the quadrature of the photonand electron beam standard deviations . Second, thespectrum radiation from a machine with finite emit-tances will apear red-shifted to an observer on-axisbecause the electrons will now be radiating at someangle 0 = ay , thus giving a red shift because of the termY 20 2 in eq. (19) . This is a first-order term because of thelarge value of y . Similar arguments can also be appliedto the case of a,r , leading again to an observational redshift . This is still true for a small pinhole ; however, theflux integrated over a pinhole wide enough to accept thewhole beam will not be modified.

For our case, the key conclusion is to recognize thatthe radiation pattern is shift-invariant, so that we canindeed compute the radiation pattern once and thensimply shift it along the electron velocity to take intoaccount finite electron emittanees .

urce algorithm

The analysis of optical systems in the XUV is bestdone by modelling the source with a Monte Carlo

K Chapman et al. / Modelling ofundulator sources

approach. One of the reasons is that it closely simulatesthe physical behaviour of the source ; for example, theinspection of the cross section of a photon beam at animage plane will give an immediate and vivid image ofthe quality of the focus, similar to what would beobserved if a photographic film were placed at thatposition in a real laboratory experiment . The essentialidea behind these simulations is that the low describingthe frequency of observation of a given variable (prob-ability density function, pdf) is well known, either froma theoretical model or from experimental observation.From the pdf one can then define the probability distri-bution function, PDF (also called cumulative distribu-tion function, CDF):

PDF(x) = fX dx' pdf(x'),

(25)

One can recognize in the pdf a "differential crosssection" for a random process . It is possible to generatefrom a known PDF a distribution of random pointsthat has the required pdf; this is done by generating auniform variate, say within (0, 1) in fig. 7, and theninvert the PDF to obtain the value of x correspondingto it (inversion method). It is easy to convince onese?ffrom fig . 7 that the variate will have a frequency distri-bution equal to the derivative of the PDF, i .e ., the pdf.This method is particularly effective if the analyticaldescription of the PDF is complicated or unknown buta distribution table is available .

Let us consider first the case of a one-dimensionalproblem, such as the integrated spectrum from an undu-lator, N(hw ) . After normalization so that the area is 1,N is clearly the pdf of finding a photon of energy h w.From this the PDF can be computed and a randomvariate with the distribution generated by the inversionmethod . The advantage of this method lies in the fact

ch° "'KTA (-ad)

Fig. 7. Example of random variate generation from a PDFcurve. A uniform random number is generated on the y-axisand inverted to give the required variate x. Lower panel:Vertical emission pattern at 3rd harmonic ; upper panel: associ-

ated PDF.

Page 8: Modelling of undulator sources

K. Chapman et at / Modelling ofundulator sources

0.00 0 .20 0.401 .

D .20

D13:[XRAYOP .UNDUL.FIG91 1]1-BEGIN .DAT ;3

that the PDF needs to be computed only once and theinversion algorithm used is fast and efficient . Thuslengthy calculations of the PDF do not compromise theoverall code efficiency.

The higher dimensionality problems are solved in asimilar way . In the case of the undulator, we computethe emission pattern in the Cartesian angles (o,, oy )over a selected photon energy range . This leads to athree-dimensional array RNO(o, oy , hw), typically(31, 31, 51) in size . We then build two more arraysderived from it. The first is obtained by integrating overo, leading to an array RN1(oY, hw) that contains thenumber of photons emitted at all horizontal angles . We

I EXTERNAL

28-MAR-1988 00:28

1ST HARMONIC

28-MAR-88 010016

H Length 0.1500OL-02H center O.OOOOOE+O()V Length 0.150OOE-0 ~V center O.OOOOOE+00

GOOD ONLY

;JTOT = 5000

1 j LUST =

0

95

Fig. 8 . Undulator emission pattern as generated by SHADOW. Lower panel : Monte Carlo source ; upper panel : theoretical intensitycontour plots (logarithm) .

further integrate over oy to get RN2(hw), the angleintegrated spectrum (i .e., th-- flux) . Working backward,we compute first the PDF of the photon energy,CDF2(hw) . Then the two-dimensional CDFI(oy, hw)is computed, by integrating and normaiizing over oy pereach photon energy . Similarly, the three-dimensional

F®( ax

oy , hw) is then obtained by integrating overo.,, for each (oy , hw) pair. These arrays are stored in abinary file to be read later on by the part of SHADOWthat generates the actual source.

The steps for the generation of the source model (the"photon beam") are the following . A code segmentcalled SGUItCi~ reads in the file, and generates the

Page 9: Modelling of undulator sources

96 K Chapmaneat / Modelling ofundulator sources

0.60 0 .80 1 .00.00

D13:[XRAYOP.UNDUL.FIG911 ] 2-BEGIN .DAT :3

photon energy from CDF2 by the inversion methoddescribed above. Since

thevalue of photon energy is not

likely to correspond exactly to one of the array ele-ments, it will be necessary to interpolate CDFI t)obtain a PDF descnibinng the distnibution. of oy ~*

G36 t44ah ,,t

specific value of hw . The interpolation must take in ;orecount the relative weight of the two distribution .; .This will lead to a one-dimensional array that can beused to generate oy by the inversion method again.After the completion of this step, both oy and hw willhave been fixed. The same procedure of interpolation/inversion is then applied to generate the last variable,o, from CDFO . The photon direction and energy are

H Length 0.15000E-02

H center 0.000OOE400V Length 0.150OOE-02V center O.OOOOOE+00

Fig. 9. Undu!ator enfissi ,3n pattern as generated by SHADOW. Lower panel: Monte Carlo source ; upper panel : theoretical intensitycontour plots (logarithm).

now fully specified . After repeating these steps M, times(with M =1000-5000 in order w create a statisticallysignificant sample) a photon distribution whose pdf isgiven by N(®,, oy, hw) will have been created.

Fi.nally, the ernittances are taken into account bygenerating a binormal variate for the electron positionand direction by means of a transformation algorithm,with the standard deviation given for example by a.,o~, , . Using the shift-invariant properties of the emissionlaw, the angles of the photon obtained above are addedto those of the electron and the process repeated for theother dimension (y). In this way a source that takesinto full account the nature of the electron and photon

Page 10: Modelling of undulator sources

es ts

D13:[XRAYOP .UNDUL.FIG91 1 ] 3-BEGIN .DAT ;2

K Chapman et al. / Modelling of undulator sources

distribution is generated. The code is highly efficient,with the CPU time required to generate a sample of5000 rays being 20 s on a VAX 8600 machine runningVMS.

Using the above procedure, we have generated thesource model for the first, second and third harmonicsof the model undulator described in ref. [9]. The distri-butions show a photon energy range of 10 eV centeredat the relative harmonic. The results are shown in figs .

28-MAR-1988 00 :31

J 3RD HARMONIC

..'Vertical : 6

97

Fig. 10 . Undulator emission pattern as generated by SHADOW . Lower panel: Monte Carlo source ; upper panel : theoretical intensitycontour plots (logarithm) .

8-10 for the case of a no-eminence beam . We- presentalso the intensity level predicted on the basis of eq . (22) .The density of rays represents faithfully the location ofthe maxima in the intensity of the emission pattern. Asexpected, no photons are emitted on-axis for the secondharmonic . It is interesting to notice explicitly the cir-cular symmetry in the emission spectre . Fig. 11 showshow the source is modified by the emmance in theelectron beam ; for the sake of illustration we havemodelled the case of an electron beam having a waistlocated at the center of the undulator and standarddeviations of = 50 p.rad in the velocit-,, distribu-tions. As expected, the radiation distribution is smeared

28 MAR 88 01 - 29 :55

H Length 0 .15')COOE 0211 center 0.00000E+00V Length 0 15000E-02

.. . : .- V center 0.00000F , 00

Page 11: Modelling of undulator sources

98

S. Conclusions

10

08

06

04

02

01

é n

K Chapman et al. / Modelling ofundulatorsources

D13: [ XRAYOP.UNDUL.FIG12]E-BEGIN .DAT;2

=n 11, Effect of beam emittances on the source distribution at the second harmonic. The electron trajectories angle standarddeviations were aX ,(ay , ) = 50 x 10-6 rad.

out relative to the no-emittar,ce case . Fig. 12 shows thew-8 curves generated by the Monte Carlo method .From a computational efficiency point of view,SHADOW uses about 5 ms of CPU per ray on a VAX8600 under VMS; 5000 rays are generated in 25 s .

In summary, we have presented a ne-r approach tothe modelling of the undulator spectra which is accurateand efficient to the point of making possible fast MonteCarlo modelling of the source. A simplified description

Fig . 12 . ®-w plots for the case of zero emittance (upper panel)and for electron angle standard deviations a, -( a, - ) = 2 x 10 - f'

rad (lower panel) .

28-MAR-1988 00 .36

2ND WITH EMITTANCE

of the magnetic field, together with a judicious changein the variable of integration, leads to a greatly sim-plified mathematical problem that can be solved by asimple integration . The trajectory thus computed is thenused as input to a code segment for the computation ofthe radiation distribution . The use of far-field ap-proximation in combination with the assumption of aperiodic structure allows the calculations to be per-formed only over a single period of the magnetic field .Most importantly, we have shown the undulator systemto be shift-invariant relative to the electron trajectoryand radiation emission angles . This cuts in half thedimensionality of the problem, allowing excellent com-putational efficiency as well as physical insight into thebehavior and mechanism of the undulator. All the theo-retical considerations lead to the construction of a veryefficient algorithm for the generation of the MonteCarlo source describing the radiation. This new codeopens finally the possibility of accurate ray tracingsthrough optical systems based on undulator sources .More work needs to be performed in the area of polari-zation of the source and in the extension to the case of

�d:c ,.ttetv,rtáat~t.mataet, III+rf ~ .

Aclcnowledgernents

This work was supported in part by the Departmentof Energy as part of the Advanced Light Source project,in part under a subcontract from the Department ofDefense, Air Force Office of Scientific Research undercontract F49620-87-1{-0001 from the Center for X-Ray

28-MAR-88 00:44 :21

H Length 0.15000E-02

H center 0 .00000E+00

V Length 0.15000E-02V center 0.00000E+00

EXTERNAL

--GOOD ONLY

TOT = 5000

LOST = 0

Horizontal : 4

Vertical : 6

Page 12: Modelling of undulator sources

Optics . One of us (J.V .) was supported by the USDepartment of Energy, BES-Materials Sciences, undercontract no . W-31-109-ENG-38 . We are pleased to ac-knowledge discussions with M.K . Green (SynchrotronRadiation Center, University of Wisconsin), A. Luccio(Brookhaven National Laboratory), C. De Boor (Uni-versity of Wisconsin, Madison), G.K . Shenoy (Ad-vanced Photon Source, Argonne National Laboratory) .

Note added in proof

After submission of this article we have becomeaware of another effort in progress at the University ofTexas at Austin. D.C . Anacker, W. Hale and J.L . Erskinehave developed a source model for SHADOW thattakes in full account the emission properties of theundulator. The code, based on an acceptance-rejectionmethod, provides an accurate model of the source andcan be used as an alternative to the one described in thepresent article. Another important contribution to thetheory of undulator emission is found in the articleby H. Rarback, C. Jacobsen, J . Kirz and I . McNulty,[Nucl . Instr . and Meth. A266 (1988) 96] where thered-shift caused by the finite electron emission is dis-cussed .

K Chapman et al. / Modelling of undulator sources

References

99

[1] Cf . SRI 1987, Nucl. Instr. and Meth . A266 (1488? .[2] K. Halbach, SPIE 582 (1985) 68 .[3] S. Krinsky, M.L . Peilman and R.E. Watson, in : Handboot.

on Synchrotron Radiation, ed. E.E. Koch (North-Holland,Amsterdam, 1983) pp. 65ff.

[4] K.J . Kim, SPIE 582 (1985) 2;see also Nucl . Instr. and Meth . A246 (1986) 71 .

[5] B. Lai, K. Chapman and F. Cerrina, Nucl . Instr. andMeth . A246 (1988) 544.

[6j Y. Hirai, A. Luccio and L. Yu, J. Appl . Phys . 55 (1984)25 .

[7] A. Luccio, private communication.[8] R.Y . Rubinstein, Simulation and the Monte Carlo Method

(Wiley, New York, 1981).[9] R. Tatchyn, A.D . Cox and S. Qadri, SPIE 582 (1985) 47 .

[10] G.K. Green, Brookhaven National Lab. Report BNL50522.

[11] D. Marcuse, Light Transmission Optics (Van Nostrand,New York, 1982) pp . 82-124.

[12] J.D . Jackson, Classical Electrodynamics (Wiley, NewYork, 1975) pp. 654ff.

[13] J.M . Cowley, Diffraction Physics (North-Holland,Amsterdam, 1975).

[14] B.M. Kincaid, SPIE Proc. 582 (1985) 72 .[15] A. Papoulis, Systems and Transforms (McGraw-HI11, New

York, 1968) pp . 234 ff.