transverse gradient undulator

Moderators: cyao, michael_borland

jtobin
Posts: 47
Joined: 23 Jul 2008, 15:00

transverse gradient undulator

Post by jtobin » 09 May 2016, 11:31

Dear all,
I would like to simulate a transverse gradient undulator using elegant. Is there any suggestions?
-Charles

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: transverse gradient undulator

Post by michael_borland » 09 May 2016, 14:03

Charles,

The best way is to use the script makeWigglerFromBends (distributed with elegant).

--Michael

Ji_Li
Posts: 13
Joined: 31 May 2017, 07:16

Re: transverse gradient undulator

Post by Ji_Li » 06 Jun 2017, 08:52

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

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: transverse gradient undulator

Post by michael_borland » 06 Jun 2017, 09:54

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

Ji_Li
Posts: 13
Joined: 31 May 2017, 07:16

Re: transverse gradient undulator

Post by Ji_Li » 14 Jun 2017, 03:00

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
Attachments
field.sdds
(2.8 MiB) Downloaded 431 times

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: transverse gradient undulator

Post by michael_borland » 14 Jun 2017, 09:50

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

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: transverse gradient undulator

Post by michael_borland » 14 Jun 2017, 09:51

Here's a zip version to prevent the virus scanner from removing it.

Unzip to get alpha.rpn.

--Michael
Attachments
alpha.zip
(269 Bytes) Downloaded 447 times

Ji_Li
Posts: 13
Joined: 31 May 2017, 07:16

Re: transverse gradient undulator

Post by Ji_Li » 14 Jun 2017, 10:47

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
Attachments
Screenshot from 2017-06-14 17-26-04.png

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: transverse gradient undulator

Post by michael_borland » 14 Jun 2017, 11:02

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

Ji_Li
Posts: 13
Joined: 31 May 2017, 07:16

Re: transverse gradient undulator

Post by Ji_Li » 14 Jun 2017, 15:18

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

Post Reply