ThorstenHellert / SC

6 stars 4 forks source link

alba-II example orbit mode #5

Closed ZeusMarti closed 1 year ago

ZeusMarti commented 2 years ago

Hi there,

First, let me thank you for devoloping and sharing such a useful tool! I'm trying to apply it to the Alba-II case but it seems I always run into problems (findorbit6 gives nans) when switching to the orbit mode (line 304 in the example_albaII.m file attached). I have tried it for different seeds obtaining the same result. Any Idea what could be wrong? I'm attaching the functions I use in case you want to take a look at it. SC_albaII.zip

Thanks in advance!

Zeus

ThorstenHellert commented 2 years ago

HI Zeus,

Thank you very much.

I looked into your example and tried several things (switching on/off error sources and correction steps etc) and I think I could nail it down to the cavity not providing enough energy so that particles just get lost no matter how good your correction is (apart from that I think you have a problem with injection jitter and/or BPM noise when ramping up the sextupoles but I can’t say that for sure and it’s independent from the RF issue).

Attached you can find the longitudinal phase space that I always get after RF correction and basically the entire beam gets lost after some turns. Maybe you can start looking there? I’m in Thailand right now and only now and then with my laptop but I would be very happy to solves your problem with you, so please keep me updated! Cheers,

Thorsten

On 17. Jun 2022, at 01:26, Zeus Martí Diaz @.***> wrote:

Hi there,

First, let me thank you for devoloping and sharing such a useful tool! I'm trying to apply it to the Alba-II case but it seems I always run into problems (findorbit6 gives nans) when switching to the orbit mode (line 304 in the example_albaII.m file attached). I have tried it for different seeds obtaining the same result. Any Idea what could be wrong? I'm attaching the functions I use in case you want to take a look at it. SC_albaII.zip https://github.com/ThorstenHellert/SC/files/8921450/SC_albaII.zip Thanks in advance!

Zeus

— Reply to this email directly, view it on GitHub https://github.com/ThorstenHellert/SC/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHUUFSCUHAYUGXAU25QEIDVPNWTTANCNFSM5Y7VN3VQ. You are receiving this because you are subscribed to this thread.

ZeusMarti commented 2 years ago

Hi Thorsten,

Yes I think the problem is related to the RF. There seems to be no longitudinal focusing althought the RF is ON. That is not the case of the unperturbed lattice. Next I'll try to see at which point this stats happening...

ThorstenHellert commented 2 years ago

Hey Zeus,

I think I made some progress. Check out the attached script. You can use the Matlab text comparison to see that I changed

nPartciles =1 => less noise, with 10 particles you have a lot of artificial shot noise. Either increase number of particles or number of injections to average BPM readings over ‘radiationon’ => you need radiation losses on to calibrate the cavity with beam since this is done by measuring the radiation loss per turn

RF commissioning loop: nIter = 1:5 => more iterations to let the linear approximation converge Frequency ‘range’ = 4E3*[-1 1] => you need to sample the area in which the linear approximation works ’nTurns’ = 40 => you need to use a number of turns in which the linear approximation works

Calculating model RM: ‘useIdealRing’ => you want to use the ideal ring for the model RM

I ran the whole script 5 times and it pretty much corrected the cavity correctly and gave a corrected closed orbit (I’m sure you could find even better parameters for the RF commissioning). LOCO returns some errors. I didn’t dig into this but my feeling is that your regular expression when defining the fit parameters includes stuff that is not registered as a magnet. I hope this helps(?). Cheers,

Thorsten

On 20. Jun 2022, at 21:43, Zeus Martí Diaz @.***> wrote:

Hi Thorsten,

Yes I think the problem is related to the RF. There seems to be no longitudinal focusing althought the RF is ON. That is not the case of the unperturbed lattice. Next I'll try to see at which point this stats happening...

— Reply to this email directly, view it on GitHub https://github.com/ThorstenHellert/SC/issues/5#issuecomment-1160535911, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHUUFV2U4EP4PL6CLZHVJ3VQB7PVANCNFSM5Y7VN3VQ. You are receiving this because you commented.

ZeusMarti commented 2 years ago

Hi, thanks for your help! Sorry, maybe my fault, but I could not find any attachment!

ThorstenHellert commented 2 years ago

Sorry I think the files were sent via mail but not uploaded here

example_albaII.m.zip

PastedGraphic-1 PastedGraphic-2
ZeusMarti commented 2 years ago

Thanks Thorsten, I have tried your version but in my case the phase correction crashes. I'm definitely doing something diferently. Are you using the latest AT2.0 version? I have not updatetd for some months now...

It would be nice if you have some time during the LEL design workshop next week, any how see you here!

Zeus