Closed weiyuanlou closed 3 weeks ago
When elements are superimposed upon one another, Bmad cannot, except for a few special cases, handle misalignments of the elements. So when there are misalignments, a EM_Field element is created and the tracking method is set to Runge_Kutta. What Bmad should do Is prevent you from misaligning in case 2. I will work on a fix.
Ah I see. I guess it would would if I use the hkick
attribute of the quad instead of superimposing a hkicker onto it?
Yes better is to use the hkick attribute of the quad.
Compare 3 cases:
Case 1: A quad q1 has an hkicker superimposed onto it. The quad q1 is also given an
x_offset
in the lattice BEFORE theuse
statement. When Tao runs,tracking_method
of many elements becomesrunge_kutta
( see image below ). To test, run tao using the attached files. bug.zipCase 2: The x_offset of q1 is given in tao. The tracking_method remains
Bmad_Standard
as expected. To test, uncomment the x_offset line in lat.bmad, and call Script.tao.The difference between case 1 and case 2 is unexpected.
Case 3: Comment out the superimposed kicker, and all
tracking_method
staysBmad_standard
, regardless of thex_offset
being applied in the lattice or in Tao.Overall observation: a quad with (1) x_offset given in lattice + (2) a kicker superimposed seems to cause the tracking method to change from Bmad_standard to runge_kutta for the PIPE and several downstream elements on the pipe. The kicker KEY also changes to EM_FIELD. However the other kicker on the other quad (q2) with no x_offset is un-affected. If the x_offset is given after Tao runs, no problem is seen.