-
Notifications
You must be signed in to change notification settings - Fork 34
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
Simple ring model #643
Simple ring model #643
Conversation
…s.py. Added function in fastring to generate ring
If it is not possible to easily add damping partition numbers to the EnergyLoss element.
|
@lcarver, before going into the details of the implementation I would suggest to integrate this directly in the fastring function instead of adding a new one: make the new function private and call it in fastring in case the ring is not provided. |
Similarly, the quantum diffusion element could be integrate in radiation.gen_quantdiffelem when the ring is not provided |
I fully agree with @swhite2401 on one point: the output should be similar to the one of On the other hand, I don't see a good reason to group both in a same function: the inputs are completely different, and I don't think there is anything in common in the implementation. |
A passmethod to model damping and diffusion with only given equilibrium emittance and damping times is a useful addition. It allows to generate a fastring from a parameter table when the full AT lattice file is not available which is the whole point of this PR. The 3 steps that @lcarver proposed are fine and equivalent to what is done in fastring. I disagree that the structure/functionaltity should be the same as fastring, I can see some advantage in having all synchrotron radiation effects in a single element and not mixed with the M66 as is done in fastring. |
I have no objection to split betatron motion and damping in two different elements, but:
But still none of the proposed splits allows emittance computation with ohmienvelope… Too bad. |
I prefer what is proposed by @lcarver, is it much simpler and more efficient. Having all radiation effects in a single element is a very nice and convenient feature and even if it is not used for this simple fastring this new passmethd is a nice addition that should be integrated in AT. |
Why not, but @lcarver proposes to include the damping in the (single) 6x6 matrix, while I thought you preferred having it separated from betatron motion. Also, the pass method included in this PR does not deal neither with damping nor with energy loss: it only does the quantum excitation. Treating damping and energy loss is the "classical" way has some advantages: if you disable it, the beams damps to zero but the closed orbit and linear optics still give the good results: you get the right synchronous phase and damping times. Anyway, I don't care to much about how the transfer is split, I just think that once the optimum is chosen, there is no reason why it should be different between fastring and simplering… |
I think it would be nice to have the damping separated from the M66 in the fast ring, so that we could simply remove the diffusion element and the damping element and have the fast ring without radiation. |
I wrote a comment here but I think I had a wrong interpretation of some things. I will implement a correct (without EnergyLoss element) simple ring model, that includes a SimpleQuantumDiffusion element that combines both radiation damping and equilibrium emittance. By lumping into one element, this will for sure be faster. I will include a more detailed comment when it is ready for review. |
The SimpleQuantDiffPass has been modified. It now requires U0 (in addition to previous arguments). If the user asks for emit=0, then no quantum diffusion is applied. The energyloss element has been removed as U0 is covered in SimpleQuantDiffPass with user defined damping times. The file below is the updated one from the first comment (which I have now removed). It shows good damping times and emittances, correct tunes and beam centered on zero. For me this solves the problem of generating a ring from a table. This is the simplest implementation and is a very straightforward way of generating a lattice that can be used for collective effects studies in the fewest elements.
|
Hello, Rather than implement the optional / default values in the C passmethod, I prefer to set them all on the python side. this allows me to make some assertions about what cases are allowed or not (tau with emit=0 is ok, emit with tau=0 is not). Now, simple_ring requires 7 positional arguments: energy, circumference, harmonic_number, Qx, Qy, Vrf, alpha. The rest of the parameters are keyword arguments that have default values. New parsing of the function looks like this:
but similarly you can just use
|
ready for review |
all implemented except the last comment |
…al TimeLag for cavity settings
# By Laurent Farvacque (14) and others # Via GitHub * master: (28 commits) Add passive beamloading cavity (#586) Create BndStrMPoleSymplectic4RadPass (#665) Documentation fixes (#669) Update of the build process (#659) New Matlab function atsimplering (#657) Collective bugfix (#664) Correct the attribute name of solenoids in Matlab (#663) Error parsing args for twiss_in and r_4d (#662) Fix atmaincavities (#656) Fix attribute names in Simple Ring (#655) Remove collective passes from internal lattice_pass (#650) The DPStep keyword in linopt6 raises an error for 4D lattices (#651) Bug fix in atdisable_6d: keep the Energy field in cavities. (#654) fix: ring phase advances in computeRDT.m (#652) Correct the axis definition in plot_sigma (#648) Don't automatically cache the location of RF cavities (#640) Simple ring model (#643) Correct Dipole tapering (#623) Chromatic functions extended (#644) Repair the Matlab tests (#645) ... # Conflicts: # atmat/Contents.m # atmat/atphysics/Radiation/atdisable_6d.m # atmat/atphysics/Radiation/atenable_6d.m # atmat/lattice/at2str.m # atmat/pubtools/create_elems/atidtable_dat.m # pyat/at/lattice/elements.py # pyat/at/lattice/lattice_object.py # pyat/at/physics/matrix.py # pyat/at/physics/radiation.py # pyat/examples/CollectiveEffects/RobinsonInstability.py
This is presented as a solution to issue #606 . This PR was also a big motivation in the creation of issue #642 which has not yet been solved.
Here I have introduced a way to create a very simple ring based on a dictionary of global machine parameters. The produced lattice has the following elements.
I added the new passmethod, added an element to elements.py, and added a function to fastring.py.
When we have a solution to #642, we can simply add the damping partition numbers as a parameter in the function 'gen_simple_ring' and pass the damping partition numbers to the EnergyLoss element.
Below is a copy paste of a test file that I have written that shows good agreement for tunes, damping times, equilibrium emittances and z center of mass.
OUTDATED. SEE NEWFILE BELOW