Skip to Content.
Sympa Menu

opal - Re: [Opal] Opal-t produces dispersion curves in bends that I don't understand

opal AT lists.psi.ch

Subject: The OPAL Discussion Forum

List archive

Re: [Opal] Opal-t produces dispersion curves in bends that I don't understand


Chronological Thread 
  • From: "Finn O'Shea" <finn.oshea AT nusano.com>
  • To: opal <opal AT lists.psi.ch>
  • Subject: Re: [Opal] Opal-t produces dispersion curves in bends that I don't understand
  • Date: Thu, 28 May 2020 17:12:27 -0700

Apologies for the back-to-back emails.  Gmail appears to have stripped out all of the images and attachments.  I have included them here, I hope.

Finn

On Thu, May 28, 2020 at 5:06 PM Finn O'Shea <finn.oshea AT nusano.com> wrote:
I'm trying to understand the dynamics in bends in Opal-t and I'm seeing something I don't understand about the dispersion.  I've put together a minimum functioning examples that is a single bend (bend.in, attached).

The only thing I have changed in the following examples is SIGMAPZ:

(I had to remove these inline images to get under the 1 MB email limit.)

SIGMAPZ = 1E-3 : sigma_pz_is_0p001.jpg

SIGMAPZ = 1E-2 :  sigma_pz_is_0p01.jpg

SIGMAPZ = 1E-1  :  sigma_pz_is_0p1.jpg

SIGMAPZ = 1  :  sigma_pz_is_1p0.jpg


The last one is the only image that qualitatively makes sense to me.  When SIGMAPZ is small, the dispersion doesn't change in the body of the bends at all, but it does change in the fringe field regions.

In addition, the value of the dispersion doesn't seem right to me.  For a single bend of 15 degrees and bend radius 1 m, the dispersion should end up being about 3.4 cm, but it appears to be far larger than that when SIGMAPZ is 1.  When I dig through the code to see how this value is computed, it looks like that the x-dispersion is being calculated as the correlation between x and pz/mc.  I tracked the computation down to PartBunchBase.hpp which simply returns Dx_m on line 1169.  On line 1273 it computes Dx_m as moments_m(0,5), which is simply the correlation of x and pz (I think, see line 1994).  That is not the definition of dispersion that I expected, but that could be a convention I'm unfamiliar with, is that intentional?

To check to see if the dispersion I am familiar with is doing what I expect, I dumped the bunch information every 10 steps and computed <x*d> where d = (p - p_avg) / p_avg (not pz, I compute p from px, py and pz) and I see the following evolution:
image.png
Several things stand out to me:
(1) The beam starts with a non-zero dispersion of -3.2 mm.  Why?
(2) The total dispersion "generated" by the 15-degree bend seems too small (I use SPOS = 0.55 m as the end of the magnet).  A hard-edge 15-degree magnet should have eta_f = 3.4 cm, while for this magnet it is 1.34 cm.  If I compute the dispersion using the matrix multiplication formulas I'm accustomed to (from Klaus Wille's book) I get the dispersion as 4.69 cm using the vertical field from the h5 file and treating each step as a small bend or drift.

After seeing all of this, I plotted the evolution of the beam size (not the dispersion, I dunno what is going on there already) and compared it to elegant.  This is a different lattice than above, but there is some neat stuff happening here, too.
mdl0.jpg
(rms_x,rms_y,rms_s,element_names, and By_ref are from Opal, sigma_{x,y} are from elegant.  Ignore the plot after 4 meters, the lattices are different.)
 The beam sizes start off a little different because they are defined differently, and they evolve a little bit differently in the subsequent quadrupoles, but I'm more-or-less ok with these differences.  When the beam gets to the Opal dipole, rms_x starts diverging from the elegant curves pretty dramatically while y_rms seems to be doing fine.

The combination of the beam size differences (between elegant and Opal) and the dispersion differences (between Opal and other formulas) makes me think that something funny is going on in the SBEND element.  But it is possible, likely even, that I am simply unfamiliar with the conventions being used and the two can be reconciled.

Thanks in advance for any assistance,
Finn

--
Senior Scientist
Nusano, Inc
28575 Livingston Ave
Valencia, CA 91355
Office: 1 (424) 293-3174


--
Senior Scientist
Nusano, Inc
28575 Livingston Ave
Valencia, CA 91355
Office: 1 (424) 293-3174

Attachment: sigma_pz_is_0p001.jpg
Description: JPEG image

Attachment: mdl0.jpg
Description: JPEG image

Attachment: sigma_pz_is_0p1.jpg
Description: JPEG image

Attachment: sigma_pz_is_0p01.jpg
Description: JPEG image

Attachment: sigma_pz_is_1p0.jpg
Description: JPEG image

Attachment: bend.in
Description: Binary data

Attachment: dispersion.jpg
Description: JPEG image




Archive powered by MHonArc 2.6.19.

Top of Page