├── Complex-Functions.html
├── README.md
├── Summation.PNG
├── Zeta-Function-EMS.py
├── Zeta-point05Resolution.PNG
├── complexback.PNG
├── critical-line.PNG
└── zetaEMS.html
/Complex-Functions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Complex Functions
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
24 |
25 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Complex Functions
49 | An attempt to plot them Based on certain amazing animations in a video at 3Blue1Brown
50 | |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | |
59 |
60 | Function Input
61 | |
62 |
63 |
64 | |
65 |
66 | Simple
67 | |
68 |
69 | Summation
70 | |
71 |
72 |
73 | Zeta
74 | |
75 |
76 |
77 | |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | |
87 |
88 | Values of Riemann Zeta function were estimated using the Euler - Maclaren Summation mentioned in the work of Hanh Nguyen. Values under this method seem to be accurate enough.
89 | |
90 | |
91 |
92 |
93 |
94 | |
95 |
96 | Plot Zeta along Critical Line
97 | |
98 | |
99 |
100 |
101 |
102 |
103 |
146 |
147 |
148 |
149 |
150 | |
151 |
152 | $$f(z) = \sum_{n=1}^{\infty} 2^{-n} = 1$$
153 | |
154 | |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
182 |
183 |
184 | |
185 |
186 |
187 |
188 | |
189 |
190 |
191 |
192 |
193 |
194 |
195 | |
196 |
197 | Riemann Zeta
198 | |
199 | |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 | Compute Transform Animation
209 | |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 | |
218 |
219 | Play
220 | |
221 | |
222 |
223 |
224 |
225 |
226 | |
227 |
228 | Final Result
229 | |
230 | |
231 |
232 | Edit Mesh
233 | |
234 | |
235 |
236 | DarkMode
237 | |
238 | |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 | |
247 |
248 | Made using Math.js, MathJax to visualize complex functions. Input point is in orange. If the complex function is a summation, then each term is a complex number which can be represented as a line. Sum of these lines added vectorially gives us the resulting output point in black.
249 | |
250 | |
251 |
252 |
253 |
254 |
255 |
256 |
303 |
304 |
305 | |
306 |
307 | Summation Term Magnitudes
308 | |
309 |
310 |
311 |
312 | |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
4648 |
4649 |
4650 |
4651 |
4652 |
4653 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Complex-Functions
2 | An [interactive](https://prajwalsouza.github.io/Experiments/Complex-Functions.html) for visualizing complex functions based on a [3Blue1Brown video](https://www.youtube.com/watch?v=sD0NjbwqlYw).
3 | Also, Riemann Zeta Function was estimated using Euler Maclaurin Summation. The code can be found [here](https://github.com/prajwalsouza/Complex-Functions/blob/master/zetaEMS.html). It is based on certain [methods mentioned in the work](https://math.dartmouth.edu/archive/m56s13/public_html/Nguyen_proj.pdf) of Hanh Nguyen.
4 |
5 | ### Some snapshots of the simulation
6 |
7 | **Plot of Riemann Zeta Function and the interface.**
8 |
9 | 
10 |
11 | **Summation of a Series as described in the 3Blue1Brown video**
12 |
13 | 
14 |
15 | **Plot of Zeta function along the critical line**
16 |
17 | 
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Summation.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/prajwalsouza/Complex-Functions/138835a06706ac1796c4e1c452b99467db20fe97/Summation.PNG
--------------------------------------------------------------------------------
/Zeta-Function-EMS.py:
--------------------------------------------------------------------------------
1 | from mpmath import mp
2 | from scipy import special
3 |
4 | # Computation of the Riemann Zeta Function
5 | # The following formula is based on Euler-Maclaurin Summation as mentioned in
6 | # https://math.dartmouth.edu/archive/m56s13/public_html/Nguyen_proj.pdf
7 | # which is the work of Hanh Nguyen.
8 |
9 | def zetaEMS(s, N, v):
10 | sum1 = mp.mpc(0)
11 | s = mp.mpc(s)
12 | for n in range(1, N):
13 | sum1 = sum1 + (n**(-s))
14 |
15 | sum1 = sum1 + ((N**(1 - s))/mp.mpc(s - 1))
16 | sum1 = sum1 + ((N**(-s))/mp.mpc(2))
17 |
18 | sum2 = 0
19 | for k1 in range(1, v + 1):
20 | t1 = (bernoulli(2*k1)/mp.mpc(fact(2*k1)))
21 | prd = mp.mpc(1)
22 | for h in range(0, (2*k1) - 1):
23 | prd = prd*(s + mp.mpc(h))
24 | t2 = prd
25 | t3 = N**(1 - s - (2*k1))
26 | sum2 = sum2 + (t1*t2*t3)
27 |
28 | return sum1 + sum2
29 |
30 | # Bernoulli numbers calculated using Scipy's special function module
31 |
32 | def bernoulli(val):
33 | return special.bernoulli(val)[val]
34 |
35 | # Computing the factorial of a number
36 |
37 | def fact(d):
38 | pd = 1
39 | for a in range(1, d + 1):
40 | pd = pd*a
41 |
42 | return pd
43 |
44 | # Computing Combination nCr (Binomial Coefficients)
45 |
46 | def nCr(n, r):
47 | return mp.mpf(fact(n))/mp.mpf(fact(r)*fact(n - r))
48 |
49 |
50 | complexinput = 0.5+14.13j
51 | output = zetaEMS(complexinput, N=100, v=100)
52 | # As mentioned in the work, N has to chosen to be of the order of magnitude of the complex input. But, here, I've chosen a large value.
53 | # value of v has been chosen depending on accuracy. (More than v = 100, bernoulli numbers are extremely high and can lead to errors)
54 |
55 | print("Input : ")
56 | print(complexinput)
57 | print("Zeta Function : ")
58 | print(output)
59 |
--------------------------------------------------------------------------------
/Zeta-point05Resolution.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/prajwalsouza/Complex-Functions/138835a06706ac1796c4e1c452b99467db20fe97/Zeta-point05Resolution.PNG
--------------------------------------------------------------------------------
/complexback.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/prajwalsouza/Complex-Functions/138835a06706ac1796c4e1c452b99467db20fe97/complexback.PNG
--------------------------------------------------------------------------------
/critical-line.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/prajwalsouza/Complex-Functions/138835a06706ac1796c4e1c452b99467db20fe97/critical-line.PNG
--------------------------------------------------------------------------------
/zetaEMS.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------