Page 1 of 1

Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Fri 8 Aug 2025 06:38
by Bruce Yee
Dear Didier,

I would like to simulate a sector bending magnet (the angle of the beam with the dipole face is 90 deg) as shown on the left side of the
next figure.
dipole.png
dipole.png (13.54 KiB) Viewed 61216 times
Following the previous discussion, you provide the following example:

EDGE Angle/2 Ldip/(Angle*3.14159/180) 100 1e-8 1e-8 150 0
BEND Angle Ldip/(Angle*3.14159/180) 0 150 0
EDGE Angle/2 Ldip/(Angle*3.14159/180) 100 1e-8 1e-8 150 0

Is this a sector-bending magnet?

One more question, related to the "EDGE" element, the values K1 and K2, how did you compute?

For K1, I find the next relationship:
formula.png
formula.png (20.18 KiB) Viewed 61216 times
Could you please tell me how to compute those contributions?

Thanks for your help and time.

Best regards,

Bruce

Re: Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Mon 25 Aug 2025 13:48
by Didier
Dear Bruce,

No, it's a rectangular magnet. You can use Synoptic tool to visualise that.
dip.png
dip.png (147.98 KiB) Viewed 48681 times
And for K1 & K2, it's notice in manual
edge.png
edge.png (32.58 KiB) Viewed 48672 times
Regards,

Didier

Re: Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Tue 26 Aug 2025 10:29
by Bruce Yee
Dear Didier,

Thanks for the confirmation of the bending magnet type.

Thanks for the manual reference. One question, for the text in the manual "K1 and K2 are used in a development for the fringe-field correction. If they are equal to zero, K1 = 0.45 and K2 = 2.8." , I understand that for the case that fringe-field correction is zero K1=0.45 and K2=2.8. Is that correct?

Nevertheless, it does not mentioned how is computed K1 and K2, it shows how this compensated in the matrix. Am I correct?

Thanks for your time.

Best regards,

Bruce

Re: Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Tue 26 Aug 2025 16:38
by Didier
Dear Bruce,

If you don't want to take fringe-field correction into account, set k1 & k2 to 1e-12, but not to 0.

Regards,

Didier

Re: Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Thu 28 Aug 2025 07:25
by Bruce Yee
Dear Didier,

Thanks for your feedback. Please allow me to ask about Sector bending.
Using the following description:


EDGE Angle/2 Ldip/(Angle*3.14159/180) 100 1e-8 1e-8 150 0
BEND Angle Ldip/(Angle*3.14159/180) 0 150 0
EDGE Angle/2 Ldip/(Angle*3.14159/180) 100 1e-8 1e-8 150 0

I obtained the next rectangle bending:
Rectangle_bending_a.png
Rectangle_bending_a.png (79.01 KiB) Viewed 22516 times
Now defining the Edge angle to zero:

EDGE 0 Ldip/(Angle*3.14159/180) 100 1e-8 1e-8 150 0
BEND Angle Ldip/(Angle*3.14159/180) 0 150 0
EDGE 0 Ldip/(Angle*3.14159/180) 100 1e-8 1e-8 150 0
I obtained the next bending:
Sector_bending_a.png
Sector_bending_a.png (67.66 KiB) Viewed 22516 times
This look like a sector bending, but I would like to confirm is that the correct way to define a sector bending.
Could you please confirm?

Best regards,

Bruce

Re: Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Thu 28 Aug 2025 10:19
by Didier
Dear Bruce,

Yes, I confirm your analysis, but I don't quite understand what's not clear in the EDGE and BEND elements.

Regards,

Didier

Re: Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Thu 4 Sep 2025 10:56
by Bruce Yee
Dear Didier,

I apologize for the delayed response and appreciate your confirmation.

The confusion stems from my comparison of sector bending definitions used in SAD (the beam optics codes developed at KEK, which are similar to MAD-X at CERN). I am attempting to reproduce results from a SAD model that uses a definition involving an edge+bend+ edge. This led to my confusion, since the use that to defined a sector magnet.

I've noticed that the horizontal envelope is the same, but the vertical has the same peak locations, but the size is smaller (TraceWin is smaller). So, I am guessing that difference between the two codes is in the fringe field compensation on the vertical axis, which is why I was inquiring about how to compute K1 and K2.

Best regards,

Bruce

Re: Rectangle and Sector bending magnet and K1 and K2 contribution

Posted: Thu 4 Sep 2025 11:07
by Didier
Dear Bruce,

Don't worry, I understand. It's not always easy to benchmark several codes when the definitions are not clearly indicated.

Regards,

Didier