Hi, Michael, I adjusted the beam line as follows:michael_borland wrote:The root of all the problems is that the beam is not upright in phase space at the entrance to the RCOL element. This causes the computations to fail because it violates one of the assumptions of the pepper pot method. When the calculation produces an invalid value (square root of a negative number) that subsequently generates the error about too few items on the stack.
You put alpha_x=0 and alpha_y=0 in the &bunched_beam command, but that controls the beam parameters at the start of the simulation, not at the entrance to the pepper pot plate. Look at the before.out file and you'll see that the beam is a tilted stripe in (x, x') and (y, y') phase space. The pepper pot method won't work in this case. If you tune the two quadrupoles to give the required conditions alpha_x=0 and alpha_y=0 at the entrance to the RCOL element, it should all work fine.
As for before.out and before.sig being too large to upload: you inserted two WATCH elements (W1 and W2) into the lattice. In the default mode, they dump the coordinates of all the particles that they see into the named files (before.out and before.sig, respectively). I suspect you don't want that, particularly since the two files will contain exactly the same data. Consult the manual to see proper use of the WATCH element.
--Michael
Code: Select all
ec: ecol,x_max=0.8e-5,y_max=0.8e-5,l=1.5e-4
q1: quad,l=0.1,k1=4.5
d0: drift,l=0.5
d1: drift,l=0.7
d2: drift,l=0.7
bl: line=(ec,d1)
Code: Select all
&run_setup
lattice = lattice.lte
use_beamline="bl"
p_central_mev = 400
output = %s.out
final = %s.fin
&end
&run_control
n_indices = 2
&end
&vary_element name=EC, item=DX, initial=-3.75e-3, final=3.75e-3, index_number=0, index_limit=11 &end
&vary_element name=EC, item=DY, initial=-3.75e-3, final=3.75e-3, index_number=1, index_limit=11 &end
&bunched_beam
n_particles_per_bunch = 10000000
one_random_bunch = 1
beta_x = 5.0e-3
beta_y = 5.0e-3
emit_x = 1.25e-9
emit_y = 1.25e-9
alpha_x=0
alpha_y=0
distribution_type[0] = 2*"gaussian"
distribution_cutoff[0] = 2*3
&end
&track &end
error: squre root of negative number
*stop*
too few items on stack(divide)
*stop*
Error for G:\SDDS Toolkit \sddsprocess.exe:
unable to compute rpn expression-- rpn error (SDDS_ComputerDefinedColumn)