-
Notifications
You must be signed in to change notification settings - Fork 0
/
figure_8.m
133 lines (123 loc) · 3.31 KB
/
figure_8.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
% Figure 8. Energy manifolds $\Sigma_j$, $j \in \{1,2,3\}$ viewed from
% the side (top row), and from the top (bottom row). This last view
% reveals holes in $\Sigma_3$, but not in $\Sigma_1$ and $\Sigma_2$.
clear; close all;
addpath tools;
N = 128;
x = 2*pi*(-N/2:N/2)/N;
[X,Y,T] = meshgrid(x); % Mesh for the 3-torus
% Plot all values such that S = 0.
% Numerically we plot all values such that
% -riv <= S <= riv, wirth riv (range of isovalues)
% a small number close to 0.
riv = 1e-14; % Range of isovalues
number_iv = 11; % Number of isovalues
figure(8)
set(gcf,'Position',[353 257 1299 739])
subplot(2,3,1)
S = 0.5*cos(X)-sin(T);
for iv = linspace(-riv,riv,number_iv)
p = patch(isosurface(X,Y,T,S,iv));
p.EdgeColor='none';
p.FaceColor = [5/255,48/255,97/255];
hold on
end
disp('Plot 1/6 Generated')
axis([-pi pi -pi pi -pi pi])
xlabel('x_1','FontSize',14)
ylabel('x_2','FontSize',14)
zlabel('\eta','FontSize',14)
camlight('right')
lighting gouraud
grid on
view([22.9427,15.9842])
title('$\Sigma_1$','Interpreter','latex','FontSize',16)
subplot(2,3,2)
S = 0.45*(cos(X-2*Y) + sin(2*Y)) - sin(T);
for iv = linspace(-riv,riv,number_iv)
p = patch(isosurface(X,Y,T,S,iv));
p.EdgeColor='none';
p.FaceColor = [5/255,48/255,97/255];
hold on
end
disp('Plot 2/6 Generated')
axis([-pi pi -pi pi -pi pi])
xlabel('x_1','FontSize',14)
ylabel('x_2','FontSize',14)
zlabel('\eta','FontSize',14)
lightangle(45,45)
lighting gouraud
grid on
view([22.9427,15.9842])
title('$\Sigma_2$','Interpreter','latex','FontSize',16)
subplot(2,3,3)
S = 0.55*(cos(X-2*Y) + sin(2*Y)) - sin(T);
for iv = linspace(-riv,riv,number_iv)
p = patch(isosurface(X,Y,T,S,iv));
p.EdgeColor='none';
p.FaceColor = [5/255,48/255,97/255];
hold on
end
disp('Plot 3/6 Generated')
axis([-pi pi -pi pi -pi pi])
xlabel('x_1','FontSize',14)
ylabel('x_2','FontSize',14)
zlabel('\eta','FontSize',14)
lightangle(45,45)
grid on
view([22.9427,15.9842])
title('$\Sigma_3$','Interpreter','latex','FontSize',16)
subplot(2,3,4)
S = 0.5*cos(X)-sin(T);
for iv = linspace(-riv,riv,number_iv)
p = patch(isosurface(X,Y,T,S,iv));
p.EdgeColor='none';
p.FaceColor = [5/255,48/255,97/255];
hold on
end
disp('Plot 4/6 Generated')
axis([-pi pi -pi pi -pi pi])
xlabel('x_1','FontSize',14)
ylabel('x_2','FontSize',14)
zlabel('\eta','FontSize',14)
camlight('right')
lighting gouraud
grid on
view([0,90])
title('$\Sigma_1$','Interpreter','latex','FontSize',16)
subplot(2,3,5)
S = 0.45*(cos(X-2*Y) + sin(2*Y)) - sin(T);
for iv = linspace(-riv,riv,number_iv)
p = patch(isosurface(X,Y,T,S,iv));
p.EdgeColor='none';
p.FaceColor = [5/255,48/255,97/255];
hold on
end
disp('Plot 5/6 Generated')
axis([-pi pi -pi pi -pi pi])
xlabel('x_1','FontSize',14)
ylabel('x_2','FontSize',14)
zlabel('\eta','FontSize',14)
camlight
lighting gouraud
grid on
view([0,90])
title('$\Sigma_2$','Interpreter','latex','FontSize',16)
subplot(2,3,6)
S = 0.55*(cos(X-2*Y) + sin(2*Y)) - sin(T);
for iv = linspace(-riv,riv,number_iv)
p = patch(isosurface(X,Y,T,S,iv));
p.EdgeColor='none';
p.FaceColor = [5/255,48/255,97/255];
hold on
end
disp('Plot 6/6 Generated')
axis([-pi pi -pi pi -pi pi])
xlabel('x_1','FontSize',14)
ylabel('x_2','FontSize',14)
zlabel('\eta','FontSize',14)
camlight
lighting gouraud
grid on
view([0,90])
title('$\Sigma_3$','Interpreter','latex','FontSize',16)