source: MML/trunk/applications/orbit/lib/svdmax.m

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

Initial import--MML version from SOLEIL@2013

File size: 1.1 KB
Line 
1function varargout=SVDMax(varargin)
2%==========================================================
3%reduce number of singular values until correctors in range
4
5SYS=varargin(1);  SYS=SYS{1};
6BPM=varargin(2);  BPM=BPM{1};
7BL= varargin(3);  BL = BL{1};
8COR=varargin(4);  COR=COR{1};
9RSP=varargin(5);  RSP=RSP{1};
10
11plane=SYS.plane;
12lim_flag=0;
13%lim_flag=CurLim(COR(plane).fit, COR(plane).act, COR(plane).ifit, COR(plane).lim, COR(plane).name);
14if lim_flag==1
15  while lim_flag==1;
16    disp('Warning: Correctors out of range - reduce number of eigenvectors');
17    RSP(plane).nsvd=RSP(plane).nsvd-1;
18    if RSP(plane).nsvd==0
19        error('Number of singular values reduced to zero');
20    end
21    [BPM,BL,COR]=BackSubSystem(plane,SYS,BPM,BL,COR,RSP);
22    %lim_flag=CurLim(COR(plane).ifit, COR(plane).act,COR(plane).fit,COR(plane).lim,COR(plane).name);
23    lim_flag=checklimits(COR(plane).AOFamily, COR(plane).ifit, COR(plane).act(COR(plane).ifit), COR(plane).fit);
24  end
25end
26%disp(['Max number of singular values for correctors in range: ', num2str(RSP(plane).nsvd)]);
27
28varargout{1}=RSP(SYS.plane).nsvd;
Note: See TracBrowser for help on using the repository browser.