5. Tune a multicell cavity

In a multicell cavity two things must be right at once: the accelerating pi-mode must sit at the target frequency, and the field must be the same in every cell. Tuning the inner cells moves the frequency, but the end cells sit next to beam pipes, which change their frequency, so they need tuning of their own.

In this tutorial you will:

  1. Build a 9-cell cavity whose cells are all too large.

  2. Tune only the inner cells, and see that the field is not flat.

  3. Tune the inner cells and the end cells in one call.

  4. See what the tuner changed in each cell.

Before you start: work through Tune a cell to a target frequency. Running the whole notebook takes about two minutes.

1. A detuned 9-cell cavity

Every cell starts with the same dimensions, and an equator radius of 108 mm, too large for 1300 MHz. The beam pipes at both ends make the end cells differ from the inner ones even so.

from cavsim2d import EllipticalCavity, WARM

cell = [42, 42, 12, 19, 35, 57.7, 108.0]          # A, B, a, b, Ri, L, Req  [mm]

def detuned(name):
    return EllipticalCavity(9, cell, cell, cell, beampipe='both', name=name)

detuned('detuned').plot('geometry');
../_images/f4e8730da9b7be3d3321dd99662192eae0c6a1604bbc0af645bb3031c2c5fe51.png

detuned() builds a fresh copy of the cavity, so that each tuning below starts from the same geometry and keeps its results in its own folder.

2. Tune the inner cells only

'mid-cell': 'Req' changes the equator radius of the inner cells, which sets the frequency of the whole passband.

inner_only = detuned('inner_only')
inner_only.tune.run({'freqs': 1300, 'cell_type': {'mid-cell': 'Req'}});

inner_only.tuned.eigenmode.run()
q = inner_only.tuned.eigenmode.qois
print(f"pi-mode {q['freq [MHz]']:.3f} MHz, field flatness {q['ff [%]']:.1f} %")
pi-mode 1299.384 MHz, field flatness 30.0 %
inner_only.tuned.plot_axis_field();
../_images/9ffd633ef5b2f43ff462b90cc35ea4d3f378589ade47f6ccab013a1e83523229.png

The pi-mode is close to the target, at 1299.384 MHz, but the field is not flat. It peaks in the middle cell and falls to about 30 % of that in the end cells, a field flatness of 30.0 %: the end cells hardly take part in the accelerating.

3. Tune the inner cells and the end cells

List both cell types in cell_type. The tuner works through them in order: first the inner cells’ equator radius, then the end cells’ half-length L, which it adjusts until the end cells resonate at the same frequency as the inner ones.

both = detuned('inner_and_end')
both.tune.run({'freqs': 1300, 'cell_type': {'mid-cell': 'Req', 'end-cell': 'L'}});

both.tuned.eigenmode.run()
q = both.tuned.eigenmode.qois
print(f"pi-mode {q['freq [MHz]']:.3f} MHz, field flatness {q['ff [%]']:.1f} %")
pi-mode 1300.000 MHz, field flatness 98.3 %
both.tuned.plot_axis_field();
../_images/42206c3239496407e26cec43c7c27d7da35ac0aea18da1e80d61613e7c46b443.png

Now the pi-mode sits at 1300.000 MHz and the field flatness is 98.3 %: the end cells carry nearly the same field as the inner ones.

4. What the tuner changed

tune.qois has one entry per cell type, each with the dimension the tuner changed.

mid = both.tune.qois['mid-cell']['parameters']
end = both.tune.qois['end-cell']['parameters']
print(f"inner cells:  Req = {mid['Req_m']:.3f} mm   (was 108.000)")
print(f"end cells:    L   = {end['L_el']:.3f} mm   (was 57.700)")
inner cells:  Req = 103.367 mm   (was 108.000)
end cells:    L   = 61.076 mm   (was 57.700)

The inner cells’ equator radius came down from 108 to 103.367 mm, the same value the single cell in Tutorial 4 needed. The end cells kept that equator radius and grew longer instead, from 57.7 to 61.076 mm. Next to a beam pipe an end cell resonated too high, and the longer end cell resonates lower, at the same frequency as the rest. The right-hand end of the cavity shows both changes:

ax = both.plot('geometry', show=False, label='detuned', color=WARM[0])
both.plot('geometry', ax=ax, tuned=True, show=False, label='tuned', color=WARM[1])
ax.set_xlim(250, 660)                    # the right-hand end of the cavity
ax.legend(loc='lower left');
../_images/4d35d4d6b36c96f35d433c2d22e2ec7a566e11fb473eb24a6cac8057e0c79149.png

What you learned

  • In a multicell cavity the inner cells set the frequency, and the end cells, which the beam pipes load, set the field flatness.

  • Several entries in cell_type are tuned in turn, in one call: {'mid-cell': 'Req', 'end-cell': 'L'}.

  • cav.tuned.plot_axis_field() shows whether every cell carries the same field.

Next

Compare designs: build several cavities at once, sweep a dimension, and reload saved results.