フレネル積分

モジュールのインポートや初期設定など

import matplotlib.pyplot as plt  
import numpy as np
import scipy as sp
from scipy.special import fresnel # フレネル正弦積分,フレネル余弦積分
import skrf as rf
from pylab import *# rcPramsを使ってTeXのフォントをデフォルトにする
import scienceplots
#Warning : As of version 2.0.0, you need to add import scienceplots before setting the style (plt.style.use('science')).
plt.style.use(['science', 'notebook'])
# rcPramsを使ってTeXのフォントをデフォルトにする
#plt.rcParams['font.family'] = 'Times New Roman' # font familyの設定
plt.rcParams['font.family'] = 'serif' # font familyの設定
plt.rcParams['mathtext.fontset'] = 'cm' # math fontの設定

フレネル正弦積分およびフレネル余弦積分

 フレネル正弦積分 $S(x)$,フレネル余弦積分 $C(x)$は(正規化されたフレネル積分ともいう), \begin{gather} S(x) = \int_0^x \sin \left( \frac{\pi}{2} t^2 \right) dt, \ \ \ \ \ C(x) = \int_0^x \cos \left( \frac{\pi}{2} t^2 \right) dt \end{gather}
uu = np.linspace(-5.0,5.0,10+1) 
print(f"{'u':>4s} {'C(u)':>18s} {'S(u)':>18s}")
for j,u in enumerate(uu):
    su = fresnel(u)[0] # フレネル正弦積分
    cu = fresnel(u)[1] # フレネル余弦積分
    print(f"{u:>4.1f} {cu:>18.15f} {su:>18.15f}")
   u               C(u)               S(u)
-5.0 -0.563631188704012 -0.499191381917117
-4.0 -0.498426033038178 -0.420515754246928
-3.0 -0.605720789297686 -0.496312998967375
-2.0 -0.488253406075341 -0.343415678363698
-1.0 -0.779893400376823 -0.438259147390355
 0.0  0.000000000000000  0.000000000000000
 1.0  0.779893400376823  0.438259147390355
 2.0  0.488253406075341  0.343415678363698
 3.0  0.605720789297686  0.496312998967375
 4.0  0.498426033038178  0.420515754246928
 5.0  0.563631188704012  0.499191381917117
図示すると,
uu = np.linspace(-5.0,5.0,281)
fig = plt.figure() # グラフ領域の作成
plt.plot(uu,fresnel(uu)[0], label=r"$S(x)$")
plt.plot(uu,fresnel(uu)[1], '--', linewidth=3, color='red', alpha=0.3, label=r"$C(x)$")
plt.xlim(-5, 5)
plt.ylim(-1, 1)
plt.yticks(np.arange(-1, 1.5, step=0.5))
plt.xlabel(r"$x$")
plt.ylabel(r"$C(x), S(x)$")
plt.legend(ncol=1, loc='best', fancybox=False, frameon = True)
fig.tight_layout()
fig.savefig('Fresnel_integral.pdf')
plt.show()

複素平面上にプロットすると,
uu = np.linspace(-5.0,5.0,401)
ss = fresnel(uu)[1] + 1j*fresnel(uu)[0]
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_aspect('equal', adjustable='box')
plt.plot(ss.real, ss.imag)
plt.grid(color = "gray", linestyle="--")
plt.xlim(-1, 1)
plt.ylim(-1, 1)
plt.title('Complex plane')
plt.xlabel('Real part')
plt.ylabel('Imaginary part')
plt.xticks(np.arange(-1, 1.5, step=0.5))
plt.yticks(np.arange(-1, 1.5, step=0.5))
fig.savefig('Fresnel_integral_complex.pdf')
plt.show()

被積分関数

def fcos(x):
    return np.cos(x**2*np.pi/2.0)
x = np.linspace(-5, 5, 1001)
yc = fcos(x)
fig = plt.figure() # グラフ領域
plt.xlabel(r'$t$')
plt.ylabel(r'$\cos \left( \frac{\pi t^2}{2} \right)$')
plt.plot(x, yc)
fig.savefig('Fresnel_integrand_cos.pdf')
plt.show()

def fsin(x):
    return np.sin(x**2*np.pi/2.0)
ys = fsin(x)
fig = plt.figure() # グラフ領域
plt.xlabel(r'$t$')
plt.ylabel(r'$\sin \left( \frac{\pi t^2}{2} \right)$')
plt.plot(x, ys)
fig.savefig('Fresnel_integrand_sin.pdf')
plt.show()