0001 function arctune0=atmatchtunedelta(arc,tune,quadfams)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 variabs=[];
0016
0017 for iquadfams=1:length(quadfams)
0018 KQ=cellfun(@(a)a.PolynomB(2),arc(quadfams{iquadfams}),'un',1);
0019 variabs=[variabs, atVariableBuilder(arc,...
0020 {@(r,DKquad)setcellstruct(r,'PolynomB',quadfams{iquadfams},KQ+DKquad,1,2)},...
0021 {[1e-8]})];
0022 end
0023
0024 ConstrQX=struct(...
0025 'Fun',@(~,ld,~)mux(ld),...
0026 'Weight',1,...
0027 'RefPoints',[1:length(arc)+1],...
0028 'Min',tune(1),...
0029 'Max',tune(1));
0030
0031 ConstrQY=struct(...
0032 'Fun',@(~,ld,~)muy(ld),...
0033 'Weight',1,...
0034 'RefPoints',[1:length(arc)+1],...
0035 'Min',tune(2),...
0036 'Max',tune(2));
0037
0038
0039
0040
0041 tol=1e-8;
0042 arctune0=arc;
0043 arctune0=atmatch(arctune0,variabs,[ConstrQX ConstrQY],tol,50,3);
0044
0045
0046 return
0047
0048 function m=muy(lindata)
0049
0050 m=lindata(end).mu(2)/2/pi;
0051
0052 return
0053
0054 function m=mux(lindata)
0055
0056 m=lindata(end).mu(1)/2/pi;
0057
0058 return