Home > pubtools > LatticeTuningFunctions > errors > TILT > testerr.m

testerr

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 clear all
0002 close all
0003 
0004 % load lattice
0005 load ../../ESRFLattice.mat
0006 
0007 % get indexes
0008 indq=find(atgetcells(ring,'Class','Quadrupole'));
0009 
0010 % define s-axis rotation errors
0011 dt=1e-6*randn(size(indq)); % random errors of 1um
0012 
0013 % set errors
0014 ringerr=atsettilt(ring,indq,dt);
0015 
0016 % plots
0017 figure('units','normalized','position',[0.3 0.3 0.45 0.35])
0018 atplot(ring,'comment',[],@plClosedOrbit)
0019 saveas(gca,'OrbitNoErrTilt.fig')
0020 export_fig('OrbitNoErrTilt.jpg','-r300')
0021 
0022 figure('units','normalized','position',[0.3 0.3 0.45 0.35])
0023 atplot(ringerr,'comment',[],@plClosedOrbit)
0024 saveas(gca,'OrbitWithErrTilt.fig')
0025 export_fig('OrbitWithErrTilt.jpg','-r300')
0026 
0027 figure('units','normalized','position',[0.3 0.3 0.45 0.35])
0028 s=findspos(ring,indq);
0029 plot(s,dt,'b.');
0030 atplotsyn(gca,ringerr);
0031 axis tight;
0032 xlabel('s [m]');
0033 ylabel('s-axis rotation [rad]');
0034 
0035 saveas(gca,'SetErrTilt.fig')
0036 export_fig('SetErrTilt.jpg','-r300')
0037

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