Home > pubtools > calc_dppAperture.m

calc_dppAperture

PURPOSE ^

calculate the momentum aperture at each location of the ring due to

SYNOPSIS ^

function [deltap,deltam, indextab] = calc_dppAperture(THERING, varargin)

DESCRIPTION ^

calculate the momentum aperture at each location of the ring due to
transverse dynamic. 
Tracking including longitudinal motion and radiation damping
[deltap,deltam, indextab] = calc_dppAperture.m(THERING)
[deltap,deltam, indextab] = calc_dppAperture.m(THERING, PAmarker, PAlim)
 For SPEAR PAmarkder = 'SEPTUM'; PAlim=[-0.025 0.025 -0.005 0.005]
[deltap,deltam, indextab] = calc_dppAperture.m(THERING, PAmarker, PAlim, Vrf)
 Vrf in MV
output:
   deltap, deltam, lists of postive and negative momentum aperture at
   elements indexed by indextab

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [deltap,deltam, indextab] = calc_dppAperture(THERING, varargin)
0002 %calculate the momentum aperture at each location of the ring due to
0003 %transverse dynamic.
0004 %Tracking including longitudinal motion and radiation damping
0005 %[deltap,deltam, indextab] = calc_dppAperture.m(THERING)
0006 %[deltap,deltam, indextab] = calc_dppAperture.m(THERING, PAmarker, PAlim)
0007 % For SPEAR PAmarkder = 'SEPTUM'; PAlim=[-0.025 0.025 -0.005 0.005]
0008 %[deltap,deltam, indextab] = calc_dppAperture.m(THERING, PAmarker, PAlim, Vrf)
0009 % Vrf in MV
0010 %output:
0011 %   deltap, deltam, lists of postive and negative momentum aperture at
0012 %   elements indexed by indextab
0013 %
0014 
0015 if nargin>=3
0016    PAmarkder = varargin{1};
0017    PAlim = varargin{2};
0018 
0019    ati = atindex(THERING);
0020    sepindx = eval(['ati.' PAmarkder]); %ati.SEPTUM;
0021    THERING{sepindx}.Limits = PAlim; %[-0.025 0.025 -0.005 0.005];   %apply physical aperture
0022    THERING{sepindx}.PassMethod = 'AperturePass';
0023 end
0024 
0025 ati = atindex(THERING);
0026 Vrf = 3200000;
0027 if nargin>=4
0028    Vrf = varargin{3}*1.0e6; %Volt
0029 end
0030 %THERING = setcellstruct(THERING,'Voltage', ati.RF, Vrf);
0031 %THERING = setcellstruct(THERING,'PassMethod', ati.RF, 'ThinCavityPass');
0032 %turn cavity on
0033 %cavityon(3e9);
0034 
0035 %turn radiation on
0036 %bi = findcells(THERING,'PassMethod','BendLinearPass');
0037 %bi = sort([ati.BND, ati.B34]);
0038 bi = findcells(THERING,'BendingAngle');
0039 k = getcellstruct(THERING,'K',bi);
0040 THERING = setcellstruct(THERING,'Energy', bi, 3e9); 
0041 THERING = setcellstruct(THERING,'PolynomA',bi,0,1,2);
0042 THERING = setcellstruct(THERING,'PolynomB',bi,k,1,2);
0043 THERING = setcellstruct(THERING,'NumIntSteps',bi,10);
0044 THERING = setcellstruct(THERING,'MaxOrder',bi,1);
0045 THERING = setcellstruct(THERING,'PassMethod',bi,'BndMPoleSymplectic4RadPass');
0046 
0047 %allspos = findspos(THERING, 1:length(THERING));
0048 [curH,allspos]= getcurH(THERING);
0049 curH(length(allspos)+1)=curH(length(allspos)); %add an extra element for the last value.
0050 cnt = 0;
0051 RING0 = THERING;
0052 epsH=1e-7;
0053 tic
0054 for ii=1:length(allspos)
0055    if (RING0{ii}.Length>0 && abs(curH(ii+1)-curH(ii))>epsH)
0056       
0057        cnt = cnt + 1;
0058       
0059       indextab(cnt) = ii;
0060       THERING = [RING0(ii:end), RING0(1:ii-1)];
0061       [dplus,dminus] = track4dppAp(THERING, 500)
0062       deltap(cnt) = dplus;
0063       deltam(cnt) = dminus;
0064    end
0065 end
0066 toc
0067 
0068 [deltap,deltam] = atmomap(ring, Nturn);

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