Page 1 of 3
transverse gradient undulator
Posted: 09 May 2016, 11:31
by jtobin
Dear all,
I would like to simulate a transverse gradient undulator using elegant. Is there any suggestions?
-Charles
Re: transverse gradient undulator
Posted: 09 May 2016, 14:03
by michael_borland
Charles,
The best way is to use the script makeWigglerFromBends (distributed with elegant).
--Michael
Re: transverse gradient undulator
Posted: 06 Jun 2017, 08:52
by Ji_Li
michael_borland wrote:Charles,
The best way is to use the script makeWigglerFromBends (distributed with elegant).
--Michael
Dear Michael,
Is there any example to illustrate the script makeWigglerFromBends?
I have tried to used FTABLE and BMXYZ to do tracking for a wiggler with transverse gradient, they work very well. But I think they are not symplectic. If we use makeWigglerFromBends to do symplectic tracking, the sextupole and octupole components could differ with transverse position. Is there any better way?
Thanks in advance!
Ji
Re: transverse gradient undulator
Posted: 06 Jun 2017, 09:54
by michael_borland
Ji,
There are several symplectic alternatives to using a string of CSBEND elements.
- CWIGGLER --- this works from a set of field harmonics. It's symplectic, but slow.
- GFWIGGLER --- this uses a generating-function method. It's also symplectic, and much faster than CWIGGLER, though less accurate.
- BGGEXP --- this uses a generalized gradient expansion in cylindrical coordinates. It has a symplectic integration mode. It's easier to set up than CWIGGLER and GFWIGGLER, and intermediate in speed.
- UKICKMAP --- this uses a kickmap, which is very fast. The kickmap can be generated by the magnet modeling program, or by elegant from tracking through a CWIGGLER or BGGEXP element.
--Michael
Re: transverse gradient undulator
Posted: 14 Jun 2017, 03:00
by Ji_Li
michael_borland wrote:Ji,
There are several symplectic alternatives to using a string of CSBEND elements.
- CWIGGLER --- this works from a set of field harmonics. It's symplectic, but slow.
- GFWIGGLER --- this uses a generating-function method. It's also symplectic, and much faster than CWIGGLER, though less accurate.
- BGGEXP --- this uses a generalized gradient expansion in cylindrical coordinates. It has a symplectic integration mode. It's easier to set up than CWIGGLER and GFWIGGLER, and intermediate in speed.
- UKICKMAP --- this uses a kickmap, which is very fast. The kickmap can be generated by the magnet modeling program, or by elegant from tracking through a CWIGGLER or BGGEXP element.
--Michael
Dear Michael,
BGGEXP was tried as you suggested.
When I used the command: computeGeneralizedGradients -input field.sdds -output out.ggrad -mainHarmonic 3 -nHarmonics 5, it showed the error message:
Error (sddsprocess): one or more rpn definitions files do not exist
while executing
"exec sddsconvert $root.fft -pipe=out -keeppages=[join $pageList ,] \
| sddsprocess -pipe \
"-define=col,BmRz,ImagFFTBr chs" \
"-define=par..."
(file "/usr/bin/computeGeneralizedGradients" line 48)
And defn.rpn has been set as suggested. What is wrong here?
Ji
Re: transverse gradient undulator
Posted: 14 Jun 2017, 09:50
by michael_borland
Ji,
Yes, there's a problem with the way the script is written. It expects a special extra rpn definitions file to be in the working directory. If you copy the attached file to your working directory, it should work.
--Michael
Re: transverse gradient undulator
Posted: 14 Jun 2017, 09:51
by michael_borland
Here's a zip version to prevent the virus scanner from removing it.
Unzip to get alpha.rpn.
--Michael
Re: transverse gradient undulator
Posted: 14 Jun 2017, 10:47
by Ji_Li
Michael,
Thanks! It works with the alpha.rpn.
But there are still errors:
computeGeneralizedGradients -input field.sdds -output GG -mainHarmonic 4 -nHarmonics 5
warning: (z, Bz) does not appear in GG.ref
1 of 1 datanames absent from file GG.ref
warning: no datanames in request found for file GG.ref
Warning: not all y quantities have the same units
And the plot attached is also wird: the range of z should be from 0 to 2.3 m, I don't know why there is negative part.
Ji
Re: transverse gradient undulator
Posted: 14 Jun 2017, 11:02
by michael_borland
Ji,
I noticed a few problems: (1) You have multiple values of R. You should only have data for a single radius, e.g., 10mm. (2) You don't have many points in z; much finer spacing is recommended.
I'm putting together an example that may help. I might also need to modify the script to do this case, which we haven't done ourselves.
--Michael
Re: transverse gradient undulator
Posted: 14 Jun 2017, 15:18
by Ji_Li
Michael,
Thanks a lot, that would be very helpful.
I use single R and much small intervals in z (stepsize 0.00023m), and it shows the same error message.So I am looking forward to the example.
Ji