Hello,
I have trouble setting the physical apertures of my lattice properly.
A very simple example is attached to the post:
1. The standard apertures are +/-35 mm end +/-12.5 mm in the horizontal and vertical planes respectively. In the file physical_acceptance.sdds, I defined these apertures from s = 0 m to another longitudinal position corresponding to the position of an insertion device (ID) where I want my apertures to be narrower. Unfortunatly, I get an unexpected physical aperture between these two positions, varying linearly with s, whereas I want it to be constant as the standard aperture should be.
2. Then I define the aperture of the ID which is an element subdivided in several parts. However the apertures should be constant all along the ID. I defined the reduced aperture at the end of the upstream element and I set the standard aperture at the end of the ID. What I get is an unwanted varying aperture along the ID (exhibiting a stair like profile). The physical apertures after the ID have the right shape though. It seems like there is a kind of interp mode activated, but this is supposed to be off by default (I am referring to this post: viewtopic.php?f=17&t=415&p=1629&hilit=a ... ical#p1629).
3. I tried to define disymmetric apertures as well (not included in this example), but it did not work neither. Is there a way to do it using the function aperture_data ?
Thanks for your help, regards
Randy
Issue with the physical aperture
Moderators: michael_borland, soliday
-
- Posts: 2
- Joined: 15 Feb 2022, 16:14
Issue with the physical aperture
- Attachments
-
- lattice.lte
- (21.79 KiB) Downloaded 405 times
-
- check_lattice.ele
- (875 Bytes) Downloaded 392 times
-
- physical_acceptance.sdds
- (498 Bytes) Downloaded 377 times
Re: Issue with the physical aperture
If you want to keep the aperture constant until the transitions, you can try this for the aperture file,
giving the downstream aperture and then the upstream aperture at each transition point.
That should also make everything work if you want to track particles backwards.
Sounds like the manual needs to be updated, too.
-Gregg
SDDS1
&column name=s, units=m, type=double, &end
&column name=xHalfAperture, units=m, type=double, &end
&column name=yHalfAperture, units=m, type=double, &end
&column name=xCenter, units=m, type=double, &end
&column name=yCenter, units=m, type=double, &end
&data mode=ascii, &end
5
0.000000e+00 35.000000e-03 12.500000e-03 0.000000e+00 0.000000e+00
8.286410e+01 35.000000e-03 12.500000e-03 0.000000e+00 0.000000e+00
8.286410e+01 28.000000e-03 7.000000e-03 0.000000e+00 0.000000e+00
9.418190e+01 28.000000e-03 7.000000e-03 0.000000e+00 0.000000e+00
9.418190e+01 35.000000e-03 12.500000e-03 0.000000e+00 0.000000e+00
giving the downstream aperture and then the upstream aperture at each transition point.
That should also make everything work if you want to track particles backwards.
Sounds like the manual needs to be updated, too.
-Gregg
SDDS1
&column name=s, units=m, type=double, &end
&column name=xHalfAperture, units=m, type=double, &end
&column name=yHalfAperture, units=m, type=double, &end
&column name=xCenter, units=m, type=double, &end
&column name=yCenter, units=m, type=double, &end
&data mode=ascii, &end
5
0.000000e+00 35.000000e-03 12.500000e-03 0.000000e+00 0.000000e+00
8.286410e+01 35.000000e-03 12.500000e-03 0.000000e+00 0.000000e+00
8.286410e+01 28.000000e-03 7.000000e-03 0.000000e+00 0.000000e+00
9.418190e+01 28.000000e-03 7.000000e-03 0.000000e+00 0.000000e+00
9.418190e+01 35.000000e-03 12.500000e-03 0.000000e+00 0.000000e+00
-
- Posts: 2
- Joined: 15 Feb 2022, 16:14
Re: Issue with the physical aperture
Hello,
many thanks Greg for your help. I improved the physical apertures thanks to your advice.
However, there is another problem now, as the aperture behaves differently with respect to the longitudinal position.
The complete files are attached but we can focus on two specific IDs.
Let's consider for instance the IDs called SIXS and SIRIUS in the sdds file (their apertures are defined at the end of this file).
SIXS starts at s = 297.2339 m (Its entrance is marked by the BPM marker) and SIRIUS starts at s = 319.4663 m. Their aperture is definded in the same manner, except the values differ.
I run check_lattice and check the apertures with sddsplot. The result is given in figure pa.png. You can see the problem...
When I look closely in the vicinity of these two with sddsprintout -col=ElementName -col=s -col=?Aperture randy_test.twi I get :
SIXS:
FCOR 2.971493e+02 3.500000e-02 1.250000e-02
SDC5 2.972339e+02 2.500000e-02 1.250000e-02
BPM 2.972339e+02 2.500000e-02 1.250000e-02
SDAC1 2.987182e+02 2.500000e-02 1.250000e-02 ! the ID
SDAC1 3.002025e+02 2.500000e-02 1.250000e-02 ! the ID
BPM 3.002025e+02 2.500000e-02 1.250000e-02
SDC14 3.002813e+02 3.500000e-02 1.250000e-02
SIRIUS:
FCOR 3.193817e+02 3.500000e-02 1.250000e-02
SDC5 3.194663e+02 3.500000e-02 1.250000e-02
BPM 3.194663e+02 3.500000e-02 1.250000e-02
SDAC1 3.209505e+02 2.500000e-02 8.000000e-03 ! the ID
SDAC1 3.224348e+02 3.500000e-02 1.250000e-02 ! the ID
BPM 3.224348e+02 3.500000e-02 1.250000e-02
SDC14 3.225136e+02 3.500000e-02 1.250000e-02
In the case of SIXS the aperture extends correctly along the ID whereas it does not in the case of SIRIUS.
You can see that this behaviour is not an isolated case. Sometimes it works (sadly not very often) and sometimes not. I can not figure out why, do you have any clue ?
Regards,
Randy
many thanks Greg for your help. I improved the physical apertures thanks to your advice.
However, there is another problem now, as the aperture behaves differently with respect to the longitudinal position.
The complete files are attached but we can focus on two specific IDs.
Let's consider for instance the IDs called SIXS and SIRIUS in the sdds file (their apertures are defined at the end of this file).
SIXS starts at s = 297.2339 m (Its entrance is marked by the BPM marker) and SIRIUS starts at s = 319.4663 m. Their aperture is definded in the same manner, except the values differ.
I run check_lattice and check the apertures with sddsplot. The result is given in figure pa.png. You can see the problem...
When I look closely in the vicinity of these two with sddsprintout -col=ElementName -col=s -col=?Aperture randy_test.twi I get :
SIXS:
FCOR 2.971493e+02 3.500000e-02 1.250000e-02
SDC5 2.972339e+02 2.500000e-02 1.250000e-02
BPM 2.972339e+02 2.500000e-02 1.250000e-02
SDAC1 2.987182e+02 2.500000e-02 1.250000e-02 ! the ID
SDAC1 3.002025e+02 2.500000e-02 1.250000e-02 ! the ID
BPM 3.002025e+02 2.500000e-02 1.250000e-02
SDC14 3.002813e+02 3.500000e-02 1.250000e-02
SIRIUS:
FCOR 3.193817e+02 3.500000e-02 1.250000e-02
SDC5 3.194663e+02 3.500000e-02 1.250000e-02
BPM 3.194663e+02 3.500000e-02 1.250000e-02
SDAC1 3.209505e+02 2.500000e-02 8.000000e-03 ! the ID
SDAC1 3.224348e+02 3.500000e-02 1.250000e-02 ! the ID
BPM 3.224348e+02 3.500000e-02 1.250000e-02
SDC14 3.225136e+02 3.500000e-02 1.250000e-02
In the case of SIXS the aperture extends correctly along the ID whereas it does not in the case of SIRIUS.
You can see that this behaviour is not an isolated case. Sometimes it works (sadly not very often) and sometimes not. I can not figure out why, do you have any clue ?
Regards,
Randy
- Attachments
-
- elegant_file.zip
- (6.51 KiB) Downloaded 394 times
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Issue with the physical aperture
Randy,
There are a few reasons for this behavior. First, your aperture input file includes infinite-slope transitions, as seen by identical s values on subsequent rows of the file; this is apt to confuse the interpolation of the aperture vs s. Second, the aperture is computed only at the ends of elements; it doesn't show the aperture just before and after the transitions, so when plotted with the original input, it will look different.
My suggestion for solving this is
There are a few reasons for this behavior. First, your aperture input file includes infinite-slope transitions, as seen by identical s values on subsequent rows of the file; this is apt to confuse the interpolation of the aperture vs s. Second, the aperture is computed only at the ends of elements; it doesn't show the aperture just before and after the transitions, so when plotted with the original input, it will look different.
My suggestion for solving this is
- Revise the aperture file to eliminate the infinite slope transitions.
- Interpolate the aperture file with a spacing of, say, 1 mm in s. You can use
Code: Select all
sddsinterp ap-old.sdds ap-new.sdds -equispaced=0.001 -column=s,*
- Divide the drift spaces more finely in the lattice file. You can do this by adding the following command at the top of the command file
Code: Select all
÷_elements name = *, type = *DRIF*, maximum_length = 0.001 &end