

% ComputeVCMParametersATBC('UT2',2,2,OPL/2,0,-1) after redefining
% UTPupilBeforeDL
% in the code  ( )


%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
% Effect of AT3-STS-VCM ROC=-730mm
% Located on A0 and using DL1
% CHECK for UTPupilBeforeDL from U= 50.625m to U=-6.476m
% AT-STS-A0
% Check ComputeVCMParametersATBC values for proper UTExitPupiluCoordinate!
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


OPL=[120:-5:10 ];

radius=[];
PIN=[];
POUT=[];

for i=1:length(OPL);
    %ComputeVCMParametersATBC(TelescopeStation,DL,IP,DLPOS_mech,pupil Offset,-1)
[RadiusVCMGIP, DistanceInputPupil, DistanceExitPupil, DistanceExitPupilFixedVCM]=ComputeVCMParametersATBC('UT1',1,2,OPL(i)/2,0,-1)
radius=[radius,RadiusVCMGIP];
PIN=[PIN,DistanceInputPupil];
POUT=[POUT,DistanceExitPupil];

end;


% VCM radius  range [150 mm ... 2800 mm]
% 150 mm = software limit; Remark: hardware lower limit = 84 mm
% It is suggested to use a radius R = 2.800000e+000 m

h=figure(2);
set(gca,'FontSize',13);
plot(OPL,radius,'k',OPL,radius,'go',OPL,150e-3*ones(1,length(OPL)),'r',OPL,84e-3*ones(1,length(OPL)),'m',OPL,2800e-3*ones(1,length(OPL)),'r');grid
xlabel('OPL in m');ylabel('DL1-VCM ROC in m');
title(' DL1-VCM-ROC for AT3-A1-DL1-Ip2 with STS-VCM-ROC=-730mm')
legend(' DL1-VCM-ROC ')

h=figure(3);
set(gca,'FontSize',13);
plot(OPL,1./radius, 'k',OPL,1./(radius),'go',OPL,1/150e-3*ones(1,length(OPL)),'r',OPL,1/84e-3*ones(1,length(OPL)),'m',OPL,1/2800e-3*ones(1,length(OPL)),'r');grid
xlabel('OPL in m');ylabel('DL1-VCM Curvature in m-1');
title('  DL1-VCM-Curv for AT3-A1-DL1-Ip2 with STS-VCM-ROC=-730mm')
legend(' DL1-VCM-Curv ')