source: MML/trunk/mml/at/plotcod_alex.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.2 KB
Line 
1function varargout = plotcod(RING,DP)
2%PLOTCOD Closed Orbit Distortion
3% PLOTCOD(RING,DP) finds and plots closed orbit for a given momentum
4%  deviation DP. It calls FINDORBIT4 which assumes a lattice
5%  with NO accelerating cavities and NO radiation
6%
7%  INPUTS
8%  1. RING - At structure
9%  2. DP   - Energy offset
10%
11%  OUTPUTS (Optional)
12%  1. orbit - (x,px,y,py) closed orbit along the ring
13%
14%  See Also plotbeta
15
16%  Written by Andrei Terebilo
17%  Modified by Laurent S. Nadolski
18%  March 27, 2005 - Default input arguments added
19
20switch nargin
21    case 0
22        global THERING;
23        RING = THERING;
24        DP = 0.0; % on mometum closed orbit
25    case 1
26        DP = 0; % on momentum closed orbit
27    otherwise
28        %do nothing
29end
30   
31
32localspos = findspos(RING,1:length(RING)+1);
33orbit = findorbit4(RING,DP,1:length(RING)+1);
34%orbit = findorbit6(RING,1:length(RING)+1);
35
36plot(localspos,orbit(1,:)*1e3,'.-r');
37title('Closed Orbit Distortion')
38hold on
39plot(localspos,orbit(3,:)*1e3,'.-b');
40hold off
41
42A = axis;
43A(1:2) =  [0, localspos(end)];
44axis(A);
45
46legend('Horizontal','Vertical');
47xlabel('s - position [m]');
48ylabel('orbit [mm]');
49
50grid on
51
52if nargout > 0
53        varargout{1} = orbit;
54end
Note: See TracBrowser for help on using the repository browser.