Twiss failure and tracking errors using cell-by-cell TWLA with solenoids

Moderators: cyao, michael_borland

Post Reply
amal
Posts: 19
Joined: 04 May 2011, 23:30

Twiss failure and tracking errors using cell-by-cell TWLA with solenoids

Post by amal » 15 May 2026, 00:18

Hello,

I am new in Linac simulation using Elegant, and I am facing difficulty in the simulation of TW linac. I am attempting to model first two sections of an electron Linac in Elegant to obtain Twiss parameters and perform beam tracking.

The setup is following:
(1) Sub-harmonic buncher: 499.75 MHz.
(2) Section-1 (TW): 8 buncher cells (tapered length from 18.33 to 29.994 mm) followed by 60 accelerating TW-CI cells.
(3) Section-2 (TW): 114 TW-CG cells.
(4) External solenoid fields are superimposed on the structures.

Modelling approach:
Each cell is modelled as individual TWLA element to accommodate the local solenoid field value.
For the 8 buncher cells, phase is computed as following:
- Cell length are matched to 2.pi/3 mode with an increasing beta profile. Difference in beta in adjacent cells provides energy gain.
- Required phase is derived from the energy gain using sin^-1(Energy-gain/(EzT * gap)).
- Phase continuity is maintained by subtracting the phase slip 2.pi.L/(beta.Lambda) at each cell.

Issues encountered:
(1) Twiss computation failure. NaN for beta, alpha.
(2) Tracking issue: I receive error: missing beam sums pointer (finish_output).
(3) I tried with FOCUSSING=0 or 1, with particles from outside file, and also particles generated by Elegant itself using bunched_beam.

How to perform the optics (beam envelope and Twiss) computation correctly, and then beam tracking? Theses sections are stable and run finely on other codes.

Attached files: linac_2_sections.lte; LINAC_2_SECTIONS_INPUT.ele; beam_initial.sdds

Please help me in this matter, if I am modelling sections incorrectly or my phase computation method requires correction?

Thanks and regards,
Amal
Attachments
LINAC_2_SECTIONS_INPUT.ele
(1.39 KiB) Downloaded 7 times
linac_2_sections.lte
(35.61 KiB) Downloaded 6 times
beam_initial.sdds
(1.33 MiB) Downloaded 7 times

michael_borland
Posts: 2050
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Twiss failure and tracking errors using cell-by-cell TWLA with solenoids

Post by michael_borland » 15 May 2026, 13:54

Amal,

The main problem is that the TWLA elements are not set up using phase references. If you break a structure into cells, you should use a phase reference to ensure consistent phasing. See the attached file.

Even after fixing that, there are problems finding the matrices of the TWLAs, which prevents computations with &twiss_output and &moments_output. I'm still looking into that. However, I was able to optimize transmission of the beam using tracking. See the second attached file.

--Michael
Attachments
transmissionOpt.tar.gz
(10.61 MiB) Downloaded 8 times
linac_2_sections.lte
(43.66 KiB) Downloaded 7 times

amal
Posts: 19
Joined: 04 May 2011, 23:30

Re: Twiss failure and tracking errors using cell-by-cell TWLA with solenoids

Post by amal » 16 May 2026, 10:44

Michael

Thank you very much for your reply and clarifying about the phase reference. Tracking is now working with optimized files.

Regards,
Amal.

Post Reply