nps    = 1000;     # Number of particles
mm     = 1e-3;     # difinition unit [mm]
radius =0.5*mm;    # beam radius

Qtot=-0.02e-9;      # total charge
Eo=100e3;          # initial beam energy [eV]
G=1-q*Eo/(m*c*c);  # Gamma
GB=sqrt(G^2-1);    # Momentum/(m0 c)

# ------------- initial particle ------------------------------
setparticles  ("beam", nps,me,qe,Qtot);
setzdist      ("beam", "u", 100*mm, 10*mm);
setrxydist    ("beam", "u", radius/2, radius);
setphidist    ("beam", "u", 0,2*pi);
setGBzdist    ("beam", "u", GB,0);
setGBthetadist("beam", "u", 0,0);
setGBphidist  ("beam", "u", 0,0);


# ----------- simulation control  -----------------------------
spacecharge3Dmesh();
dtmax = 0.001e-9;
rmax("wcs", "z", 300*mm, 1*mm, 200*mm);
screen("wcs", "I",0.5*mm,500*mm,2*mm);
remove_par_file("wcs", "I", "remove_par.txt");