フレネル積分¶

In [1]:
import matplotlib.pyplot as plt  
import numpy as np
import scipy as sp
from scipy.special import fresnel # フレネル正弦積分,フレネル余弦積分
import pandas as pd
In [2]:
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の設定
In [3]:
np.set_printoptions(precision=5)

フレネル正弦積分 $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}

In [4]:
uu = np.linspace(-5.0,5.0,50+1)
ssu, ccu = fresnel(uu) # フレネル正弦積分,フレネル余弦積分
In [5]:
print(f"{'u':>4s} {'C(u)':>18s} {'S(u)':>18s}")
for j,u in enumerate(uu):
    print(f"{u:>4.1f} {ccu[j]:>18.15f} {ssu[j]:>18.15f}")
   u               C(u)               S(u)
-5.0 -0.563631188704012 -0.499191381917117
-4.8 -0.433796581622996 -0.496750218958947
-4.6 -0.567236682285748 -0.516192336949054
-4.4 -0.438332940837679 -0.462268016411045
-4.2 -0.541719203163415 -0.563198888396611
-4.0 -0.498426033038178 -0.420515754246928
-3.8 -0.448094947012820 -0.565618739795133
-3.6 -0.587953259673416 -0.492309489111001
-3.4 -0.438491703363803 -0.429649464443927
-3.2 -0.466320346952037 -0.593349464618603
-3.0 -0.605720789297686 -0.496312998967375
-2.8 -0.467491651698906 -0.391528443543172
-2.6 -0.388937496191969 -0.549989323152720
-2.4 -0.554961405856428 -0.619689964945684
-2.2 -0.636286044903319 -0.455704612124657
-2.0 -0.488253406075341 -0.343415678363698
-1.8 -0.333632927221557 -0.450938769267583
-1.6 -0.365461683440488 -0.638887683509381
-1.4 -0.543095783546257 -0.713525077363412
-1.2 -0.715437722923074 -0.623400918546249
-1.0 -0.779893400376823 -0.438259147390355
-0.8 -0.722844171896356 -0.249341393053918
-0.6 -0.581095446991652 -0.110540207359387
-0.4 -0.397480759172359 -0.033359432660613
-0.2 -0.199921057594452 -0.004187609161657
 0.0  0.000000000000000  0.000000000000000
 0.2  0.199921057594453  0.004187609161657
 0.4  0.397480759172360  0.033359432660613
 0.6  0.581095446991653  0.110540207359387
 0.8  0.722844171896357  0.249341393053918
 1.0  0.779893400376823  0.438259147390355
 1.2  0.715437722923073  0.623400918546250
 1.4  0.543095783546256  0.713525077363412
 1.6  0.365461683440487  0.638887683509381
 1.8  0.333632927221557  0.450938769267582
 2.0  0.488253406075341  0.343415678363698
 2.2  0.636286044903320  0.455704612124657
 2.4  0.554961405856428  0.619689964945684
 2.6  0.388937496191969  0.549989323152719
 2.8  0.467491651698907  0.391528443543172
 3.0  0.605720789297686  0.496312998967375
 3.2  0.466320346952036  0.593349464618603
 3.4  0.438491703363803  0.429649464443927
 3.6  0.587953259673416  0.492309489111001
 3.8  0.448094947012819  0.565618739795132
 4.0  0.498426033038178  0.420515754246928
 4.2  0.541719203163415  0.563198888396612
 4.4  0.438332940837679  0.462268016411045
 4.6  0.567236682285747  0.516192336949056
 4.8  0.433796581622996  0.496750218958946
 5.0  0.563631188704012  0.499191381917117
In [6]:
df = pd.DataFrame({
    '$u$':uu,
    '$C(u)$':ccu,
    '$S(u)$':ssu,
})
df.style.format({"$u$":"{:.2f}", "$C(u)$":"{:.15f}", "$S(u)$":"{:.15f}"})
Out[6]:
  $u$ $C(u)$ $S(u)$
0 -5.00 -0.563631188704012 -0.499191381917117
1 -4.80 -0.433796581622996 -0.496750218958947
2 -4.60 -0.567236682285748 -0.516192336949054
3 -4.40 -0.438332940837679 -0.462268016411045
4 -4.20 -0.541719203163415 -0.563198888396611
5 -4.00 -0.498426033038178 -0.420515754246928
6 -3.80 -0.448094947012820 -0.565618739795133
7 -3.60 -0.587953259673416 -0.492309489111001
8 -3.40 -0.438491703363803 -0.429649464443927
9 -3.20 -0.466320346952037 -0.593349464618603
10 -3.00 -0.605720789297686 -0.496312998967375
11 -2.80 -0.467491651698906 -0.391528443543172
12 -2.60 -0.388937496191969 -0.549989323152720
13 -2.40 -0.554961405856428 -0.619689964945684
14 -2.20 -0.636286044903319 -0.455704612124657
15 -2.00 -0.488253406075341 -0.343415678363698
16 -1.80 -0.333632927221557 -0.450938769267583
17 -1.60 -0.365461683440488 -0.638887683509381
18 -1.40 -0.543095783546257 -0.713525077363412
19 -1.20 -0.715437722923074 -0.623400918546249
20 -1.00 -0.779893400376823 -0.438259147390355
21 -0.80 -0.722844171896356 -0.249341393053918
22 -0.60 -0.581095446991652 -0.110540207359387
23 -0.40 -0.397480759172359 -0.033359432660613
24 -0.20 -0.199921057594452 -0.004187609161657
25 0.00 0.000000000000000 0.000000000000000
26 0.20 0.199921057594453 0.004187609161657
27 0.40 0.397480759172360 0.033359432660613
28 0.60 0.581095446991653 0.110540207359387
29 0.80 0.722844171896357 0.249341393053918
30 1.00 0.779893400376823 0.438259147390355
31 1.20 0.715437722923073 0.623400918546250
32 1.40 0.543095783546256 0.713525077363412
33 1.60 0.365461683440487 0.638887683509381
34 1.80 0.333632927221557 0.450938769267582
35 2.00 0.488253406075341 0.343415678363698
36 2.20 0.636286044903320 0.455704612124657
37 2.40 0.554961405856428 0.619689964945684
38 2.60 0.388937496191969 0.549989323152719
39 2.80 0.467491651698907 0.391528443543172
40 3.00 0.605720789297686 0.496312998967375
41 3.20 0.466320346952036 0.593349464618603
42 3.40 0.438491703363803 0.429649464443927
43 3.60 0.587953259673416 0.492309489111001
44 3.80 0.448094947012819 0.565618739795132
45 4.00 0.498426033038178 0.420515754246928
46 4.20 0.541719203163415 0.563198888396612
47 4.40 0.438332940837679 0.462268016411045
48 4.60 0.567236682285747 0.516192336949056
49 4.80 0.433796581622996 0.496750218958946
50 5.00 0.563631188704012 0.499191381917117
In [7]:
uu = np.linspace(-5.0,5.0,201)
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()
No description has been provided for this image
In [8]:
uu = np.linspace(-5.0,5.0,301)
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()
No description has been provided for this image

被積分関数¶

In [9]:
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 ( \frac{\pi t^2}{2} )$')
plt.plot(x, yc)
fig.savefig('Fresnel_integrand_cos.pdf')
plt.show()
No description has been provided for this image
In [10]:
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 ( \frac{\pi t^2}{2} )$')
plt.plot(x, ys)
fig.savefig('Fresnel_integrand_sin.pdf')
plt.show()
No description has been provided for this image
In [11]:
df2 = pd.DataFrame({
    '$t$':x[::5],
    '$\cos ( \pi t^2/2 )$':yc[::5],
    '$\sin ( \pi t^2/2 )$':ys[::5],
})
df2.style.background_gradient(cmap='coolwarm')
Out[11]:
  $t$ $\cos ( \pi t^2/2 )$ $\sin ( \pi t^2/2 )$
0 -5.000000 -0.000000 1.000000
1 -4.950000 0.704325 0.709878
2 -4.900000 0.999877 0.015707
3 -4.850000 0.731651 -0.681679
4 -4.800000 0.062791 -0.998027
5 -4.750000 -0.634393 -0.773010
6 -4.700000 -0.990024 -0.140901
7 -4.650000 -0.829281 0.558831
8 -4.600000 -0.248690 0.968583
9 -4.550000 0.450488 0.892782
10 -4.500000 0.923880 0.382683
11 -4.450000 0.952263 -0.305280
12 -4.400000 0.535827 -0.844328
13 -4.350000 -0.121436 -0.992599
14 -4.300000 -0.718126 -0.695913
15 -4.250000 -0.995185 -0.098017
16 -4.200000 -0.844328 0.535827
17 -4.150000 -0.342430 0.939543
18 -4.100000 0.294040 0.955793
19 -4.050000 0.806703 0.590958
20 -4.000000 1.000000 -0.000000
21 -3.950000 0.811319 -0.584604
22 -3.900000 0.323917 -0.946085
23 -3.850000 -0.275218 -0.961382
24 -3.800000 -0.770513 -0.637424
25 -3.750000 -0.995185 -0.098017
26 -3.700000 -0.883766 0.467930
27 -3.650000 -0.485191 0.874408
28 -3.600000 0.062791 0.998027
29 -3.550000 0.584604 0.811319
30 -3.500000 0.923880 0.382683
31 -3.450000 0.988295 -0.152555
32 -3.400000 0.770513 -0.637424
33 -3.350000 0.342430 -0.939543
34 -3.300000 -0.171929 -0.985109
35 -3.250000 -0.634393 -0.773010
36 -3.200000 -0.929776 -0.368125
37 -3.150000 -0.992599 0.121436
38 -3.100000 -0.818150 0.575005
39 -3.050000 -0.457486 0.889217
40 -3.000000 0.000000 1.000000
41 -2.950000 0.450488 0.892782
42 -2.900000 0.799685 0.600420
43 -2.850000 0.981544 0.191237
44 -2.800000 0.968583 -0.248690
45 -2.750000 0.773010 -0.634393
46 -2.700000 0.439939 -0.898028
47 -2.650000 0.035336 -0.999376
48 -2.600000 -0.368125 -0.929776
49 -2.550000 -0.704325 -0.709878
50 -2.500000 -0.923880 -0.382683
51 -2.450000 -0.999992 -0.003927
52 -2.400000 -0.929776 0.368125
53 -2.350000 -0.731651 0.681679
54 -2.300000 -0.439939 0.898028
55 -2.250000 -0.098017 0.995185
56 -2.200000 0.248690 0.968583
57 -2.150000 0.558831 0.829281
58 -2.100000 0.799685 0.600420
59 -2.050000 0.949836 0.312749
60 -2.000000 1.000000 -0.000000
61 -1.950000 0.952263 -0.305280
62 -1.900000 0.818150 -0.575005
63 -1.850000 0.616005 -0.787742
64 -1.800000 0.368125 -0.929776
65 -1.750000 0.098017 -0.995185
66 -1.700000 -0.171929 -0.985109
67 -1.650000 -0.422223 -0.906492
68 -1.600000 -0.637424 -0.770513
69 -1.550000 -0.806703 -0.590958
70 -1.500000 -0.923880 -0.382683
71 -1.450000 -0.987066 -0.160312
72 -1.400000 -0.998027 0.062791
73 -1.350000 -0.961382 0.275218
74 -1.300000 -0.883766 0.467930
75 -1.250000 -0.773010 0.634393
76 -1.200000 -0.637424 0.770513
77 -1.150000 -0.485191 0.874408
78 -1.100000 -0.323917 0.946085
79 -1.050000 -0.160312 0.987066
80 -1.000000 0.000000 1.000000
81 -0.950000 0.152555 0.988295
82 -0.900000 0.294040 0.955793
83 -0.850000 0.422223 0.906492
84 -0.800000 0.535827 0.844328
85 -0.750000 0.634393 0.773010
86 -0.700000 0.718126 0.695913
87 -0.650000 0.787742 0.616005
88 -0.600000 0.844328 0.535827
89 -0.550000 0.889217 0.457486
90 -0.500000 0.923880 0.382683
91 -0.450000 0.949836 0.312749
92 -0.400000 0.968583 0.248690
93 -0.350000 0.981544 0.191237
94 -0.300000 0.990024 0.140901
95 -0.250000 0.995185 0.098017
96 -0.200000 0.998027 0.062791
97 -0.150000 0.999376 0.035336
98 -0.100000 0.999877 0.015707
99 -0.050000 0.999992 0.003927
100 0.000000 1.000000 0.000000
101 0.050000 0.999992 0.003927
102 0.100000 0.999877 0.015707
103 0.150000 0.999376 0.035336
104 0.200000 0.998027 0.062791
105 0.250000 0.995185 0.098017
106 0.300000 0.990024 0.140901
107 0.350000 0.981544 0.191237
108 0.400000 0.968583 0.248690
109 0.450000 0.949836 0.312749
110 0.500000 0.923880 0.382683
111 0.550000 0.889217 0.457486
112 0.600000 0.844328 0.535827
113 0.650000 0.787742 0.616005
114 0.700000 0.718126 0.695913
115 0.750000 0.634393 0.773010
116 0.800000 0.535827 0.844328
117 0.850000 0.422223 0.906492
118 0.900000 0.294040 0.955793
119 0.950000 0.152555 0.988295
120 1.000000 0.000000 1.000000
121 1.050000 -0.160312 0.987066
122 1.100000 -0.323917 0.946085
123 1.150000 -0.485191 0.874408
124 1.200000 -0.637424 0.770513
125 1.250000 -0.773010 0.634393
126 1.300000 -0.883766 0.467930
127 1.350000 -0.961382 0.275218
128 1.400000 -0.998027 0.062791
129 1.450000 -0.987066 -0.160312
130 1.500000 -0.923880 -0.382683
131 1.550000 -0.806703 -0.590958
132 1.600000 -0.637424 -0.770513
133 1.650000 -0.422223 -0.906492
134 1.700000 -0.171929 -0.985109
135 1.750000 0.098017 -0.995185
136 1.800000 0.368125 -0.929776
137 1.850000 0.616005 -0.787742
138 1.900000 0.818150 -0.575005
139 1.950000 0.952263 -0.305280
140 2.000000 1.000000 -0.000000
141 2.050000 0.949836 0.312749
142 2.100000 0.799685 0.600420
143 2.150000 0.558831 0.829281
144 2.200000 0.248690 0.968583
145 2.250000 -0.098017 0.995185
146 2.300000 -0.439939 0.898028
147 2.350000 -0.731651 0.681679
148 2.400000 -0.929776 0.368125
149 2.450000 -0.999992 -0.003927
150 2.500000 -0.923880 -0.382683
151 2.550000 -0.704325 -0.709878
152 2.600000 -0.368125 -0.929776
153 2.650000 0.035336 -0.999376
154 2.700000 0.439939 -0.898028
155 2.750000 0.773010 -0.634393
156 2.800000 0.968583 -0.248690
157 2.850000 0.981544 0.191237
158 2.900000 0.799685 0.600420
159 2.950000 0.450488 0.892782
160 3.000000 0.000000 1.000000
161 3.050000 -0.457486 0.889217
162 3.100000 -0.818150 0.575005
163 3.150000 -0.992599 0.121436
164 3.200000 -0.929776 -0.368125
165 3.250000 -0.634393 -0.773010
166 3.300000 -0.171929 -0.985109
167 3.350000 0.342430 -0.939543
168 3.400000 0.770513 -0.637424
169 3.450000 0.988295 -0.152555
170 3.500000 0.923880 0.382683
171 3.550000 0.584604 0.811319
172 3.600000 0.062791 0.998027
173 3.650000 -0.485191 0.874408
174 3.700000 -0.883766 0.467930
175 3.750000 -0.995185 -0.098017
176 3.800000 -0.770513 -0.637424
177 3.850000 -0.275218 -0.961382
178 3.900000 0.323917 -0.946085
179 3.950000 0.811319 -0.584604
180 4.000000 1.000000 -0.000000
181 4.050000 0.806703 0.590958
182 4.100000 0.294040 0.955793
183 4.150000 -0.342430 0.939543
184 4.200000 -0.844328 0.535827
185 4.250000 -0.995185 -0.098017
186 4.300000 -0.718126 -0.695913
187 4.350000 -0.121436 -0.992599
188 4.400000 0.535827 -0.844328
189 4.450000 0.952263 -0.305280
190 4.500000 0.923880 0.382683
191 4.550000 0.450488 0.892782
192 4.600000 -0.248690 0.968583
193 4.650000 -0.829281 0.558831
194 4.700000 -0.990024 -0.140901
195 4.750000 -0.634393 -0.773010
196 4.800000 0.062791 -0.998027
197 4.850000 0.731651 -0.681679
198 4.900000 0.999877 0.015707
199 4.950000 0.704325 0.709878
200 5.000000 -0.000000 1.000000