Option, warn,info,echo; Title, "LHC 6.5 with errors and orbit correction using MADX"; // CALL IN SELECTION, SEQUENCE and OPTICS FILES; Option, -echo,-warn,-info; call, file = "../share/LHC/LHCRing/V6.503/V6.5.seq"; call, file = "../share/LHC/LHCRing/V6.503/V6.5.coll.str"; option,warn,echo; Beam, particle=proton, sequence=lhcb1, energy=450.0, NPART=1.05E11, sige=4.5e-4 ; // First make a clean machine as the model ... Use, period=lhcb1; on_x1 = 0.0; on_x2 = 0.0; on_x5 = 0.0; on_x8 = 0.0; on_alice = 0.0; on_lhcb = 0.0; select, flag=twiss, clear; select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; TWISS,table=my_model,sequence=lhcb1; // Now a machine with the bumps as a target orbit on_x1 = 1.0; on_x2 = 1.0; on_x5 = 1.0; on_x8 = 1.0; on_alice = 0.0; on_lhcb = 0.0; select, flag=twiss, clear; select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; TWISS,table=my_target1,sequence=lhcb1; !plot,table=my_target1,title="Target orbit 1 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x; !plot,table=my_target1,title="Target orbit 1 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y; // Now a machine with the modified bumps as another target orbit on_x1 = 1.0; on_x2 = 0.5; on_x5 = 1.0; on_x8 = 0.3; on_alice = 0.0; on_lhcb = 0.0; select, flag=twiss, clear; select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; TWISS,table=my_target2,sequence=lhcb1; !plot,table=my_target2,title="Target orbit 2 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x; !plot,table=my_target2,title="Target orbit 2 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y; // Switch off again the bumps and mis-align the machine on_x1 = 0.0; on_x2 = 0.0; on_x5 = 0.0; on_x8 = 0.0; on_alice = 0.0; on_lhcb = 0.0; !****************************************************************** eoption, add=false, seed=22021955; Select, flag=ERROR, clear; Select, flag=ERROR, class=MQ; ealign, dy:=tgauss(2.5)*0.100e-3, dx:=tgauss(2.5)*0.070e-3; !****************************************************************** select, flag=twiss, clear; select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; twiss, table=my_orbit,sequence=lhcb1; !plot,table=my_orbit,title="Uncorrected orbit x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x; !plot,table=my_orbit,title="Uncorrected orbit y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y; // Prepare first correction to zero orbit USEKICK,CLASS=MBLW, status=OFF; ! IR8 spectrometer magnets USEKICK,CLASS=MBXWH, status=OFF; ! IR8 spectrometer magnets USEKICK,CLASS=MBXWS, status=OFF; ! IR8 spectrometer magnets USEKICK,CLASS=MBXWT, status=OFF; USEKICK,CLASS=MSDB, status=OFF; USEKICK,CLASS=MKA, status=OFF; USEKICK,CLASS=MCBYH, status=OFF; USEKICK,CLASS=MCBYV, status=OFF; ! USEKICK,CLASS=MCBX, status=OFF; USEKICK,class=MKI, status=OFF; USEKICK,class=MKI__192, status=OFF; USEKICK,class=MKI__193, status=OFF; USEKICK,class=MKA, status=OFF; USEKICK,class=MKD, status=OFF; USEKICK,class=MKQ, status=OFF; USEKICK,class=MSDA, status=OFF; USEKICK,class=MSDB, status=OFF; USEKICK,class=MSDB2, status=OFF; USEKICK,class=MSDC, status=OFF; USEKICK,class=MSIA, status=OFF; USEKICK,class=MSIB, status=OFF; USEKICK,class=MBXWS, status=OFF; USEKICK,RANGE=MBAW.1R2, status=OFF; ! IP2 spectrometer compensation USEKICK,RANGE=MBWMD.1L2, status=OFF; ! IP2 spectrometer compensation coption,print=2; CORRECT, FLAG=ring,orbit=my_orbit,model=my_model, MODE=micado,cond=1,NCORR=300,ERROR=1E-6,PLANE=y, mlist=my.tab,clist='cy.tab', RESOUT=1,corzero=1; CORRECT, FLAG=ring,orbit=my_orbit,model=my_model, MODE=micado,cond=1,NCORR=300,ERROR=1E-6,PLANE=x, mlist=mx.tab,clist='cx.tab', RESOUT=1,corzero=1; !****************************************************************** on_x1 = 0.0; on_x2 = 0.0; on_x5 = 0.0; on_x8 = 0.0; on_alice = 0.0; on_lhcb = 0.0; // mis-align the machine with the same errors for test of // the correction eoption, add=false, seed=22021955; Select, flag=ERROR, clear; Select, flag=ERROR, class=MQ; ealign, dy:=tgauss(2.5)*0.100e-3, dx:=tgauss(2.5)*0.070e-3; select, flag=twiss, clear; select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; TWISS,file=result.file,sequence=lhcb1; !plot,title="Corrected orbit x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x; !plot,title="Corrected orbit y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y; // Prepare first correction to target orbit my_target1 USEKICK,CLASS=MCBYH, status=ON; ! Mark USEKICK,CLASS=MCBYV, status=ON; ! Mark USEKICK,CLASS=MCBX, status=ON; ! Mark CORRECT, FLAG=ring,orbit=my_orbit,target=my_target1,model=my_model, MODE=micado,cond=1,NCORR=300,ERROR=1E-6,PLANE=y, mlist=my.tab,clist='cy.tab', RESOUT=1,corzero=1; CORRECT, FLAG=ring,orbit=my_orbit,target=my_target1,model=my_model, MODE=micado,cond=1,NCORR=300,ERROR=1E-6,PLANE=x, mlist=mx.tab,clist='cx.tab', RESOUT=1,corzero=1; !****************************************************************** on_x1 = 0.0; on_x2 = 0.0; on_x5 = 0.0; on_x8 = 0.0; on_alice = 0.0; on_lhcb = 0.0; // mis-align the machine with the same errors for test of // the correction eoption, add=false, seed=22021955; Select, flag=ERROR, clear; Select, flag=ERROR, class=MQ; ealign, dy:=tgauss(2.5)*0.100e-3, dx:=tgauss(2.5)*0.070e-3; select, flag=twiss, clear; select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; TWISS,file=result.file,sequence=lhcb1; !plot,title="Corrected orbit target 1 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x; !plot,title="Corrected orbit target 1 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y; // Prepare second correction to target orbit my_target2 USEKICK,CLASS=MCBYH, status=ON; ! Mark USEKICK,CLASS=MCBYV, status=ON; ! Mark USEKICK,CLASS=MCBX, status=ON; ! Mark USEKICK,RANGE=mcbyh.a4l1.b1, status=OFF; USEKICK,RANGE=mcbxa.3r2, status=OFF; USEKICK,RANGE=mcbx.2l2, status=OFF; // USEKICK,RANGE=mcbx.1l5, status=OFF; // USEKICK,RANGE=mcbx.1r5, status=OFF; CORRECT, FLAG=ring,orbit=my_orbit,target=my_target2,model=my_model, MODE=micado,cond=1,NCORR=300,ERROR=1E-6,PLANE=x, mlist=mx.tab,clist='cx.tab',RESOUT=1,corzero=1; CORRECT, FLAG=ring,orbit=my_orbit,target=my_target2,model=my_model, MODE=micado,cond=1,NCORR=300,ERROR=1E-6,PLANE=y, mlist=my.tab,clist='cy.tab', RESOUT=1,corzero=1; !****************************************************************** on_x1 = 0.0; on_x2 = 0.0; on_x5 = 0.0; on_x8 = 0.0; on_alice = 0.0; on_lhcb = 0.0; // mis-align the machine with the same errors for test of // the correction eoption, add=false, seed=22021955; Select, flag=ERROR, clear; Select, flag=ERROR, class=MQ; ealign, dy:=tgauss(2.5)*0.100e-3, dx:=tgauss(2.5)*0.070e-3; !****************************************************************** select, flag=twiss, clear; select, flag=twiss, column=name,s,x,px,y,py,betx,bety,alfx,alfy; TWISS,file=result.file,sequence=lhcb1; !plot,title="Corrected orbit target 2 x...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=x; !plot,title="Corrected orbit target 2 y...",noline=true,vmin=-0.012,vmax=0.012,haxis=s,vaxis=y;