Page 1 of 1
Phase advance calculation bug
Posted: Mon 18 May 2026 20:49
by jyosk001
Dear Didier,
For some reason, the phase advance charts for my linac do not seem to plot past z=57 m correctly. It might have something to with a ~short transport section that starts around there, but I'm not sure. What do you think is going on?
I have attached the phase advance plots below. I will send you my TraceWin project files separately.
Thanks,
Josh Y.

- k0 vs position
- k0_vs_Position.png (1.49 MiB) Viewed 2252 times

- sigma vs position
- sigma_vs_Position.png (1.6 MiB) Viewed 2252 times
Re: Phase advance calculation bug
Posted: Tue 19 May 2026 12:37
by Didier
Dear Josh,
Using your file I got following plots, that seems correct !
Regards,
Didier

- sig.png (56.46 KiB) Viewed 2234 times

- ko.png (58.78 KiB) Viewed 2234 times
Re: Phase advance calculation bug
Posted: Tue 19 May 2026 16:11
by jyosk001
Hi Didier,
I'm not sure how you got those charts. When I try to plot the deg/m phase advances (abscissa=meter, ordinate=meter, phase advance = structure or beam), I get the following plots. I've also attached the associated ascii files. Did you modify the files in some way to get them to plot correctly?
Thanks,
Josh

- k0m_vs_Position.png (1.45 MiB) Viewed 2231 times

- sigmam_vs_Position.png (1.18 MiB) Viewed 2231 times
Re: Phase advance calculation bug
Posted: Tue 19 May 2026 16:27
by Didier
Dear Josh,
No I change nothing, please try to reload the code, perhaps I made some corrections without changing the version number and lets me know
Regards,
Didier
Re: Phase advance calculation bug
Posted: Tue 19 May 2026 16:35
by jyosk001
Dear Didier,
I tried deleting and redownloading the Tracewin.exe file...I guess it got corrupted somehow. I get the correct plots now.
Thanks!
Josh
Re: Phase advance calculation bug
Posted: Thu 21 May 2026 19:33
by jyosk001
Hi Didier,
One other thing: I was wondering why at certain points along the linac, most notably around z=4.62 m and z=16.4 m, the k0 phase advance is calculated as 0? These seem to roughly coincide with the last elements in sections 1 and 2 in my linac.
Thanks,
Josh
Re: Phase advance calculation bug
Posted: Thu 28 May 2026 11:12
by Didier
Dear Josh,
The calculation of k0x is based on an arcos function, which must obviously be less than 1; however, for period #8, given that your solenoid has a very weak magnetic field, this value is greater than 1, preventing the phase advance from being calculated (see below for phase advance definition used in TraceWin).
I suppose it’s the same issue for the other period where the phase advance is set to 0
https://dacm-codes.fr/Softwares/TraceWi ... definition
Regards,
Didier