Closed simoneliuzzo closed 1 year ago
I think there needs to be a constraint that is not included in matlab: ExitAngle_b1=-EntranceAngle_b2
Adding this constraint you cannot merge 2 rectangular bends where (ExitAngle_b1=EntranceAngle_b2=theta/2).
Having two rectangular bends without intermediate spacing is mechanically impossible: the poles overlap. More generally, the pole geometry (or rather the magnetic faces) impose the condition EntranceAngle_b2 = -ExitAngle_b1.
However I agree that we should add the condition EntranceAngle_b2 = -ExitAngle_b1 in Matlab, as it is done in python, to be safe. On the TODO list !
Fixed in #604
Running this small example above, it is evident that rbend are reduced to sbend. In a real lattice this generates large vertical tunes discrepancy among the intiial and reduced lattice