Twiss failure and tracking errors using cell-by-cell TWLA with solenoids
Posted: 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
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