bmad-sim / bmad-ecosystem

Bmad simulation ecosystem for simulating high energy storage rings.
https://www.classe.cornell.edu/bmad/
12 stars 15 forks source link

Bmad_standard tracking non-symplectically for bend with sextupole #597

Closed eiad-hamwi closed 12 months ago

eiad-hamwi commented 12 months ago

Attached is a single element lattice showing the violation: multibend.zip

Setting ds_step = 1e-5 has almost no effect.

Using symp_lie_ptc as the tracking method alleviates this issue, but is slow.

DavidSagan commented 12 months ago

Part of the problem is that you need to use exact_multipoles. See the Bmad manual for details. On your example lattice the symplectic error went from 2e-6 to 8e-8. That is still a little more than I would like and will look into it.

DavidSagan commented 12 months ago

Note: The exact_multipole tracking looks to be behaving strangely. Please do not use until I have looked into this.

eiad-hamwi commented 12 months ago

Oh! I will avoid using exact_multipoles until your notice, but I will certainly read up on it.

DavidSagan commented 12 months ago

@eiad-hamwi I put in a fix so you can use exact_multipoles now. The symplectic error is still 8e-8 for your example.