Opticsbuilder: TWISS input file format

If you import a TWISS (MADX output) file, it has to contain the following columns:

  • name
  • keyword (sbend or quadrupole)
  • s
  • L
  • angle
  • K1L
  • X
  • Y
  • PX
  • PY
  • lattice functions betx,bety,alfx,alfy,dx,dy,dpx,dpy

Example MADX command:

select, flag = twiss, column=name, keyword, s, L, angle, K1L, X, Y, px, py, betx, bety, alfx, alfy, dx, dy, dpx, dpy;twiss, file=twiss_sample.tfs;

Make sure you don't use the CENTER option (which would put the centerpoint of elements as S coordinate, instead of the beginning)

  1. The Twiss file should also contain beam emittance (X and Y), energy, energy spread (if known), current. These are optional, the import will be succesful without them but you'll have to manually fill the values on the GUI.

Here is an example Twiss file that you can import.