Home > atphysics > Orbit > plotcod.m

plotcod

PURPOSE ^

PLOTCOD Closed Orbit Distortion

SYNOPSIS ^

function varargout = plotcod(RING,DP)

DESCRIPTION ^

PLOTCOD Closed Orbit Distortion
 PLOTCOD(RING,DP) finds and plots closed orbit for a given momentum 
  deviation DP. It calls FINDORBIT4 which assumes a lattice
  with NO accelerating cavities and NO radiation

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function varargout = plotcod(RING,DP)
0002 %PLOTCOD Closed Orbit Distortion
0003 % PLOTCOD(RING,DP) finds and plots closed orbit for a given momentum
0004 %  deviation DP. It calls FINDORBIT4 which assumes a lattice
0005 %  with NO accelerating cavities and NO radiation
0006 
0007 localspos = findspos(RING,1:length(RING)+1);
0008 orbit = findorbit4(RING,DP,1:length(RING)+1);
0009 
0010 
0011 plot(localspos,orbit(1,:),'.-r');
0012 title('Closed Orbit Distortion')
0013 hold on
0014 plot(localspos,orbit(3,:),'.-b');
0015 hold off
0016 
0017 A = axis;
0018 A(1) = 0;
0019 A(2) = localspos(end);
0020 axis(A);
0021 
0022 legend('Horizontal','Vertical');
0023 xlabel('s - position [m]');
0024 ylabel('orbit [m]');
0025 
0026 grid on
0027 
0028 if nargout > 0
0029     varargout{1} = orbit;
0030 end

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