-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.m
68 lines (65 loc) · 2.49 KB
/
example.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
lambda = 1550; % [nm]
tetta = 0; %[rad]
d_coating = 0:1000; %[nm]
%%%%%% calc of reflection spectrum of gold
[S_gold, tetta2] = SMatrixOfStructure(tetta, lambda,... %Calc S matrix
1, 0,... % air layer
N_gold(lambda), 0); % gold layer
R_gold = abs(S_gold(1,2)) ^ 2; % calc R from S matrix
R_gold = zeros(size(d_coating)) + R_gold; % line of pure gold for graph
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%% calc gold mirrors with different coatings %%%%%%%%%%%%%%
% initiation of arrays
R_coated_gold_1 = zeros(size(d_coating));
R_coated_gold_2 = zeros(size(d_coating));
R_coated_gold_3 = zeros(size(d_coating));
%calc for different thickness of coatings
for i = 1:max(size(d_coating))
[S_coated_gold_1, tetta2] =...
SMatrixOfStructure(tetta, lambda, N_air(lambda), 0,N_Si3N4(lambda), d_coating(i), N_gold(lambda), 0);
R_coated_gold_1(i) = S2Reflectance(S_coated_gold_1);
[S_coated_gold_2, tetta2] =...
SMatrixOfStructure(tetta, lambda, N_air(lambda), 0,N_SiO2(lambda), d_coating(i), N_gold(lambda), 0);
R_coated_gold_2(i) = S2Reflectance(S_coated_gold_2);
[S_coated_gold_3, tetta2] =...
SMatrixOfStructure(tetta, lambda,...
N_air(lambda), 0,...
N_Si3N4(lambda), d_coating(i)/2,...
N_SiO2(lambda), d_coating(i)/2,...
N_gold(lambda), 0);
R_coated_gold_3(i) = S2Reflectance(S_coated_gold_3);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
plot(d_coating, R_gold)
hold on
plot(d_coating, R_coated_gold_1)
plot(d_coating, R_coated_gold_2)
plot(d_coating, R_coated_gold_3)
hold off
legend('pure gold',...
'gold coated by Si3N4',...
'gold coated by SiO2',...
'double layer')
%%%%%%%%%%%%%%%%%%%%%%%%%%% Secondary functions %%%%%%%%%%%%%%%%%%%%%%%%%%%
function N = N_gold(lambda)% get refractive index of Au
data1 = dlmread('nk_Au.txt');
n_gold = data1(:, 2);
k_gold = data1(:, 3);
lambda_gold = data1(:, 1) * 1000;
N = interp1(lambda_gold, n_gold, lambda) + 1i * interp1(lambda_gold, k_gold, lambda);
end
function N = N_Si3N4(lambda) % get refractive index of Si3N4
data2 = dlmread('nk_Si3N4.txt');
n_Si3N4 = data2(:, 2);
lambda_Si3N4 = data2(:, 1) * 1000;
N = interp1(lambda_Si3N4, n_Si3N4, lambda);
end
function N = N_air(lambda)% get refractive index of Air
N = 1;
end
function N = N_SiO2(lambda)% get refractive index of SiO2
data1 = dlmread('nk_SiO2..txt');
n_gold = data1(:, 2);
lambda_gold = data1(:, 1) * 1000;
N = interp1(lambda_gold, n_gold, lambda);
end