Advertisement
rgbanks1995

old computational project

Dec 21st, 2020
1,540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 5.21 KB | None | 0 0
  1. clear variables
  2. close all
  3. load ndyag
  4. solar = csvread('ASTMG173_Solar_data.csv',2,0,'A3..B2004');
  5. %808nm occurs at row 649
  6. solar_wav = solar(:,1);
  7. solar_em = solar(:,2);
  8. %Constants
  9. c = 3e8;
  10. k = 1.3806505e-23;
  11. h = 6.63e-34;
  12. hbar = h/2*pi;
  13.  
  14. %Let's try and create the Pedrotti cavity first!
  15. R_1 = 2;                 %Radius of mirror one (m)
  16. R_2 = [1 2 3 10];        %Radius of mirror two (m)
  17. d = 0.5;                 %Cavity length (m)
  18. Pp = 700;                %Input power (full spectrum) (W)
  19. r_1 = 0.99;              %Reflectivity of first mirror (i.e. 99%)
  20. r_2 = 0.95;              %Reflectivity of second mirror (i.e. 90%)
  21. ndyag_wav = NdYAG(:,1);  %Wavelengths of Nd:YAG spectrum
  22. ndyag_abs = NdYAG(:,2);  %Corresponding absorption coefficients
  23. irr_808 = solar_em(649)/sum(solar_em(:));   %Total solar irradiance required
  24. pump_wav = 808e-9;       %Wavelength of pump (m)
  25. pump_fre = c/pump_wav;   %Frequency of pump (Hz)
  26. N = 10e20;               %Number of Nd ions/cm^3
  27. sig = 7.6e-19;           %Stim emission cross section for 808nm transition (cm^2)
  28. tau = 230e-6;            %Fluorescent lifetime of Nd:YAG (s)
  29. gamma = (1-r_1)+(1-r_2); %Example fractional round trip loss
  30. r = 1.5e-3;              %Radius of Nd:YAG crystal
  31. L = 20e-3;               %Length of Nd:YAG crystal
  32. vol = pi*r^2*L;          %Volume of Nd:YAG crystal (cm^3)
  33. Pp_thr = (gamma*h*pump_fre*pi)/(2*sig*tau);
  34. Pp_thr_full = Pp_thr/irr_808; %Pump threshold of solar energy if only relying on 808nm part
  35. N_thr = gamma/(2*sig*L);
  36. Rp_thr = N_thr/tau;      %Threshold pump rate
  37. out_wav = 1064e-9;       %Wavelength of laser
  38. out_fre = c/out_wav;     %Frequency of laser
  39. cols = {'r-','b-','y-','g-','p-'};
  40. mirrorcols = {'r--','b--','y--','g--','p--'};
  41. I_0 = 1;                 %Maximum intensity of laser
  42.  
  43.  
  44. %stable = zeros(1, length(R_2));
  45. z_0 = zeros(1, length(R_2));                %Empty array for z_0
  46. z_1 = zeros(1, length(R_2));                %Empty array for z_1
  47. z_2 = zeros(1, length(R_2));                %Empty array for z_2
  48.  
  49. for i = 1:length(R_2)
  50. stable(1,i) = (1-(d/R_1))*(1-(d/R_2(i)));
  51. z_0(1,i) = sqrt((d*(R_1-d)*(R_2(i)-d)*(R_1+R_2(i)-d))/(R_1+R_2(i)-2*d)^2); %Calculates z_0 for a given R_2
  52. z_1(1,i) = -R_1/2 + sqrt((R_1^2-(4*z_0(1,i)^2))/4);                        %Calcualtes z_1 for a given R_2
  53. z_2(1,i) = R_2(i)/2 - sqrt((R_2(i)^2-(4*z_0(1,i)^2))/4);                   %Calculates z_2 for a given R_2
  54. end
  55.  
  56. for i = 1:length(z_0)
  57.     z(i,:) = linspace(z_1(1,i),2,20000);
  58. end
  59.  
  60. w_0sq = (z_0*out_wav)/pi;                       %Radius of beam waist (squared)
  61. w_0 = sqrt(w_0sq);                              %Radius of beam waist
  62. w = zeros(1,length(z));                         %For calculating beam radius at different locations
  63. R = zeros(1,length(z));                         %For calculating wavefront radius of curvature at different locations
  64. all_w = cell(1,length (R_2));                   %Stores radius arrays
  65. for i = 1:length(w_0)
  66.     rho(i,:) = linspace(0,2*w_0(1,i),20);       %Different values for distance from beam centre
  67. end
  68.  
  69. I = zeros(length(rho),length(z));
  70. all_I = cell(1,length(R_2));
  71.  
  72. for j = 1:length(R_2)
  73.     rho_loop = rho(j,:);
  74.     for i = 1:length(z)
  75.         for k = 1:length(rho)
  76.         w(1,i) = sqrt(w_0sq(1,j)*(1+(z(1,i)^2/z_0(1,j)^2)));    %Calculates radius along direction of propagation
  77.        
  78.         R(1,i) = z(1,i)*(1+(z(1,i)^2/z_0(1,j)^2));              %Calculates wavefront radius of curvature along direction of propagation
  79.         I(k,i) = I_0*(w_0(1,j)/w(1,i))^2*exp(-2*rho_loop(k)^2/w(1,i)^2);%Calculates relative intenstiy along direction of propagation
  80.         end
  81.     end
  82.     all_w{j} = w;
  83.     all_w_down{j} = -w;
  84.     all_I{j} = I;
  85.     all_R{j} = R;
  86. end
  87.  
  88. figure; hold on                 %For plotting irradiance profiles
  89. for i = 1:length(R_2)
  90. I = all_I{i};
  91. plot(z(1,:),I(1,:),cols{i})
  92. title('Irradiance profile of beam (\rho = 0)')
  93. legend('R_2 = 1m','R_2 = 2m', 'R_2 = 3m','R_2 = 10m')
  94. xlabel('Distance from beam waist (m)')
  95. ylabel('Intensity relative to I_0')
  96. end
  97. y_z1 = [-1.5e-3 1.5e-3];
  98. y_z2 = [-1.5e-3 1.5e-3];
  99.  
  100. figure; hold on                 %For plotting beam trajectories
  101. for i = 1:length(w_0)
  102.     x_z1 = [z_1(1,i) z_1(1,i)];
  103.     x_z2 = [z_2(1,i) z_2(1,i)];
  104.     plot(z(i,:),all_w{i},cols{i},z(i,:),-all_w{i},cols{i})
  105.     plot(x_z1, y_z1,mirrorcols{i})
  106.     plot(x_z2, y_z2,mirrorcols{i})
  107. end
  108.  
  109. title('Beam waist of laser')
  110. xlabel('Distance (m)')
  111. ylabel('Beam radius (m)')
  112. legend('R_2 = 1','R_2 = 2','R_2 = 5','R_2 = 10')
  113.  
  114. w0_ch = min(w_0);               %Chooses the minimum beam waist
  115. theta_ff = out_wav/(pi*w0_ch);  %Finds far field divergence of minimum beam waist
  116. Pp_thr = Pp_thr*(w0_ch)^2;      %Finds threshold pump power (808nm only)
  117. Pp_thr_full = Pp_thr_full*(w0_ch)^2; %Finds threshold pump power (full spectrum)
  118. Pp_fact = Pp/Pp_thr_full;       %Finds factor by which input power is over threshold
  119. Pp_808 = Pp_thr*Pp_fact;        %Finds input pump power (808nm only)
  120.  
  121. Rp = Pp_808/(h*pump_fre*pi*w0_ch^2*L); %Finds pump rate
  122. F = (2*L)/gamma*(Rp - Rp_thr);  %Intracavity photon flux
  123. T = 1 - r_2;                    %Percentage of light exiting cavity as beam
  124. wl = 4.5e-4;                    %Estimation of pump
  125. Po = (F/2)*(1-r_2)*(pi*wl^2)*(h*out_fre); %Calculates output power
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement