Michael,
I am using a malign element to offset the energy as following:
MA1: MALIGN,ON_PASS=0,dp=0.02
Then I compute close_orbit and beta functions, expecting that Elegant would give optical functions at the desired momentum offset.
If I set on_pass = 0, the beta functions are only slight different from that of on-momentum case. The close orbit seems correct.
if I change the on_pass to -1, the close orbit for dp=0.02 is the same as that in case 1, but beta functions are very different from case 1.
I am confused. Which number should I use?
Weiming
Malign element
Moderators: cyao, michael_borland
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Malign element
Weiming,
This is a somewhat confusing issue.
Basically, you shouldn't set ON_PASS to any value for this simulation. Leave it at the default value of -1. Elegant interprets this as meaning, for matrix and twiss parameter computations, that you want to simulate a beam that is permanently displaced to the given DP value, rather than just kicked. (It isn't really consistent, because if you track with this setting, then elegant will kick the beam every turn.)
Alternatively, you can use FORCE_MODIFY_MATRIX=1 to force elegant to change the revolution matrix to account for the offset, even when ON_PASS=0.
I've attached an example of how to do the simulation.
--Michael
This is a somewhat confusing issue.
Basically, you shouldn't set ON_PASS to any value for this simulation. Leave it at the default value of -1. Elegant interprets this as meaning, for matrix and twiss parameter computations, that you want to simulate a beam that is permanently displaced to the given DP value, rather than just kicked. (It isn't really consistent, because if you track with this setting, then elegant will kick the beam every turn.)
Alternatively, you can use FORCE_MODIFY_MATRIX=1 to force elegant to change the revolution matrix to account for the offset, even when ON_PASS=0.
I've attached an example of how to do the simulation.
--Michael
- Attachments
-
- offMomentumTwiss.tgz
- (2.12 KiB) Downloaded 593 times
Re: Malign element
Michael,
Nice example. Thanks!
Weiming
Nice example. Thanks!
Weiming
Re: Malign element
Hi Michael,
Sometimes I'm still confusing on this element.
I notice that in the example "/PAR/dynamicAperture/parTrack.lte", you set 'on_pass=0, force_modify_matrix=1' to calculate the off-momentum DA.
But in the case "/PAR/chromTracking/parTrack.lte", you use the default value of 'on_pass' to calculate the off-momentum tunes and chromaticities.
I can't quite understand the different between this two cases. In my opinion, both cases require the same setting of the off-momentum particles.
Could you please explain it for me? Thanks a lot!
Sometimes I'm still confusing on this element.
I notice that in the example "/PAR/dynamicAperture/parTrack.lte", you set 'on_pass=0, force_modify_matrix=1' to calculate the off-momentum DA.
But in the case "/PAR/chromTracking/parTrack.lte", you use the default value of 'on_pass' to calculate the off-momentum tunes and chromaticities.
I can't quite understand the different between this two cases. In my opinion, both cases require the same setting of the off-momentum particles.
Could you please explain it for me? Thanks a lot!
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Malign element
The essential difference between these two examples is that one involves mult-turn tracking and the other doesn't. When tracking many turns, one usually does not want the MALIGN element to act on the beam each turn. E.g., we don't want to give the beam an additional energy offset each turn. Hence, in this case we use ON_PASS=0 to specify that the energy kick occurs only on the zeroth pass through the system. However, when ELEGANT sees this, it assumes that this "transient" effect should not be included in optics calculations. The FORCE_MODIFY_MATRIX=1 setting tells elegant that, contrary to the default behavior, we do in fact want this kick (energy offset) to be included in the optics calculations.
If we are not tracking multiple turns, then we don't need to change ON_PASS from the default value of -1. Since that is the cause, we also don't need FORCE_MODIFY_MATRIX=1, because the matrix will be modified by default.
Hope that makes it more clear.
--Michael
If we are not tracking multiple turns, then we don't need to change ON_PASS from the default value of -1. Since that is the cause, we also don't need FORCE_MODIFY_MATRIX=1, because the matrix will be modified by default.
Hope that makes it more clear.
--Michael
Re: Malign element
Michael,
Thank you! My understanding of this element becomes much better. But I found that it is still difficult for me to understand one of the Examples.
In /ElegantExamples/PAR/chromTracking/parTrack.lte, you define this element with the following line:
mal: malign
And then, track particles for 1024 turns to calculate the tune at different momentum.
It doesn't make sense to me because in this case, the ON_PASS=-1, which means that the particle will get an additional energy offset each turn. I run this example but I notice that the energy deviation of a particle doesn't change at all. But I believe the particle should get additional energy offset each turn, am I right?
While, in /ElegantExamplts/PAR/chromTracking2/parTrack.lte, this element is defined as follows:
mal: malign,on_pass=0,force_modify_matrix=1
I think this case agrees with your explanation on the usage of the element: MALIGN.
Haisheng Xu
Thank you! My understanding of this element becomes much better. But I found that it is still difficult for me to understand one of the Examples.
In /ElegantExamples/PAR/chromTracking/parTrack.lte, you define this element with the following line:
mal: malign
And then, track particles for 1024 turns to calculate the tune at different momentum.
It doesn't make sense to me because in this case, the ON_PASS=-1, which means that the particle will get an additional energy offset each turn. I run this example but I notice that the energy deviation of a particle doesn't change at all. But I believe the particle should get additional energy offset each turn, am I right?
While, in /ElegantExamplts/PAR/chromTracking2/parTrack.lte, this element is defined as follows:
mal: malign,on_pass=0,force_modify_matrix=1
I think this case agrees with your explanation on the usage of the element: MALIGN.
Haisheng Xu
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Malign element
Haisheng,
In /ElegantExamples/PAR/chromTracking/parTrack.lte, there's a RECIRC element (RC) in the beamline, right after the malign element. This element cases all upstream elements to be ignored except on the first pass. Basically, the beam recirculates back to the RC element rather than to the beginning of the beamline. If it wasn't for this element, then the beam would get an additional energy kick each turn.
--Michael
In /ElegantExamples/PAR/chromTracking/parTrack.lte, there's a RECIRC element (RC) in the beamline, right after the malign element. This element cases all upstream elements to be ignored except on the first pass. Basically, the beam recirculates back to the RC element rather than to the beginning of the beamline. If it wasn't for this element, then the beam would get an additional energy kick each turn.
--Michael
Re: Malign element
Now I understand!
Appreciate your help greatly!
Haisheng Xu
Appreciate your help greatly!
Haisheng Xu