tag:blogger.com,1999:blog-53477416599929552352018-03-05T07:34:59.957-08:00Light Source PhysicsBoazhttp://www.blogger.com/profile/06155550486435568853noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5347741659992955235.post-86100493007837845462018-01-25T15:41:00.004-08:002018-01-25T17:38:13.806-08:00Beamline modelingMy last post was about codes for modeling electron beams and x-rays. As of recently, there is now a new tool for beamline modeling. Its called Sirepo.<br /><a href="http://beta.sirepo.com/">beta.sirepo.com</a><br /><a href="https://beta.sirepo.com/srw#">https://beta.sirepo.com/srw#</a><br /><br />One can model many different beamlines with this code.<br /><br />Here are the beamlines at the ALS, for example<br /><a href="https://als.lbl.gov/beamlines/">https://als.lbl.gov/beamlines/ </a><br /><br />Here are the beamlines at the NSLS-II<br /><a href="https://www.bnl.gov/ps/beamlines/">https://www.bnl.gov/ps/beamlines/ </a><br /><br />Here are the beamlines at the APS<br />https://www.aps.anl.gov/Beamlines Boazhttp://www.blogger.com/profile/06155550486435568853noreply@blogger.com0tag:blogger.com,1999:blog-5347741659992955235.post-27921572403040498912011-11-12T09:27:00.001-08:002016-01-04T03:35:03.333-08:00Codes for electrons and photonsThe x-rays in a synchrotron are produced by high energy electrons traversing magnetic fields. The main devices that produce the magnetic fields are undulators or wigglers.<br /><br />To model this process, therefore, first one needs to model the electrons in the ring, and to have a good model of the fields in the ring. This is the purpose of a tracking code. I focus on the code <a href="http://sourceforge.net/apps/mediawiki/atcollab/index.php?title=Main_Page">AT</a>, since I have experience, and the elements representing the physics are easily accesible and available, so that one knows where to look if there are problems or questions.<br /><br />To really know all the fields in the ring that act back on the electron beam, one must do measurements and modelling of the elements. For the insertion devices, there is the Mathematica based code <a href="http://www.esrf.eu/Accelerators/Groups/InsertionDevices/Software/Radia">Radia</a>, which allows one to build an insertion device and compute the fields. One can also compute the kick map which will act on the electrons and can reduce the dynamic aperture and lifetime, particularly for narrow pole-width insertion devices.<br /><br />Next, one needs to compute the radiation that will result from the electrons. For this, the code <a href="http://www.esrf.eu/Accelerators/Groups/InsertionDevices/Software/SRW">SRW</a> is quite accurate and state-of the art. Next, one should model how this radiation can progress down the beam-line. For this purpose, the code <a href="http://www.esrf.eu/computing/scientific/raytracing/">Shadow</a> is well developed.<br /><br />In modeling both the electron beam dynamics and the radiation effects from <a href="http://en.wikipedia.org/wiki/Undulator">undulators</a>, one needs to have a model for the magnetic field of a given undulator. The field may be computed using a code such as Radia. But there are also representations of the field in terms of harmonics such as the Halbach representation.<a href="http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&ved=0CCoQFjAC&url=http%3A%2F%2Fwww.osti.gov%2Fbridge%2Fservlets%2Fpurl%2F7368543-cohXJr%2F&ei=qW7rTrjwGMW3hAf8xf2_CA&usg=AFQjCNGnQSuSfKpUDahiU9fJrZnBSr1GqQ"> Here</a>'s a description of the symplectic integration routine for an analytical representation from Forest. One may also represent it via a <a href="http://bnash.wikidot.com/at-kickmaps">kick map</a>. The latter two representations serve the purpose of the tracking of electrons for the purpose of tracking to determine dynamic aperture. Given the electron orbit, one can compute the radiation emitted. This can be done with e.g. <a href="http://www.esrf.eu/Accelerators/Groups/InsertionDevices/Software/SRW">SRW.</a>Boazhttp://www.blogger.com/profile/06155550486435568853noreply@blogger.com0tag:blogger.com,1999:blog-5347741659992955235.post-20999442787957050792011-09-15T04:42:00.000-07:002016-01-04T03:36:16.287-08:00Properties of electron and photon beams<a href="http://1.bp.blogspot.com/-p6YGhHod5MY/TqHeHFrpd_I/AAAAAAAAAFc/94g9xfi_9T0/s1600/beamsize.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5666054019574495218" src="http://1.bp.blogspot.com/-p6YGhHod5MY/TqHeHFrpd_I/AAAAAAAAAFc/94g9xfi_9T0/s320/beamsize.png" style="cursor: hand; cursor: pointer; display: block; height: 180px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><br /><br /><br />Once one knows the electron beam properties, then one can calculate the radiation properties.<br />What are the basics? What photon beam is produced by a given electron beam as it goes through a <a href="http://en.wikipedia.org/wiki/Dipole_magnet">bending magnet</a> or <a href="http://en.wikipedia.org/wiki/Undulator">undulator</a>?<br />One computes the brightness via the Wigner function. Does this give the beam sizes also? The single electron brightness needs to be convolved with the beam distribution.<br /><br />The basic result is that the photon beam sizes and divergences come from the electron beam sizes and divergence and the single electron radiation size and divergence added in quadrature.<br /><br /><a href="http://www.codecogs.com/eqnedit.php?latex=%5CSigma_x%5E2=%5Csigma_%7Bx,b%7D%5E2%20@plus;%5Csigma_%7Bx,e%7D%5E2" target="_blank"><img src="http://latex.codecogs.com/gif.latex?%5CSigma_x%5E2=%5Csigma_%7Bx,b%7D%5E2%20+%5Csigma_%7Bx,e%7D%5E2" title="\Sigma_x^2=\sigma_{x,b}^2 +\sigma_{x,e}^2" /></a><br /><br />The beam sizes thus depend on the frequency and also which harmonic for an undulator.<br /><a href="http://scripts.iucr.org/cgi-bin/paper?ie5029">Here</a> is the paper by Tanaka and Kitamura describing the impact of energy spread on the photon beam sizes.<br /><br />The horizontal beam size and divergence are given by:<br /><span style="font-family: serif; font-size: 1em;"><math><mstyle fontfamily="serif"><mrow><msub><mi>σ</mi><mi>x</mi></msub></mrow><mo>=</mo><msqrt><mrow><mrow><msub><mi>ε</mi><mi>x</mi></msub></mrow><mrow><msub><mi>β</mi><mi>x</mi></msub></mrow><mo>+</mo><mrow><msubsup><mi>η</mi><mi>x</mi><mn>2</mn></msubsup></mrow><mrow><msubsup><mi>σ</mi><mrow><mi>δ</mi></mrow><mn>2</mn></msubsup></mrow></mrow></msqrt></mstyle></math></span><br /><span style="font-family: serif; font-size: 1em;"><math><mstyle fontfamily="serif"><mrow><msub><mi>σ</mi><mrow><mi>x</mi><mo>ʹ</mo></mrow></msub></mrow><mo>=</mo><msqrt><mrow><mfrac><mrow><mrow><msub><mi>ε</mi><mi>x</mi></msub></mrow></mrow><mrow><mrow><msub><mi>β</mi><mi>x</mi></msub></mrow></mrow></mfrac><mo>+</mo><mrow><msubsup><mi>η</mi><mrow><mi>x</mi><mo>ʹ</mo></mrow><mn>2</mn></msubsup></mrow><mrow><msubsup><mi>σ</mi><mrow><mi>δ</mi></mrow><mn>2</mn></msubsup></mrow></mrow></msqrt></mstyle></math></span><br /><br />To understand this, we need to understand the emittances and the Twiss parameters and the dispersion.<br /><br />The same equations apply to the bunch length and energy spread. The longitudinal beta function is given to first order by<br /><span style="font-family: serif; font-size: 1em;"><math><mstyle fontfamily="serif"><mrow><msub><mi>β</mi><mi>z</mi></msub></mrow><mo>=</mo><mfrac><mrow><mi>C</mi><mrow><msub><mi>α</mi><mi>c</mi></msub></mrow></mrow><mrow><mrow><msub><mi>μ</mi><mi>s</mi></msub></mrow></mrow></mfrac></mstyle></math></span><br />with <span style="font-family: serif; font-size: 1em;"><math><mstyle fontfamily="serif"><mrow><msub><mi>α</mi><mi>c</mi></msub></mrow></mstyle></math></span> the momentum compaction factor and <span style="font-family: serif; font-size: 1em;"><math><mstyle fontfamily="serif"><mrow><msub><mi>μ</mi><mi>s</mi></msub></mrow></mstyle></math></span> equal to <span style="font-family: serif; font-size: 1em;"><math><mstyle fontfamily="serif"><mn>2</mn><mi>p</mi><mi>i</mi><mrow><msub><mi>ν</mi><mi>s</mi></msub></mrow></mstyle></math></span>.<br /><br />For ESRF these are available <a href="http://www.esrf.eu/Accelerators/Performance">here</a>. A good reference is this<a href="http://www.slac.stanford.edu/pubs/slacreports/slac-r-121.html"> article by M. Sands</a>.<br /><br />The x-rays produced in synchrotrons are used in a variety of experiments. The production of the radiation depends on the properties of the electron beam.<br /><br />One should calculate the power radiated. One should understand <a href="http://en.wikipedia.org/wiki/Photon_polarization">polarization</a>. One should understand <a href="http://en.wikipedia.org/wiki/Coherence_%28physics%29">coherence</a>. Then there are the standard things people compute and use to compare sources:<br /><a href="http://en.wikipedia.org/wiki/Spectral_radiance">brightness</a> (or brilliance) and <a href="http://en.wikipedia.org/wiki/Spectral_flux_density">flux</a>.<br /><br />As emittance decreases for storage ring light sources, one claimed benefit is in the coherence of the resulting light. And indeed, the claimed benefit for FEL based light sources is also with respect to coherence (among other properties).<br /><br /><br />The <a href="http://www.citeulike.org/user/yellowkumquat/article/10468763">paper by Geloni et. al.</a> examines this issue. The <a href="http://prst-ab.aps.org/accepted/Z/2e079MeeZ281950550c64b48e47c97c5c69a1b5b2">recent paper by Bazarov</a> (<a href="http://arxiv.org/abs/1112.4047">on arxiv</a>) also explores this issue and has computations of the Wigner function out of undulators.<br /><br />The electron beam loses electrons over time. <br /><br />The lifetime itself may be divided into two pieces, a vacuum lifetime and a Touschek lifetime. <br /><br />The vacuum lifetime is result of the scattering process of electrons off of the gas molecules in the beam pipe. The Touschek lifetime is the result of the scattering of electrons off of each other.<br /><br />The bunch length may be measured with a <a href="http://en.wikipedia.org/wiki/Streak_camera">streak camera</a>. Its value depends on the current and is given by solving the Haissinski equation, below the microwave instability.<br />The vertical emittance may be measured.<br />The energy acceptance is challenging. It may be given by the RF acceptance or by the dynamic acceptance. Computing this quantity is the work of a tracking code.<br /><br />In AT, one uses the function atcalc_TouschekPM.<br /><a href="http://1.bp.blogspot.com/--zMxRqWO4_I/TqHdV1aCZXI/AAAAAAAAAFQ/ZNYcCCKh_vg/s1600/pspace.jpeg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5666053173392074098" src="http://1.bp.blogspot.com/--zMxRqWO4_I/TqHdV1aCZXI/AAAAAAAAAFQ/ZNYcCCKh_vg/s320/pspace.jpeg" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 224px;" /></a><br />So, the basic mechanism of the synchrotron light source involve highly relativistic electrons moving through magnetic fields. What happens?<br />Well, we have dipole magnets that bend the electrons, and basically create the circular trajectory. Then we have quadrupole magnets for focusing, sextupole magnets for chromatic effects and other stability issues. To better understand, and control the electrons, we also need to model them.<br />Since there are lots of magnets, one needs a code to do this. Here, there's some nice aspects and some messes.<br /><br />Basically, the equations of motion are given by the Lorentz force law. Newton's laws give a differential equation that needs to be integrated to get the orbit. So one needs a code that can integrate through the magnets. There are conserved quantities, and the motion is symplectic. So one needs a symplectic integrator in order to not lose precision over time.<br /><br />A <a href="http://en.wikipedia.org/wiki/Symplectic_integrator">symplectic integrator</a> comes in different orders. To get good results, one usually needs at least fourth order. One needs this together with flexible ways to define the magnetic fields. One code that can do this is the Matlab based code called AT- Accelerator Toolbox. An attempt at an open source collaboration is <a href="http://sourceforge.net/apps/mediawiki/atcollab/index.php?title=Main_Page">here</a>. The underlying integrators are coded in C, which can be compiled as Mex files, and the definition of the fields to create the ring is done with Matlab.<br /><br />Non-linear dynamics is mainly relevant for injection efficiency and Touschek lifetime.<br />One may also want to optimize parameters to improve the non-linear dynamics. One example is the tune shift with amplitude.<br />For the case of sextupoles distributed around a synchrotron, the general result is<br /><a href="http://2.bp.blogspot.com/-dNtXa9NIbpg/TplHXQWV27I/AAAAAAAAAE4/B8nGfy6lo_c/s1600/dndJ.png"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5663636471246347186" src="http://2.bp.blogspot.com/-dNtXa9NIbpg/TplHXQWV27I/AAAAAAAAAE4/B8nGfy6lo_c/s320/dndJ.png" style="cursor: hand; cursor: pointer; display: block; height: 273px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><br />In terms of an efficient algorithm, one may compute this as:<br />Thsi = sindex(s); <br /><pre> ti = sindex(t);<br /> b = b3vals(s)*b3vals(t);<br /> c = sqrt(bx(si)*bx(ti));<br /> <br /> cx = cos(abs(mux(si) - mux(ti)) - muxT);<br /> c3x= cos(3*(abs(mux(si) - mux(ti)) - muxT));<br /> cxp2z = cos(abs(mux(si) - mux(ti)) + 2*abs((muz(si)-muz(ti))) - (muxT + 2* muzT));<br /> cxm2z = cos(abs(mux(si) - mux(ti)) - 2*abs((muz(si)-muz(ti))) - (muxT - 2* muzT));<br /> <br /> xdx = xdx + b * c ^ 3 * (3*cx/sx + c3x/s3x);<br /> xdz = xdz + b * c * bz(si) * (-4 * bx(ti) * cx / sx + 2 * bz(ti) * cxp2z / sxp2z - 2 * bz(ti) * cxm2z / sxm2z);<br /> zdz = zdz + b * c * bz(si) * bz(ti) * (4 * cx / sx + cxp2z / sxp2z + cxm2z / sxm2z);<br /></pre><br /><br />Boazhttp://www.blogger.com/profile/06155550486435568853noreply@blogger.com0tag:blogger.com,1999:blog-5347741659992955235.post-82063396663559182112010-12-12T23:31:00.000-08:002012-11-30T03:52:03.887-08:00PurposeThere are many sources of light in the world. What do we usually think of when we ask where light comes from? One obvious answer is <a href="http://en.wikipedia.org/wiki/Sun">the sun</a>! Another answer is a <a href="http://en.wikipedia.org/wiki/Incandescent_light_bulb">light bulb</a>! A third, very common source of light these days is a computer monitor or television screen, often using an <a href="http://en.wikipedia.org/wiki/LCD_monitors">LCD screen</a>. A fourth, less common, but beautiful source of light is from some living creatures, in the form of <a href="http://en.wikipedia.org/wiki/Bioluminescence">bioluminescence</a>. Yet another source of light, which is perhaps less well known to the public, but well appreciated by scientists is the so-called <a href="http://en.wikipedia.org/wiki/Synchrotron_light_source">synchrotron light sources</a>. These large scientific complexes produce x-rays that and are used in a variety of methods to help understand the nature and structure of many different things.<br /><br />Now, physical theory says that light is a travelling electromagnetic field. In the classical theory, these fields satisfy Maxwell's equations. A quantum picture shows light as a stream of photons, particles whose energy is related to their wavelength by E=h nu.<br /><br />What about the processes that create the light to begin with? In the sun, the matter moves very quickly- at a high temperature- and the light is produced in these collisions, creating <a href="http://en.wikipedia.org/wiki/Blackbody_radiation">blackbody radiation</a>, with the surface temperature being around 5800 K. A light bulb is essentially a hot filament of metal, radiating as well as a sort of blackbody radiator. In the case of bioluminescence, the light comes an electron changing energy levels in a molecule in the organism. Finally, the light from the synchrotron light source comes from high energy electrons bending in a magnetic field.<br /><br />In each case, the properties of the light depend on the properties of the source. The light from the sun depends on the temperature of the sun for its spectrum, and on the size and distance of the size for its spatial and angular extent. For a light bulb, it depends on the power emitted from the bulb, the material of the filament, and the size and shape of the bulb. For bioluminescence, it depends on the molecules involved which determines the spectrum, and the amount and distribution of that molecule which determines the spatial extent. Finally, in the case of the synchrotron light source, the properties depend on the energy and trajectory of the electrons for determining the spectrum, and the density and distribution of the electrons to determine the spatial and angular extent of the resulting light.<br /><br />The topic of synchrotron radiation from high energy electrons in storage rings is not so well known to the public, nor in fact to most scientists who use the radiation in their experiements. It developed as an off-shoot to particle physics. In order to understand the electron beam that is radiating, one needs to know about how the electron beam got there in the first place, and what sets the properties of the electron beam. The former topic is the topic of <a href="http://en.wikipedia.org/wiki/Accelerator_physics">accelerator physics</a>. It typically covers hardware as well as beam dynamics.<br /><br />This blog will focus on the physics of synchrotron light sources after the acceleration has already occured. The electrons still need to be maintained- or stored- in the large ring. And the x-rays produced need to be guided and focussed towards the experiements. Thus, we will cover some basics of the physics of electron beams in synchrotrons and photon beams following emission. And maybe some generalities on the light emission process that is relevant to many situations where light is produced. In other words, we situate the physics of synchrotron radiation in storage rings within the broader topic of "light source physics".<br />Some topics:<br />Theoretical ways of modeling an electron beam.<br />Theoretical ways of modeling a light beam.<br />Software for analyzing electron beam.<br />Software for analyzing light beam.<br />Useful properties of photon beams, and their connection to the electron beam.<br />Ways of measuring electron beams.<br />Ways of measuring light beams.Boazhttp://www.blogger.com/profile/06155550486435568853noreply@blogger.com0