-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElectro-optics_Q1.m
52 lines (36 loc) · 1.09 KB
/
Electro-optics_Q1.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
%1
disp('1:');
%1D
disp('1D:');
n0 = 1.694;
a = [1e26, 1e27, 1e28]; %Hz^2
d = 410216.4882; %[nm]
theta_i = 36; %dagrees
lambda_margin = linspace(0, 800, 1000); %[nm]
T_value = zeros(length(a), length(lambda_margin));
%loop over each coefficient 'a'
for i = 1:length(a)
%refractive index for each wavelength
v = physconst('LightSpeed') ./ (lambda_margin * 1e-9); %Hz
n = n0 - a(i) ./ v.^2;
theta_t = asin(sin(theta_i) ./ n);
r_s = sin(theta_t - theta_i) ./ sin(theta_t + theta_i);
R = abs(r_s).^2;
delta = 4 * pi * (n0 - a(i) ./ v.^2) .* d .* cos(theta_t) ./ lambda;
%transfer coefficient
T = ((1 - R).^2) ./ ((1 - R).^2 + 4 * R .* sin(delta/2).^2);
T_value(i, :) = T;
end
%plot transfer coefficients for each 'a'
figure;
hold on;
for i = 1:length(a)
plot(lambda_margin, T_value(i, :), 'LineWidth', 1.5);
end
hold off;
%plot
title('transfer coefficient to wavelength');
xlabel('wavelength[nm]');
ylabel('transfer coefficient');
legend('a = 1e26', 'a = 1e27', 'a = 1e28');
grid on;