Home > atphysics > TouschekPiwinski > simpletestToucheckLT.m

simpletestToucheckLT

PURPOSE ^

simple example of use of toucheck lifetime formula:

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 simple example of use of toucheck lifetime formula:
 [Tl,contributionsTL]=TouschekPiwinskiLifeTime(r,dpp,Ib,varargin)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % simple example of use of toucheck lifetime formula:
0002 % [Tl,contributionsTL]=TouschekPiwinskiLifeTime(r,dpp,Ib,varargin)
0003 
0004 close all
0005 
0006 global GLOBVAL
0007 GLOBVAL.E0=0.51e9;
0008 E0=0.51e9;
0009 
0010 load('dba.mat','RING'); %small DBA ring
0011 
0012 %% add rf cavity
0013 rf.('HarmNumber')=4;%*32
0014 rf.('Length')=0;%*32
0015 rf.('Energy')=E0;%*32
0016 rf.('PassMethod')='IdentityPass';%*32
0017 rf.('Class')='Cavity';%*32
0018 cl=299792458;
0019 larc=findspos(RING,length(RING)+1);
0020 rf.('Frequency')=cl/larc*rf.('HarmNumber');
0021 rf.('Voltage')=0.5e6;%rf.('Voltage');
0022 RING=[{rf};RING];
0023 
0024 
0025 %% define relevant positions for evaluation of momentum aperture and LT
0026 % this positions are default selection in the TouschekPiwinskiLifeTime.m
0027 % function
0028 positions=findcells(RING,'Length');
0029 L=getcellstruct(RING,'Length',positions);
0030 positions=positions(L>0);
0031     
0032 %% get energy sperad and bunch length
0033 RING=atradon(RING);
0034 [l,a]=atx(RING,0,1);
0035 %a.espread;
0036 %a.blength;
0037 
0038 nturns=5; %% put 500! 5 is only for speed reason in the test
0039 %% get momentum aperture
0040 %(this or any better function)
0041 [dppM,dppP]=MomAperture_allRing(RING,positions,nturns);%
0042 
0043 % current per bunch
0044 
0045 Ib=0.2; % mA
0046 
0047 %% evaluate Life Time
0048 
0049 % basic mode, constant momentum aperture
0050 TL=TouschekPiwinskiLifeTime(RING,0.03,Ib)/3600;
0051 disp(' basic mode, constant momentum aperture: ')
0052 disp(TL)
0053 % one sided momentum aperture.
0054 TL=TouschekPiwinskiLifeTime(RING,dppM,Ib)/3600;
0055 disp('one sided momentum aperture :')      
0056 disp(TL)      
0057 % two sided momentum aperture: 1/Ttot=1/2(1/Tup+1/Tdown)
0058 TL=TouschekPiwinskiLifeTime(RING,[dppM dppP],Ib)/3600;
0059 disp('two sided momentum aperture: 1/Ttot=1/2(1/Tup+1/Tdown) :')      
0060 disp(TL)
0061 % input positions
0062 TL=TouschekPiwinskiLifeTime(RING,[dppM dppP],Ib,positions)/3600;
0063 disp('input positions :')      
0064 disp(TL)
0065 % input positions and emittances
0066 TL=TouschekPiwinskiLifeTime(RING,[dppM dppP],Ib,positions,10e-9,10e-12)/3600;
0067 disp('input positions and emittances :')      
0068 disp(TL)
0069 % input positions and emittances and integration method
0070 TL=TouschekPiwinskiLifeTime(RING,[dppM dppP],Ib,positions,10e-9,10e-12,'quad')/3600;
0071 disp('input positions and emittances and integration method :')      
0072 disp(TL)
0073 % input positions and emittances and integration method and bumchelenght
0074 % and energy spread
0075 TL=TouschekPiwinskiLifeTime(RING,[dppM dppP],Ib,positions,10e-9,10e-12,'quad',a.espread,a.blength)/3600;
0076 disp('input positions and emittances and integration method and bunch lenght and energy spread :')      
0077 disp(TL)
0078

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