Home > atdemos > atmatchExamples > FitQuadrupoleLength > run_MatchQuadLengthForEqualK1.m

run_MatchQuadLengthForEqualK1

PURPOSE ^

run the matching on S10 ESRF upgrade arc lattice

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 run the matching on S10 ESRF upgrade arc lattice

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % run the matching on S10 ESRF upgrade arc lattice
0002 
0003 load('dba.mat','RING');
0004 addpath(fullfile(pwd,'..'))
0005 %arc=[RING(1:18);RING(128:end)];
0006 arc0=RING;
0007 
0008 DK1_b=compK1(arc0,indQFM,indQF);
0009 LQ6_b=getcellstruct(arc0,'Length',indQF)*length(indQF);
0010 LQ8_b=getcellstruct(arc0,'Length',indQFM)*length(indQFM);
0011 
0012 % slowly reduce gradient gap, changing length of 2 quadrupoles.
0013 % during the optimization the cell optics are kept constant retuing all
0014 % quadrupoles.
0015 arc1=arc0;
0016 warning off;
0017 for deltaKQ=[(DK1_b-0.1):-0.2:0.0 0.0]
0018 arc1=MatchQuadLengthForEqualK1(arc1,deltaKQ);
0019 end
0020 warning on;
0021 
0022 indQF=findcells(arc1,'FamName','QF') ;
0023 indQFM=findcells(arc1,'FamName','QFM') ;
0024 
0025 
0026 DK1_a=compK1(arc1,indQF,indQFM);
0027 LQ6_a=getcellstruct(arc1,'Length',indQF)*length(indQF);
0028 LQ8_a=getcellstruct(arc1,'Length',indQFM)*length(indQFM);
0029 
0030 
0031 disp('      before     after')
0032 disp([['DK1  ';'LQF  ';'LQFM ';'sum L'],...
0033     num2str([[DK1_b;LQ6_b(1);LQ8_b(1);LQ6_b(1)+LQ8_b(1)],...
0034     [DK1_a;LQ6_a(1);LQ8_a(1);LQ6_a(1)+LQ8_a(1)]],'   %1.5f')])
0035

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005