close all clear all % In this code we are using a la mode to optimatize the mode matching and % to optimatize the Gouy phase between mirror 1 and mirror 2. All the units % are in meter w0=(50*1e-6)/sqrt(2); % The Waist of the laser measured after SHG z0_laser=-0.0083; % position measured where the waist is located lamb= 532*10^-9; % wavelength of green light in mm lFaraday=.0638; % Length of the faraday % Optical distances dSHG_lens1=.08; % distance from SHG to First lens1 lens1_m1=0.075; % Distance of the first lens to the first mirror m1_m2=0.125; % distance of first mirror to second mirorr m2_faraday=0.04; % distance from mirror to faraday z_FirstMir= .8178; % Distance from the Faraday to the mirror m3_m4= .300; %Distance from mirror 3 to mirror 4 m4_cav= .750; % Distance from mirror 2 to cavity cavLength= 37.79; % cavity length cavR= 59.80; % Radius of curvature of the cavity mirror %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Distances of the lenses from the faraday until the first mirror % d1=.130-lFaraday+abs(z0_laser); % Distance from the Faraday to secondlens d1=.130-lFaraday+(lFaraday-0.0361)+1.95*(0.007); % distance from the faraday to the second lens d2=.082; % distance from the second lens to third lens d3=.280; % distance from the third lens to fourth lens d4=.278; % distance from 4th lens to 3rd mirror %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Absolute Distance between the lenses and mirrors where the origin is % taken to be the begining of the faraday % start from SHG dlens1=dSHG_lens1; % distance from the SHG to the first lens dmirr1=dlens1+lens1_m1; % distance from the SHG to mirror1 dmirr2= dmirr1+m1_m2; % distance from the SHG to mirror2 dfaraday=dmirr2+m2_faraday; %distance from the SHG to faraday dlens2=dfaraday + d1; % distance from the SHG to 2nd lens dlens3=dlens2+d2; % distance from the SHG to 3rd lens dlens4=dlens3+d3; %distance from the SHG to 4th lens dmirr3=dlens4+d4; % distance from the SHG to 3rd mirror dmirr4=dmirr3+m3_m4 + 2*.0254;% distance from the SHG to 4th mirror dmirr5=dmirr4+sqrt(m3_m4^2 + (4*.0254)^2); dmirr6=dmirr5 + (dmirr4-dmirr3); % dmirr4=dmirr3+m3_m4;% distance from the SHG to 4th mirror % dETM=dmirr4+m4_cav; % distance from the SHG to the ETM dETM=dmirr6+12*.0254+.35; % distance from the SHG to the ETM dITM=dETM+cavLength; % distance from the SHG to the ITM % dlens5=dmirr5 + 2*0.0254; % initial location of lens5 % dlens6=dmirr6 + 2*0.0254; % initial location of lens6 dlens5=dmirr4 + 2*0.0254; % initial location of lens5 dlens6=dmirr5 + 2*0.0254; % initial location of lens6 z0=z0_laser; % distance of the waist of the laser away from the %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% greenxarm = beamPath; % defining the beamPath % Waist inside the Cavity wInsideCav=sqrt((lamb/pi)*sqrt(cavLength*(cavR-cavLength))); greenxarm.seedWaist(w0, z0,lamb); % initial waist position % greenxarm.seedWaist(wInsideCav,dITM-1,lamb); % set the waist of the laser beam and its % % position % greenxarm.targetWaist(wInsideCav,dITM,lamb); % targetWaist and its position %%%%%%%%%%%%% Let's take the ETM as it is a lens which focal is given by % the LensMaker's Equation 1/f=(n-1)[1/R1- 1/R2 + (n-1)d/(nR1R2) % Calculation of index of refraction wavelen=(532e-9)*1000000; % in micrometer n=sqrt(1 + (0.68374049400*(wavelen^2)/((wavelen^2)-0.00460352869)) + ... (0.42032361300*(wavelen^2)/((wavelen^2)-0.01339688560)) + ... (0.58502748000*(wavelen^2)/((wavelen^2)-64.49327320000))); fCurveMirror=-cavR/(n-1); % Adding all the mirrors components greenxarm.addComponent(component.flatMirror(dmirr1,'First mirror')); greenxarm.addComponent(component.flatMirror(dmirr2,'Second mirror')); greenxarm.addComponent(component.flatMirror(dmirr3,'Third mirror')); greenxarm.addComponent(component.flatMirror(dmirr4,'Fourth mirror')); greenxarm.addComponent(component.flatMirror(dmirr5,'Fifth mirror')); greenxarm.addComponent(component.flatMirror(dmirr6,'Sixth mirror')); greenxarm.addComponent(component.lens(fCurveMirror,dETM,'ETM')); greenxarm.addComponent(component.flatMirror(dITM,'ITM')); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % focal length of the lenses in meter f1=.100; % focal length of first lens f2=-.100; % focal length of first lens f3=-.4484; % focal length of second lens f4=.4; % focal length of third lens f5=-.1; % this will be change in the optimization f6=.1; % this will be change in the optimization %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Adding all the lenses components greenxarm.addComponent(component.lens(f1,dlens1, 'lens 1')); greenxarm.addComponent(component.lens(f2,dlens2, 'lens 2')); greenxarm.addComponent(component.lens(f3,dlens3, 'lens 3')); greenxarm.addComponent(component.lens(f4,dlens4, 'lens 4')); greenxarm.addComponent(component.lens(f5,dlens5, 'lens 5')); greenxarm.addComponent(component.lens(f6,dlens6, 'lens 6')); % new lenses adding % figure(1) % greenxarm.plotSummary(-1:.1:2) % set(0, 'DefaultAxesFontSize', 20); % set(findall(gcf,'type','text'),'fontSize',20) % set(gcf,'DefaultLineLineWidth',1) % % figure(2) % greenxarm.plotSummary() % set(0, 'DefaultAxesFontSize', 20); % set(findall(gcf,'type','text'),'fontSize',20) % set(gcf,'DefaultLineLineWidth',1) %%%%%%%%%%%%%%%%%%%%%%%%% % Optimization %Type of lenses we have divergingFocalList = [-.1;-.125;-.15;-.25;-.5;inf]; convergingFolcaList = [.1;.125;.150;.200;.175;.25;.3;.400;.500;.600;.700;.750;inf]; % This will give us the right Gouy phase between mirrors (zR ~= mirror % spacing) % greenxarm.targetWaist(225e-6,z_FirstMir+m1_m2/2,532e-9); % greenxarm.targetWaist(600e-6,(dmirr2-dmirr4)/2,532e-9); % greenxarm.targetWaist(600e-6,(dmirr2-dmirr4)/2,532e-9); greenxarm.targetWaist(200e-6,dmirr3-3*.0254+(dmirr4-dmirr3)/2,532e-9); divLensList = component.lens(divergingFocalList); conLensList = component.lens(convergingFolcaList); conLens1=component.lens(f1); dlens_4=dlens4 + 4*.0254; [pathList, overlapList]=greenxarm.chooseComponents( ... 'lens 1', conLens1, [dlens1 dlens1], ... 'lens 2', divLensList, [dlens2 dlens2], ... 'lens 3', [divLensList;conLensList],[dlens3 (dlens3+8*.0254)], ... 'lens 4', [conLensList;divLensList],[dlens_4 (dlens_4 +5*.0254)], ... '-v', ... '-t', .5); % figure(1) % pathList(1).plotSummary(-.1:.01:2) % figure(4) % pathList(1).plotSummary() pathWithInputLensesOptimized = pathList(1); % pathWithInputLensesOptimized.targetWaist(wInsideCav,dITM,lamb); disp('Now matching into arm cavity'); [pathList1, overlapList1]=pathWithInputLensesOptimized.chooseComponents(... 'lens 5', [divLensList], ... ... %[dmirr5+2*.0254 dlens5+(8*0.0254)], ... [dlens5 dmirr5-2*0.0254], ... 'lens 6', conLensList, [dlens6 dmirr6+(3*0.0254)], ... '-v', ... '-t', 0); pathList1(1).components figure(1) pathList1(1).plotSummary(-.5:.01:3) set(0, 'DefaultAxesFontSize', 20); set(findall(gcf,'type','text'),'fontSize',18) set(gcf,'DefaultLineLineWidth',1) figure(2) pathList1(1).plotSummary() % This just show the entire range set(0, 'DefaultAxesFontSize', 20); set(findall(gcf,'type','text'),'fontSize',20) set(gcf,'DefaultLineLineWidth',1)