A quadrupole magnet employs a field gradient g measured in T/m or (G/cm in CGS units). The field focuses the beam with strength k = g/(Bρ) where is the beam rigidity



The EPICS control system displays the quadrupole magnet strength in kilogauss (kG). This is confusing. What it means that the field gradient g gets multiplied by the magnet length L so the EPICS B-field represents the integrated field strength B = gL.

In Lucretia, there are three more sources of confusion.

  1. The units are T instead of kG.
  2. The magnets are split into pieces.
  3. There are "Power supplies" in the Lucretia model.

Take for example Quad IN10 525. In reality, the magnet is 10.8 cm long In Lucretia, it is split into two pieces, each 5.4 cm long (field 'L'). The first "half" of the quadrupole is shown in the code block on the right for index 120. Index 122 provides the other "half" of the quadrupole. Index 121 is a zero-length BPM. In order to convert from the value shown in the EPICS Panel BDES field above, to the value in Lucretia Beamline element, you divide EPICS BDES by 10 (to go from kG to T) and by 2 (to go from full quad to half quad).

BEAMLINE.B = B_EPICS / 10 / 2.

However, the above holds only if the 'PS' (Power Supply) isn't being used, or equivalently if PS.Ampl = 1. In the Lucretia Live Model, you may see that

PS.Ampl = B_EPICS / 10 and BEAMLINE.B = 0.5.

In all cases, the following holds:

Σ (PS(i).Ampl * BEAMLINE(i).B) = B_EPICS / 10.

Where the sum is over the magnet sections. In the case of QUAD IN10 525 with the magnet in two sections with indices 120 and 122, and the PS supply with index 38, this gives:

PS(38).Ampl * BEAMLINE(120).B + PS(38).Ampl * BEAMLINE(122).B = B_EPICS / 10.


Finally, it is possible to compute the R matrix in Lucretia between elements, using RmatAtoB(start_index,end_index) where the matrix is computed from the upstream side of the element at start_index to the downstream side of the element at end_index. It is possible to compare results from Lucretia with matrices that use the thick lens approximation.



>> BEAMLINE{120}

ans = 

  struct with fields:

         Name: 'QE10525'
            S: 11.4811
            P: 0.1251
        Class: 'QUAD'
            L: 0.0540
            B: 0.2042
           dB: 0
         Tilt: 0
         aper: 0.0160
           PS: 38
       Offset: [0 0 0 0 0 0]
       Girder: 0
    TrackFlag: [1×1 struct]
         Type: '1.26q3.5'
       Coordi: [3.6120 0 1.0117e+03]
       Anglei: [-0.6109 0 0]
       Coordf: [3.5811 0 1.0117e+03]
       Anglef: [-0.6109 0 0]
>> PS(38)

ans = 

  struct with fields:

       Ampl: 1
      SetPt: 1
       Step: 0
    Element: 120
      dAmpl: 0
  • No labels