-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathepsilonzero.m
More file actions
143 lines (134 loc) · 3.43 KB
/
Copy pathepsilonzero.m
File metadata and controls
143 lines (134 loc) · 3.43 KB
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
f = figure(1);
hold on;
legend('show');
title('Concurrent Epsilon=0');
xlabel('N');
ylabel('integral from epsilon to pi');
Nrange = 0:50;
value_at = 1;
values = zeros(1, length(Nrange));
y_full = zeros(0, max(Nrange));
for each=1:length(nsquared)
y_full(each) = 3*each;
end
for epsilon=epsilonrange
count = 1;
for N=Nrange
disp(N);
y = [0, y_full(1:N)];
f = @(t)abs((1./(N+1)).*(1/(2*pi)).*func_sum(y, t));
value = quadgk(f, 0, pi, 'MaxIntervalCount', 10000000);
values(count) = value;
count=count+1;
end
plot(Nrange, values, 'DisplayName', 'Linear');
value_at = value_at+1;
end
Nrange = 0:50;
value_at = 1;
values = zeros(1, length(Nrange));
y_full = zeros(0, max(Nrange));
for each=1:length(nsquared)
y_full(each) = each.^2;
end
for epsilon=epsilonrange
count = 1;
for N=Nrange
disp(N);
y = [0, y_full(1:N)];
f = @(t)abs((1./(N+1)).*(1/(2*pi)).*func_sum(y, t));
value = quadgk(f, 0, pi, 'MaxIntervalCount', 10000000);
values(count) = value;
count=count+1;
end
plot(Nrange, values, 'DisplayName', 'n^2');
value_at = value_at+1;
end
Nrange = 0:50;
value_at = 1;
values = zeros(1, length(Nrange));
y_full = zeros(0, max(Nrange));
for each=1:length(nsquared)
y_full(each) = each.^3;
end
for epsilon=epsilonrange
count = 1;
for N=Nrange
disp(N);
y = [0, y_full(1:N)];
f = @(t)abs((1./(N+1)).*(1/(2*pi)).*func_sum(y, t));
value = quadgk(f, 0, pi, 'MaxIntervalCount', 10000000);
values(count) = value;
count=count+1;
end
plot(Nrange, values, 'DisplayName', 'n^3');
value_at = value_at+1;
end
Nrange = 0:37;
value_at = 1;
values = zeros(1, length(Nrange));
y_full = zeros(0, max(Nrange));
for each=1:length(nsquared)
y_full(each) = 2^each;
end
for epsilon=epsilonrange
count = 1;
for N=Nrange
disp(N);
y = [1, y_full(1:N)];
f = @(t)abs((1./(N+1)).*(1/(2*pi)).*func_sum(y, t));
value = quadgk(f, 0, pi, 'MaxIntervalCount', 10000000);
values(count) = value;
count=count+1;
end
plot(Nrange, values, 'DisplayName', '2^n');
value_at = value_at+1;
end
Nrange = 0:6;
value_at = 1;
values = zeros(1, length(Nrange));
y_full = zeros(0, max(Nrange));
for each=1:length(nsquared)
y_full(each) = 2^(each^2);
end
for epsilon=epsilonrange
count = 1;
for N=Nrange
disp(N);
y = [1, y_full(1:N)];
f = @(t)abs((1./(N+1)).*(1/(2*pi)).*func_sum(y, t));
value = quadgk(f, 0, pi, 'MaxIntervalCount', 10000000);
values(count) = value;
count=count+1;
end
plot(Nrange, values, 'DisplayName', '2^{n^2}');
value_at = value_at+1;
end
Nrange = 0:10;
value_at = 1;
values = zeros(1, length(Nrange));
y_full = zeros(0, max(Nrange));
for each=1:length(nsquared)
y_full(each) = 2^(1+each^3);
end
for epsilon=epsilonrange
count = 1;
for N=Nrange
disp(N);
y = [2, y_full(1:N)];
f = @(t)abs((1./(N+1)).*(1/(2*pi)).*func_sum(y, t));
value = quadgk(f, 0, pi, 'MaxIntervalCount', 10000000);
values(count) = value;
count=count+1;
end
plot(Nrange, values, 'DisplayName', '2^{1+n^3}');
value_at = value_at+1;
end
function result = func_sum(y, t)
result = 0;
for each=y
if(t == 0) result = result + (2*each+1);
else result = result + (sin((each+.5).*t))./(sin(.5.*t));
end
end
end