-
Notifications
You must be signed in to change notification settings - Fork 6
/
gauss_legendre.py
99 lines (93 loc) · 3.74 KB
/
gauss_legendre.py
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
"""Gauss-Legendre coefficients for calculating integrals using quadratures."""
GAUSS_LEGENDRE_COEFFS_8 = [
0.3626837833783620, -0.1834346424956498,
0.3626837833783620, 0.1834346424956498,
0.3137066458778873, -0.5255324099163290,
0.3137066458778873, 0.5255324099163290,
0.2223810344533745, -0.7966664774136267,
0.2223810344533745, 0.7966664774136267,
0.1012285362903763, -0.9602898564975363,
0.1012285362903763, 0.9602898564975363,
]
GAUSS_LEGENDRE_COEFFS_8_HALF = [
0.3626837833783620, 0.1834346424956498,
0.3137066458778873, 0.5255324099163290,
0.2223810344533745, 0.7966664774136267,
0.1012285362903763, 0.9602898564975363,
]
GAUSS_LEGENDRE_COEFFS_16_HALF = [
0.1894506104550685, 0.0950125098376374,
0.1826034150449236, 0.2816035507792589,
0.1691565193950025, 0.4580167776572274,
0.1495959888165767, 0.6178762444026438,
0.1246289712555339, 0.7554044083550030,
0.0951585116824928, 0.8656312023878318,
0.0622535239386479, 0.9445750230732326,
0.0271524594117541, 0.9894009349916499,
]
GAUSS_LEGENDRE_COEFFS_24_HALF = [
0.1279381953467522, 0.0640568928626056,
0.1258374563468283, 0.1911188674736163,
0.1216704729278034, 0.3150426796961634,
0.1155056680537256, 0.4337935076260451,
0.1074442701159656, 0.5454214713888396,
0.0976186521041139, 0.6480936519369755,
0.0861901615319533, 0.7401241915785544,
0.0733464814110803, 0.8200019859739029,
0.0592985849154368, 0.8864155270044011,
0.0442774388174198, 0.9382745520027328,
0.0285313886289337, 0.9747285559713095,
0.0123412297999872, 0.9951872199970213,
]
GAUSS_LEGENDRE_COEFFS_32 = [
0.0965400885147278, -0.0483076656877383,
0.0965400885147278, 0.0483076656877383,
0.0956387200792749, -0.1444719615827965,
0.0956387200792749, 0.1444719615827965,
0.0938443990808046, -0.2392873622521371,
0.0938443990808046, 0.2392873622521371,
0.0911738786957639, -0.3318686022821277,
0.0911738786957639, 0.3318686022821277,
0.0876520930044038, -0.4213512761306353,
0.0876520930044038, 0.4213512761306353,
0.0833119242269467, -0.5068999089322294,
0.0833119242269467, 0.5068999089322294,
0.0781938957870703, -0.5877157572407623,
0.0781938957870703, 0.5877157572407623,
0.0723457941088485, -0.6630442669302152,
0.0723457941088485, 0.6630442669302152,
0.0658222227763618, -0.7321821187402897,
0.0658222227763618, 0.7321821187402897,
0.0586840934785355, -0.7944837959679424,
0.0586840934785355, 0.7944837959679424,
0.0509980592623762, -0.8493676137325700,
0.0509980592623762, 0.8493676137325700,
0.0428358980222267, -0.8963211557660521,
0.0428358980222267, 0.8963211557660521,
0.0342738629130214, -0.9349060759377397,
0.0342738629130214, 0.9349060759377397,
0.0253920653092621, -0.9647622555875064,
0.0253920653092621, 0.9647622555875064,
0.0162743947309057, -0.9856115115452684,
0.0162743947309057, 0.9856115115452684,
0.0070186100094701, -0.9972638618494816,
0.0070186100094701, 0.9972638618494816,
]
GAUSS_LEGENDRE_COEFFS_32_HALF = [
0.0965400885147278, 0.0483076656877383,
0.0956387200792749, 0.1444719615827965,
0.0938443990808046, 0.2392873622521371,
0.0911738786957639, 0.3318686022821277,
0.0876520930044038, 0.4213512761306353,
0.0833119242269467, 0.5068999089322294,
0.0781938957870703, 0.5877157572407623,
0.0723457941088485, 0.6630442669302152,
0.0658222227763618, 0.7321821187402897,
0.0586840934785355, 0.7944837959679424,
0.0509980592623762, 0.8493676137325700,
0.0428358980222267, 0.8963211557660521,
0.0342738629130214, 0.9349060759377397,
0.0253920653092621, 0.9647622555875064,
0.0162743947309057, 0.9856115115452684,
0.0070186100094701, 0.9972638618494816,
]