Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. clear all
  2. close all
  3.  
  4. a.W21 = 121; %s^-1
  5. a.W31 = 118; %s^-1
  6. a.W32 = 2000; %s^-1
  7. a.W41 = 51; %s^-1
  8. a.W42 = 57; %s^-1
  9. a.W43 = 1.7e5; %s^-1
  10. a.h = 6.62e-34; %Js
  11. a.sig_p = 4.2e-20; %cm^2
  12. a.f1_p = 0.24;
  13. a.f2_p = 0.22;
  14. a.sig_l = 3.1e-20; %cm^2
  15. a.f1_l = 0.0215;
  16. a.f2_l = 0.2090;
  17. a.lambda_p = 1532e-7; %cm CHANGE THESE TO CM
  18. lambda_l = 1645e-7; %cm
  19. Ner = 0.7e20; %cm^3
  20. a.Cup = 2e-18; %cm^3s^-1
  21. a.A = 0.012; %cm^2
  22. a.L_cry = 3; %cm
  23. a.L_res = 9; %cm
  24. a.c = 3e10; %cms^-1
  25. a.Pin = 60; %w
  26. laser_mode_area = 0.05; %cm^3
  27.  
  28. a.Toc = 0.99; %for the first time, different second time
  29. a.phi_sp = 0;
  30.  
  31. %%%%Pout = phi*Toc
  32.  
  33. N0 = [0.7e20,0,0,0,0];
  34.  
  35. Er_Pop = @(t,N) laser_model(N,a);
  36.  
  37. [t,N] = ode45(Er_Pop,[0,10e-3],N0);
  38. %run ode solver first, with N1 = 0.7e20, other 0 for 10ms
  39. N1 = N(length(t),:);
  40. a.Toc = 0.6;
  41. N1(5) = 10e10;
  42. [t,N] = ode45(Er_Pop,[0,100e-7],N1);
  43. %use these results as input, run again for 100ns
  44.  
  45. plot(t,N(1),t,N(2),t,N(3),t,N(4));
  46.  
  47.  
  48.  
  49.  
  50.  
  51. function Ndot = laser_model(N,a)
  52.  
  53. %unpack structure a
  54. phi = N(5);
  55. sig_l = a.sig_l;
  56. f1_l = a.f1_l;
  57. f2_l = a.f2_l;
  58. Pin = a.Pin;
  59. lambda = a.lambda_p;
  60. sig_p = a.sig_p;
  61. f1_p = a.f1_p;
  62. f2_p = a.f2_p;
  63. h = a.h;
  64. c = a.c;
  65. A = a.A;
  66. Toc = a.Toc;
  67. L_res = a.L_res;
  68. L = a.L_cry;
  69. W21 = a.W21;
  70. W31 = a.W31;
  71. W41 = a.W41;
  72. Cup = a.Cup;
  73. W42 = a.W42;
  74. W32 = a.W32;
  75. W43 = a.W43;
  76. phi_sp = a.phi_sp;
  77.  
  78. D = c*(exp(2*sig_l*L*(f2_l*N(2)-f1_l*N(1)))-1);
  79. Rp = Pin*lambda*((1-exp(sig_p*L*(f2_p*N(2)-f1_p*N(1))))/(h*c*L*A));
  80. rc = -c*log(1-Toc)/(2*L_res);
  81.  
  82. Ndot(1) = -Rp + phi*D/(2*L) + N(2)*W21 + N(3)*W31 + N(4)*W41 + Cup.*N(2).^2;
  83. Ndot(2) = Rp - phi*D/(2*L) - N(2)*W21 + N(3)*W32 + N(4)*W42 - 2*Cup.*N(2).^2;
  84. Ndot(3) = -N(3)*W31-N(3)*W32+N(4)*W43;
  85. Ndot(4) = -N(4)*W41-N(4)*W42-N(4)*W43+Cup.*N(2).^2;
  86. Ndot(5) = phi*D/(2*L_res) - rc*phi + phi_sp;
  87.  
  88. Ndot = transpose(Ndot);
  89.  
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement