ThorstenHellert / SC

6 stars 4 forks source link

R0 reference orbit in SCBBA getOrbitBump #22

Closed oscarxblanco closed 1 year ago

oscarxblanco commented 2 years ago

Dear all,

the function getOrbitBump inside SCBBA, in lines 752 to 754, creates a zero reference with a target value at the BBA-BPM in order to calculate the correctors strength for an orbit bump.

This however, does not work with a highly perturbed lattice where the closed orbit differs largely from the zero reference.

I believe the bump should be calculated with respect to the closed orbit seen by the BPMs, for example, replacing those lines by :

    % Define reference orbit (closed orbit)
    R0 = SCgetBPMreading(SC);
    R0(nDim,tmpBPMind) = R0(nDim,tmpBPMind) + par.BBABPMtarget;

Best regards, o

ThorstenHellert commented 1 year ago

Thank you for that valuable suggestion! For backwards compatibility I always try to avoid to implement new features that might produce errors on older scripts though, so I think using an optional parameter with the old zeros as default is the way to go. I updated the code accordingly.