Advertisement
makispaiktis

Optikes_Mathima05

Mar 9th, 2021 (edited)
836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.62 KB | None | 0 0
  1. clc;
  2. clear all;
  3.  
  4. % =========================================================================
  5. % Given the fiber V-number solve for a specific mode of order (m,n) = (p,r)
  6. % =========================================================================
  7.  
  8. m = 0;  % Azimuthial order (0 = fundamental), denoted as p in Lecture Notes
  9. n = 1;  % Root order (1 = fundamental), denoted as r in Lecture Notes
  10. V = 2.2;
  11.  
  12. [V b] = FibreScalar_FindRoots(m, n, V);
  13.  
  14. % =========================================================================
  15. %                       Mode Profile F(x,y)
  16. % =========================================================================
  17.  
  18. figure;
  19. set(gcf, 'PaperPositionMode', 'auto', 'w');
  20. FigSize = [400 400];    % Pixels
  21. cccb = [ 1 1 1; LVCMv2( [0 0 0; 0 0 0.5; 0 0 1; 0 1 1; 1 1 0; 1 0 0] ) ];
  22. set(gcf, 'Position', [100 100 FigSize]);
  23.  
  24. % Fiber Specs
  25. a = 20  % radius in μm
  26. % Define a Space (x, y) ----> (rho, theta)
  27. x = 3 * a * linspace(-1, 1, 200);
  28. y = 3 * a * linspace(-1, 1, 200);
  29. [x y] = meshgrid(x, y);
  30. ra = sqrt(x.^2 + y.^2);
  31. % th = atan(x ./ y);
  32. th = atan2(y, x);
  33. is = ra <= a;
  34. os = ra >= a;
  35.  
  36. options = optimset('Display', 'off');
  37. bo = b;
  38. Va =V;
  39.  
  40. % Calculate field mode on that
  41. U = Va * sqrt(1-bo);
  42. W = Va * sqrt(bo);
  43. F = NaN * x;
  44. Ain = 1;
  45. Aot = Ain * besselj(m, U) / besselk(m, W);
  46. F(is) = Ain * besselj(m, U * ra(is)/a) .* cos(m * th(is));
  47. F(os) = Aot * besselj(m, W * ra(os)/a) .* cos(m * th(os));
  48.  
  49. % Plots
  50. cla; hold on;
  51. pcolor(x/a, y/a, (F));
  52. plot(cos(2*pi*linspace(0,1,100)), sin(2*pi*linspace(0,1,100)), 'k-.', 'LineWidth');
  53. plot(get(gca, 'XLim'), [0 0], 'k:', [0 0], get(gca, 'YLim'), 'k:');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement