Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

LEM (LINAC energy management) is a set of algorithms responsible for estimating the beam momentum profile and calculating the corresponding lattice quad settings. This code only calculates the momentum profile, errors and magnet settings. Actually setting magnets in the accelerator will be handled by a LEM server GUI (coming soon...)

Calculating the live

...

momentum profile

  1. start with an estimated momentum profile based on reported klystron amplitudes & phases

    Latex
    \[ E_{est}(s) = \sum_1^{N_{klys}(s)} ENLD_i cos(PDES_{SBST} + PDES_i)
  2. The estimated momentum profile is unlikely to add up to exactly the correct energy, so we need to scale things by a fudge factor to match reality. Since the actual final energy of the beam in each linac is known form the bend magnet settings, we can calculate this number by comparing the estimated final energy to the actual energyuse the live momentum profile to calculate quad settings for the linac

    Latex
    \[ f = E_{design}(end) / E_{est}(end) \quad \rightarrow \quad E_{live}(s) = f * E_{est}(s)

Calculating magnet settings

  1. From the use the live momentum profile to calculate quad settings for the linacfrom design momentum profile
      :
    1. calculate a dimensionless "LEM error":

      Latex
      \sigma_{LEM}(s) = E_{live}(s) / E_{design}(s)
    1. calculate new magnet BDESes: 

      Latex
      BDES_{LEM} = \sigma_{LEM}(s) * BDES_{design}
  1. from design multipole coefficients (lcls style)
    1. get design multipole coefficients (k0_des, k1_des for bends/quads), and (effective) magnet lengths l_eff from the model
    2. calculate the rigidity like so (where E_live is in GeV): 

      Latex
      \[ B\rho(s) = \frac{E_{live}(s)}{299.792458*10^4}
    3. calculate new magnet BDESes

      Latex
      BDES_{LEM} = B\rho * k_{design} * l_{eff}
    publish LEM BDES and related PVs to BMAD:SYS0:1:FACET2E:LEM_DATA


F2 Live Model Server

The live model server runs its own BmadLiveModel, and periodically writes live model data for NTTables accessible on the controls system via EPICS PVAccess. The code for the live model itself is relatively simple, and is derived from the lcls_live_model server.

...