-
Notifications
You must be signed in to change notification settings - Fork 0
/
analityczny_rysunek.m
269 lines (234 loc) · 8.5 KB
/
analityczny_rysunek.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
clc
clear
%set(0,'defaulttextinterpreter','latex');
set(0,'DefaultLineLineWidth', 2);
%set(0, 'defaultAxesTickLabelInterpreter','latex');
set(0,'defaultAxesFontSize',30);
set(0,'defaultAxesFontName', 'TeX Gyre Schola Math');
set(0,'defaulttextinterpreter','latex');
set(0, 'defaultAxesTickLabelInterpreter','latex');
set(0,'defaultAxesFontName', 'TeX Gyre Schola Math');
N = 2000;
dt = 0.01;
time = [0:dt:dt*N]; %siatka czasowa
%% parametry glowne
lambda = 0.26;
m = 1;
%% BELOW
x0_below=2.5;
p0_below = 0.1;
c_below = 0.5*p0_below*p0_below- 0.5*x0_below*x0_below + 0.25*lambda*x0_below*x0_below*x0_below*x0_below;
k_below = -1/(2*c_below*lambda) - (1/(2*c_below*lambda))*sqrt(1+4*c_below*lambda) - 1;
modified_time_below = time.*sqrt((sqrt(1+4*lambda*c_below) - 1)/2);
arg_below = (x0_below*sqrt(lambda))/(sqrt(1+sqrt(1+4*lambda*c_below)));
phi_below = asin(arg_below);
F_below = ellipticF(phi_below, k_below);
x_below = sqrt((1/lambda)*(1+sqrt(1+4*lambda*c_below)))*jacobiSN(modified_time_below + F_below, k_below);
p_below = m*sqrt(2*c_below)*jacobiCN(modified_time_below + F_below, k_below).*jacobiDN(modified_time_below + F_below, k_below);
%% SEPARATRIX
x0_sep = 0.1;
p0_sep = 0.1;
x_sep = (sqrt(2/lambda)).*sin(2*atan(exp(time).*tan(0.5*asin(sqrt(lambda/2).*x0_sep))));
p_sep = (2*sqrt(2/lambda).*exp(time).*tan(0.5*asin(sqrt(lambda/2)*x0_sep)).*cos(2*atan(exp(time).*tan(0.5*asin(sqrt(lambda/2)*x0_sep)))))./(exp(2*time).*(tan(0.5*asin(sqrt(lambda/2)*x0_sep))).^2 + 1);
%% ABOVE
x0_above=0.1;
p0_above = 2;
c_above = 0.5*p0_above*p0_above- 0.5*x0_above*x0_above + 0.25*lambda*x0_above*x0_above*x0_above*x0_above;
k_above = -1/(2*c_above*lambda) - (1/(2*c_above*lambda))*sqrt(1+4*c_above*lambda) - 1;
modified_time_above = time.*sqrt((sqrt(1+4*lambda*c_above) - 1)/2);
arg_above = (x0_above*sqrt(lambda))/(sqrt(1+sqrt(1+4*lambda*c_above)));
phi_above = asin(arg_above);
F_above = ellipticF(phi_above, k_above);
x_above = sqrt((1/lambda)*(1+sqrt(1+4*lambda*c_above)))*jacobiSN(modified_time_above + F_above, k_above);
p_above = m*sqrt(2*c_above)*jacobiCN(modified_time_above + F_above, k_above).*jacobiDN(modified_time_above + F_above, k_above);
clear c_below k_below modified_time_below phi_below F_below c_above k_above modified_time_above phi_above F_above
%% Drawing
%% Below Trajectories
%{
figure(1)
plot(time, x_below, '-g', time, p_below,'-r')
hold on
ylabel('$X, P$ [arb. unit]', 'Interpreter', 'latex')
ytickformat('%.0f')
legend('$~X=X(\tau)$', '$~P=P(\tau)$', 'Interpreter', 'latex', 'Location', 'Southeast')
xlabel('$\tau$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
axis('auto')
%yticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
text(NW(1),NW(2),'(a)', 'FontSize', 30)
%grid on
%% Below PS
figure(2)
plot(x_below, p_below, '-k', 'LineWidth', 2)
hold on
plot(x0_below, p0_below, 'or', 'MarkerFaceColor', 'r')
xlabel('$X$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
ylabel('$P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%axis([-5 5 -3.5 3.5])
%xticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
text(NW(1),NW(2),'(b)', 'FontSize', 30)
%grid on
%% Separatrix Trajectories
figure(3)
plot(time, x_sep, '-g', time, p_sep,'-r')
hold on
ylabel('$X, P$ [arb. unit]', 'Interpreter', 'latex')
ytickformat('%.0f')
legend('$~X=X(\tau)$', '$~P=P(\tau)$', 'Interpreter', 'latex', 'Location', 'Southeast')
xlabel('$\tau$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%axis([0 20 -5 5])
%yticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
text(NW(1),NW(2),'(c)', 'FontSize', 30)
%grid on
%% Separatrix PS
figure(4)
plot(x_sep, p_sep, '-k', 'LineWidth', 2)
hold on
plot(x0_sep, p0_sep, 'or', 'MarkerFaceColor', 'r')
xlabel('$X$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
ylabel('$P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%axis([-5 5 -3.5 3.5])
%xticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
text(NW(1),NW(2),'(d)', 'FontSize', 30)
%grid on
%% Above Trajectories
figure(5)
plot(time, x_above, '-g', time, p_above,'-r')
hold on
ylabel('$X, P$ [arb. unit]', 'Interpreter', 'latex')
ytickformat('%.0f')
legend('$~X=X(\tau)$', '$~P=P(\tau)$', 'Interpreter', 'latex', 'Location', 'Southeast')
xlabel('$\tau$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%axis([0 20 -5 5])
%yticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
text(NW(1),NW(2),'(e)', 'FontSize', 30)
%grid on
%% Above PS
figure(6)
plot(x_above, p_above, '-k', 'LineWidth', 2)
hold on
plot(x0_above, p0_above, 'or', 'MarkerFaceColor', 'r')
xlabel('$X$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
ylabel('$P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%axis([-5 5 -3.5 3.5])
%xticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
text(NW(1),NW(2),'(f)', 'FontSize', 30)
%grid on
%% Subplots
set(0,'defaultAxesFontSize',20);
figure(7)
%}
h = figure('Name','UUDO phase space and trajectories','NumberTitle','off','color','w');
h.WindowState = 'maximized';
t = tiledlayout(3,5,'TileSpacing','tight', 'Padding', 'tight');
% Below PS
%ps(1) = subplot(3,2,1)
ps(1) = nexttile;
plot(x_below, p_below, '-k')
hold on
plot(x0_below, p0_below, 'or', 'MarkerFaceColor', 'r')
%xlabel('$X$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%ylabel('$P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
axis square;
%box on;
%axis([-5 5 -3.5 3.5])
%xticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
%NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
%text(NW(1),NW(2),'(a)', 'FontSize', 30)
set(gca,'LineWidth', 2);
% Below trajectories
tr(1) = nexttile;
%tr(1) = subplot(3,2,2)
plot(time, x_below, '-g', time, p_below,'-r')
hold on
%ylabel('$X, P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize',30)
%ytickformat('%.0f')
%legend('$~X=X(\tau)$', '$~P=P(\tau)$', 'Interpreter', 'latex', 'Location', 'Southeast')
%xlabel('$\tau$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
axis square;
%yticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
%NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
%text(NW(1),NW(2),'(b)', 'FontSize', 30)
set(gca,'LineWidth', 2);
nexttile
set(gca,'visible','off')
nexttile
set(gca,'visible','off')
nexttile
set(gca,'visible','off')
% Sep PS
%ps(2) = subplot(3,2,3)
ps(2) = nexttile;
plot(x_sep, p_sep, '-k')
hold on
plot(x0_sep, p0_sep, 'or', 'MarkerFaceColor', 'r')
%xlabel('$X$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
ylabel('$P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
axis square;
%axis([-5 5 -3.5 3.5])
%xticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
%NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
%text(NW(1),NW(2),'(c)', 'FontSize', 30)
set(gca,'LineWidth', 2);
% Sep trajectories
%tr(2) = subplot(3,2,4)
tr(2) = nexttile;
plot(time, x_sep, '-g', time, p_sep,'-r')
%hold on
ylabel('$X, P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%ytickformat('%.0f')
legend('$~X=X(\tau)$', '$~P=P(\tau)$', 'Interpreter', 'latex', 'Location', 'Southeast')
%xlabel('$\tau$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
axis square;
%daspect(tr(2),[1 1 1]);
%pbaspect(tr(2),[1 1 1]);
%axis([0 20 -5 5])
%yticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
%NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
%text(NW(1),NW(2),'(d)', 'FontSize', 30)
set(gca,'LineWidth', 2);
nexttile
set(gca,'visible','off')
nexttile
set(gca,'visible','off')
nexttile
set(gca,'visible','off')
% Above PS
%ps(3) = subplot(3,2,5)
ps(3) = nexttile;
plot(x_above, p_above, '-k')
hold on
plot(x0_above, p0_above, 'or', 'MarkerFaceColor', 'r')
xlabel('$X$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
%ylabel('$P$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
axis square;
%axis([-5 5 -3.5 3.5])
%xticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
set(gca,'LineWidth', 2);
% Above trajectories
%tr(3) = subplot(3,2,6)
tr(3) = nexttile;
plot(time, x_above, '-g', time, p_above,'-r')
%hold on
%ylabel('$X, P$ [arb. unit]', 'Interpreter', 'latex')
%ytickformat('%.0f')
%legend('$~X=X(\tau)$', '$~P=P(\tau)$', 'Interpreter', 'latex', 'Location', 'Southeast')
xlabel('$\tau$ [arb. unit]', 'Interpreter', 'latex', 'FontSize', 30)
axis square;
%axis([0 20 -5 5])
%yticks([-5 -4 -3 -2 -1 0 1 2 3 4 5])
%NW = [min(xlim) max(ylim)]+[diff(xlim)*0.02 -diff(ylim)*0.05];
%text(NW(1),NW(2),'(f)', 'FontSize', 30)
set(gca,'LineWidth', 2);
nexttile
set(gca,'visible','off')
nexttile
set(gca,'visible','off')
nexttile
set(gca,'visible','off')
set(gcf,'renderer','painters');