next up previous contents index
Next: Error Definitions Up: Matching Examples Previous: Insertion Matching   Contents   Index

A Matching Example for LHC

In this case we impose constraints on maximum values of BETX. This is done by means of the vector to scalar function VMAX with the vector-valued function COLUMN.

MATCH;
  BIR2:TWISS,LINE=LHC,RANGE=CELL23;
  IR2:TWISSTRACK,LINE=LHC,RANGE=S.DS.L2/E.DS.R2,INIT=BIR2@S.DS.L2,
       METHOD=LINEAR;

  // Some constraints
  ...;

  // (Part of the ) beta limitation in the dispersion suppressor
  CONSTRAINT,VMAX(COLUMN(IR2,BETX,S.DS.L2/Q7.L2)) < BETMAX,WGT=10;
  CONSTRAINT,VMAX(COLUMN(IR2,BETX,Q7.L2/Q5A.L2))  < 350.0, WGT=10;
  CONSTRAINT,VMAX(COLUMN(IR2,BETX,Q5A.R2/Q7.R2))  < 350.0, WGT=10;
  CONSTRAINT,VMAX(COLUMN(IR2,BETX,Q7.R2/E.DS.R2)) < BETMAX,WGT=10;

  // Some strength limits
  CONSTRAINT,KQ4.L2 > -9.6E-3,WGT=1;
  CONSTRAINT,KQ5.L2 <  9.6E-3,WGT=1;
  CONSTRAINT,KQ6.L2 > -9.6E-3,WGT=1;
  CONSTRAINT,KQ7.L2 <  9.6E-3,WGT=1;

  // Vary commands
  ...;

  // Matching method
  OPTION,LEVEL=3;
  LMDIF,CALLS=200,TOLERANCE=1.E-16;
ENDMATCH;



MAD User Guide, http://wwwslap.cern.ch/mad/