-
Notifications
You must be signed in to change notification settings - Fork 0
/
reshenie.m
127 lines (121 loc) · 3.87 KB
/
reshenie.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
%Çàäàåò ãðàíè÷íûå óñëîâèÿ è âûçûâàåò ðåøåíèå Øðåäèíãåðà äëÿ êàæäîãî
%çíà÷åíèÿ ýíåðãèè
function [psi, E_ans]=reshenie()
global delta_U
global N_GaAs
global N_AlAs
global U_left
global N
global N_period
global U_elstatic
global N_surface
global m
global N_well
global U
%Ìàññà ñâîáîäíîãî ýëåêòðîíà â ã
m_e = 9.109*10^(-28);
%Çàäàåì ìàêñèìóì ñêàíèðîâàíèÿ ïî ýíåðãèè
E_max = delta_U;
%×èñëî øàãîâ ïî ýíåðãèè è âåëè÷èíà øàãà
nE = 10000;
dE = E_max/nE;
%Øàã ïî ðàññòîÿíèþ
h = 1/N;
%Çàäàåì ðàçðûâ çîíû ïðîâîäèìîñòè è ýôôåêòèâíóþ ìàññó â ñëîÿõ
if delta_U > 0
%Ýòî ãàììà ýëåêòðîíû
U_GaAs = 0;
U_AlAs = delta_U;
m_GaAs = 0.068 * m_e;
m_AlAs = 0.15 * m_e;
else
U_GaAs = abs(delta_U);
U_AlAs = 0;
m_GaAs = 1.3 * m_e;
m_AlAs = 1.1 * m_e;
end
%Ñ÷åò÷èêè èòåðàöèé è ðåøåíèé
j = 1;
n = 1;
E = 0;
while E < E_max
%Ñþäà ñêëàäèðóåì ðåøåíèÿ â òå÷åíèè îäíîé èòåðàöèè
psi_temp1 = zeros(1, N);
psi_temp2 = zeros(1, N);
%Çàäàåì ãðàíè÷íûå óñëîâèÿ íà çíà÷åíèå è ïðîèçâîäíóþ ñëåâà
psi_temp1(1) = 10^-20;
psi_temp2(1) = psi_temp1(1)*sqrt(U_left-E);
%Ðåøàåì Øðåäèíãåðà äëÿ êàæäîãî ñëîÿ ï/ï. Íà êàæäîì øàãå âû÷èñëÿþòñÿ
%êóñêè ïîòåíöèàëà îò ðàçðûâà çîíû ïðîâîäèìîñòè è îò íîñèòåëåé. Â êàæäîì
%èç òàêèõ êóñêîâ îäíà ëèøíÿÿ òî÷êà â íà÷àëå äëÿ ñøèâêè. Çàòåì íà
%êàæäîì ñëîå ðåøàåòñÿ Øðåäèíãåð ñ ãðàíè÷íûìè óñëîâèÿìè, îáåñïå÷èâàþùèìè
%ñøèâêó âô ìåæäó ñëîÿìè.
Uc = U_left*ones(1, N_surface);
U_elstatic_part = U_elstatic(1:N_surface);
U = Uc + U_elstatic_part;
m = m_AlAs;
[psi1, psi2] = runge_kutt(psi_temp1(1), psi_temp2(1), N_surface - 1, E);
psi_temp1(2:N_surface) = psi1;
psi_temp2(2:N_surface) = psi2;
%Ñ÷åò÷èê òåêóùåãî øàãà
N_count = N_surface;
%Ðåøàåì Øðåäèíãåðà äëÿ êàæäîãî ñëîÿ ï/ï, íî äëÿ ÷èñëà
%ïåðèäîâ ðàâíîãî ïîëîâèíå + 1
%×èñëî ïåðèîäîâ, äëÿ êîòîðîãî áóäåì ðåøàòü
N_period_sol = N_period/2;
for i = 1:N_period_sol
%Ðåøåíèå äëÿ ñëîÿ GaAs
Uc = U_GaAs*ones(1, N_GaAs + 1);
U_elstatic_part = U_elstatic(N_count:N_count + N_GaAs);
U = Uc + U_elstatic_part;
m = m_GaAs;
[psi1, psi2] = runge_kutt(psi_temp1(N_count), psi_temp2(N_count), N_GaAs, E);
psi_temp1(N_count + 1:N_count + N_GaAs) = psi1;
psi_temp2(N_count + 1:N_count + N_GaAs) = psi2;
N_count = N_count + N_GaAs;
%Ðåøåíèå äëÿ ñëîÿ AlAs
Uc = U_AlAs*ones(1, N_AlAs + 1);
U_elstatic_part = U_elstatic(N_count:N_count + N_AlAs);
U = Uc + U_elstatic_part;
m = m_AlAs;
[psi1, psi2] = runge_kutt(psi_temp1(N_count), psi_temp2(N_count), N_AlAs, E);
psi_temp1(N_count + 1:N_count + N_AlAs) = psi1;
psi_temp2(N_count + 1:N_count + N_AlAs) = psi2;
N_count = N_count + N_AlAs;
end
%Ðåøàåì ïîäçàäà÷ó äëÿ ÿìû
Uc = U_GaAs*ones(1, N_well + 1);
U_elstatic_part = U_elstatic(N_count:N_count + N_well);
U = Uc + U_elstatic_part;
m = m_GaAs;
[psi1, psi2] = runge_kutt(psi_temp1(N_count), psi_temp2(N_count), N_well, E);
psi_temp1(N_count + 1:N_count + N_well) = psi1;
psi_temp2(N_count + 1:N_count + N_well) = psi2;
if j > 1
%Åñëè çíà÷åíèå ôóíêöèè èëè ïðîèçâîäíîé ïîìåíÿëî çíàê â ñåðåäèíå, çíà÷èò ýòî
%ðåøåíèå
psians = [];
if w1*psi_temp1(fix(N/2) + 1) < 0
psians = symm_array(psi_temp1);
elseif w2*psi_temp2(fix(N/2) + 1) < 0
psians = symm_array(psi_temp1);
end
[s1, s2] = size(psians);
if s2 ~= 0
square = 0;
for g = 1:N
square = square + psians(g)^2*h;
end
psi(n, :) = psians/square^0.5;
E_ans(n) = E;
if n == 2
break
end
n = n + 1;
end
end
w1 = psi_temp1(fix(N/2) + 1);
w2 = psi_temp2(fix(N/2) + 1);
j = j + 1;
E = E + dE;
end