
Step V  Timedependent SimulationTo enable timedependence simply set ITDP to one. In addition IALL should be zero, SHOTNOISE 1.0 and PRAD0 zero for SASE simulations. The startup regime has typically modes with strong diffraction. Therefore it is recommended to increase the grid size RMAX0 or DGRID by roughly 50100%. To compensate the coarser grid NCAR can be increased as well. The desired timewindow requires some minor calculations. For easier calculation 'time' is scaled by the speed of light (s=ct). Assuming a timewindow, which starts at the tail s_{0} and ends at the head s_{1} the required number of slices is NSLICE = (s_{1}s_{0})/(ZSEP*XLAMDS). The first slice has the position s_{0}. Therefore NTAIL is s_{0}/(ZSEP*XLAMDS). Note that in the frame of GENESIS 1.3 s_{0} has to be smaller than s_{1}. The parameter IOTAIL is an indication for GENESIS 1.3 whether radiation is generated outside the timewindow but might slip at s_{0} into the timewindow while the beam propagates through the undulator. This is the case if only a subsection of the electron beam is simulated. Because GENESIS 1.3 can do only a wild guess about the radiation field which slips into the timewindow the tail part of the timewindow is physically incorrect. To exclude these slices in the output IOTAIL should be set to zero. The number of suppressed slices is simply the number of undulator periods of the entire undulator divided by ZSEP. As an example we assume a Gaussian beam profile with an rms length of 1 mm (CURLEN = 1.e3) and a radiation wavelength of 5 m for an undulator with 200 periods. The spacing between the slices is ZSEP=2.0. The output should be between 2 mm and 2 mm which cuts out a part of the bunch (IOTAIL=0). The total number of slices is 400 slice of output plus 100 suppressed slices (=500). The first simulated slices is NTAIL=300 which is equivalent to s_{0}=3mm. In this example the timewindow is actually very close to cover the entire beam. With s_{0}=3 mm the local beam current is only 1% of the peak current. It is a good assumption that the tail s<s_{0} will not significantly amplify any radiation. With only 100 more slices the entire bunch can be simulated. The parameters would be now: NSLICE=600, NTAIL=300 and IOTAIL=1. 