Skip to content

Region definition

This page details the sections of Region Editor panel that lets you define magnetic regions. Read this to understand the meaning of the textbox values:

Beam geometry

This section defines the location and direction of the beam. Please note that units in SynRad are in centimeters and radians.

Beam start position

The X,Y,Z coordinates of the first point of the beam, ie. where the beam enters the system. Subsequent points will be calculated based on the magnetic field.

Beam start direction

The velocity (direction) vector of the beam in the first point. It will be normalized, so its length has no significance. You can define it by Vx,Vy,Vz coordinates, or by angles. The meaning of angles and the conversion is done the following way:

  • Theta [-PI..PI]: angle with Z axis in XZ plane, positive if X<0

  • Alpha [-PI/2..PI/2]: angle with XZ plane, positive if Y<0

Conversions

X=cos(alpha)*sin(-theta)  
Y=sin(-alpha)  
Z=cos(alpha)*cos(theta)

and

theta0=-atan(Dir.x/Dir.z) [if Dir.z!=0]  //(as the atan funcion is periodic, for angles outside -PI..PI, a period correction is performed)
alpha0=-asin(|Dir|.y)

Trajectory step lentgh

The trajectory will consist of N calculated points situated dL distance from each other.

The calculation algorithm assumes that the trajectory is straight for dL distance, after which it determines the local magnetic field and calculates the new direction.

For strong magnetic fields (sharp curves) you should define a small value, otherwise you can set it higher.

The maximum number of trajectory points is 1 million. Having too many points will result in more memory usage but won't affect simulation speed.

Calculation boundary

The trajectory will be calculated starting from the 'Beam start position' defined above.

Calculation stops when either the X, Y or Z coordinate reaches the Xmax, Ymax, Zmax value. (If, for example, Xmax is smaller than X0, then calculation will stop when the X coordinate of the trajectory is equal or less than Xmax. If Xmax is larger then X0, calculation stops when the trajectory's X coordinate is equal or larger than Xmax.) If these limits are never reached, calculation stops when the maximum number of trajectory points (1 million) is reached.

Additional beam parameters section

Ideal beam checkbox

If the beam is ideal, its emittance will be 0. That is, photons will be generated on the trajectory (without any offset), and their direction will be tangent to the trajectory

Non-ideal beam (with constant values)

The emittance, betaX,betaY,Eta,EtaPrime,Coupling and energy spread parameters define how the beam has a nonzero thickness and divergence. That is, each generated photon will have a start loaction offset (perpendicular to the beam direction), and a start direction offset (offset angles relative to the tangent vector).

These offsets are calculated by the following:

where dE/E is the energy spread and coupling is the horizontal/vertical beam coupling.

Or by pseudo code:

EmittanceX=Emittance/(1+Coupling)EmittanceY=EmittanceX*Coupling

sigmaX=sqrt(EmittanceX*BetaX+Sqr(Eta*Energy_spread))            { hor lattice-dependent beam dimension, cm }
sigmay=sqrt(EmittanceY*BetaY)                                   { same for vertical, cm }
sigmaXprime=sqrt(EmittanceX/BetaX+Sqr(EtaPrime*Energy_spread))  { hor lattice-dependent divergence, radians }
sigmaYprime=sqrt(EmittanceY/BetaY)                              { same for vertical divergence, radians }</pre>

x_offset=Gaussian(sigmaX)                                       {starting point X offset, gaussian distribution with SigmaX st.dev.}
y_offset=Gaussian(sigmaY)                                       {starting point Y offset, gaussian distribution with SigmaY st.dev.}divx_offset=Gaussian(sigmaXprime)                               {starting direction alpha offset, gaussian distribution with sigmaXprime st.dev.}
divy_offset=Gaussian(sigmaYprime)                               {starting direction theta offset, gaussian distribution with sigmaYprime st.dev.}

Watch out for units: all quantities containing distances (Emittance, BetaX, BetaY and EtaX) are in centimeters, whereas EtaXprime is dimensionless. The coupling is in percents.

Non-ideal beam (BXY file)

The BetaX, BetaY, Eta, EtaPrime and Energy-Spread parameters above can vary with the coordinates. In such a scenario, use a BXY file.

Photon generation

Generated photon energy

Spectrum plotting, etc. require a scale of energy values that generated photons can have. You can limit this range between two values

Polarization mode

If you want to see two different results for parallel-only or orthogonal-only polarizations, uncheck one of the toggles.

Limit photon divergence

If, for some reason, you want to limit the maximum divergence angles, set a value here, and photons with larger angles will be omitted

Magnetic field

Define the magnetic field here, independently for the Bx, By, Bz components. Either use constant values (in Tesla), or choose one of the seven magnetic modes and a MAG file.


Last update: January 12, 2024