-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Energy ramp #810
base: master
Are you sure you want to change the base?
Energy ramp #810
Conversation
…from Param->energy and not from the element definition
…gy is taken from Param->energy instead of the element definition
I notice that several tests are not passed and also that I forgot some debugging commented "printf" in the code that I will remove. But I will work on this after holidays. |
This is a very nice and useful development. I haven't looked at the code. For what concerns you question: since we cannot suppress the element attribute @lfarv what do you think? |
@carmignani and @swhite2401 : indeed very interesting and useful. Now for the "energy" problem:
Practically, All this should be clarified ! I propose to do this in 2 steps:
These two steps are very critical: they affect the core of the tracking engine and there may be unexpected places where the |
I was doing simulations about the injection efficiency in the ESRF booster and I quickly realised that I needed to ramp the energy. So I wrote a pass method called EnergyRampPass.c that changes at each turn the energy property in the struct parameters that is passed to each pass method. The ramp is defined by two arrays and the pass method does linear interpolations. I also modified RFCavityPass to allow to define a voltage ramp, similarly to how we define the energy ramp.
I then changed the main rad and quant pass methods for the dipoles and multipoles to use the energy stored in the struct parameters and not the one in the Energy field of the element.
The pull request is far to be mergeable, because I did not update all the passmethods using the energy and I did not write an element creator for python. But then we should decide if we accept to completely remove the energy field from the elements or if we want to keep both the energy in the structure and the energy in the element. In that case we have to choose which one has higher priority.
In the figure I put an example of horizontal and vertical emittance, energy spread and bunch length evolution during the ramp in the ESRF booster. The ramp ends at about 135000 turns, but the simulation continues until 200000 with fixed energy.