In [1]:
using SpecialFunctions
using LinearAlgebra
In [2]:
using PyPlot
In [3]:
function calc_zeta(real,R)
Z = zeros(Complex{Float64},size(R))
n = 1
for imag in R
s = real + imag*im
Z[n] = zeta(s)
n = n + 1
end
Z
end
Out[3]:
calc_zeta (generic function with 1 method)
In [11]:
function main()
real = 0.5
s_radian = -10
e_radian = 20
N = 10000
R = LinRange(s_radian,e_radian,N)
Z = calc_zeta(real,R)
X,Y =reim(Z)
fig, ax = plt.subplots(figsize=(10, 10))
ax.plot(X,Y)
ax.axhline(0, color="red")
ax.axvline(0, color="red")
ax.annotate("start=$(round(Z[1],digits=2))",xy=(X[1], Y[1]), xytext=(X[1]+R[2]-R[1], Y[1]+R[2]-R[1]), color="red",)
ax.annotate("end=$(round(Z[end],digits=2))",xy=(X[end], Y[end]), xytext=(X[end]+R[2]-R[1], Y[end]+R[2]-R[1]), color="red",)
ax.set_xlabel("Re(s)")
ax.set_ylabel("Im(s)")
ax.set_title("Riemann Zeta Function")
plt.show()
end
main()
In [ ]: