forked from sigma-py/quadpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_ditkin.py
64 lines (47 loc) · 1.47 KB
/
_ditkin.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
import sympy
from ..helpers import article
from ._helpers import S3Scheme, register
_source = article(
authors=["V.A. Ditkin"],
title="On certain approximate formulas for the calculation of triple integrals",
journal="Doklady Akad. Nauk SSSR (N.S.)",
number="62",
year="1948",
pages="445–447",
note="Russian",
)
frac = sympy.Rational
sqrt = sympy.sqrt
pi = sympy.pi
def ditkin_1(alpha=0):
B0 = frac(4, (alpha + 5) ** 2)
B1 = frac((alpha + 3) * (alpha + 7), 12 * (alpha + 5) ** 2)
r, s = (sqrt((alpha + 5) * (5 + i * sqrt(5)) / 10 / (alpha + 7)) for i in [+1, -1])
d = {"zero3": [[B0]], "symm_rs0_roll": [[B1], [r], [s]]}
return S3Scheme("Ditkin 1", d, 5, _source)
def ditkin_2():
B0 = frac(4, 25)
B1 = frac(21, 500)
r, s = (sqrt((15 + i * 5 * sqrt(5)) / 42) for i in [+1, -1])
t = sqrt(frac(5, 21))
d = {
"zero3": [[B0]],
"symm_rs0_roll": [[B1], [r], [s]],
"symm_rrr": [[B1], [t]],
}
return S3Scheme("Ditkin 2", d, 5, _source)
def ditkin_3():
B0 = frac(16, 175)
B1 = frac(81, 1400)
B2 = frac(3, 280)
sqrt5 = sqrt(5)
r, s = (sqrt((5 + i * sqrt5) / 18) for i in [+1, -1])
t = sqrt(frac(1, 3))
u, v = (sqrt((3 - i * sqrt5) / 6) for i in [+1, -1])
d = {
"zero3": [[B0]],
"symm_rs0_roll": [[B1, B2], [r, u], [s, v]],
"symm_rrr": [[B2], [t]],
}
return S3Scheme("Ditkin 3", d, 7, _source)
register([ditkin_1, ditkin_2, ditkin_3])