RKkit 0.1.7__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rkkit-0.1.7 → rkkit-0.1.9}/.gitignore +1 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/PKG-INFO +16 -2
- {rkkit-0.1.7 → rkkit-0.1.9}/PythonExamples/AllProperties.py +6 -1
- {rkkit-0.1.7 → rkkit-0.1.9}/PythonExamples/Example.py +6 -19
- {rkkit-0.1.7 → rkkit-0.1.9}/PythonExamples/Gaussian.py +12 -3
- {rkkit-0.1.7 → rkkit-0.1.9}/PythonExamples/GoodAndBad.py +7 -2
- {rkkit-0.1.7 → rkkit-0.1.9}/PythonExamples/RadauByCollocation.py +5 -1
- {rkkit-0.1.7 → rkkit-0.1.9}/PythonExamples/Tchebychev.py +11 -2
- {rkkit-0.1.7 → rkkit-0.1.9}/PythonExamples/Test.py +5 -1
- {rkkit-0.1.7 → rkkit-0.1.9}/README.md +15 -1
- {rkkit-0.1.7 → rkkit-0.1.9}/pyproject.toml +1 -1
- {rkkit-0.1.7 → rkkit-0.1.9}/tests/test.py +5 -1
- {rkkit-0.1.7 → rkkit-0.1.9}/AUTHORS +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/LICENSE +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/Notebooks/AllProperties.ipynb +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/Notebooks/Example.ipynb +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/Notebooks/Gaussian.ipynb +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/Notebooks/GoodAndBad.ipynb +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/Notebooks/RadauByCollocation.ipynb +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/Notebooks/Tchebychev.ipynb +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/Notebooks/Test.ipynb +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/README.md +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/RKExceptions.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/RKPolutilities.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/RKRungeKutta.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/RKTrees.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/RKcolloc.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/RKformula.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/RKplot.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/__init__.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/RKkit/formulas.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/TODO.md +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/_doctest_environment.py +0 -0
- {rkkit-0.1.7 → rkkit-0.1.9}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: RKkit
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Playing with Runge-Kutta methods
|
|
5
5
|
Project-URL: Homepage, https://github.com/Thierry-Dumont/RKkit
|
|
6
6
|
Project-URL: Issues, https://github.com/Thierry-Dumont/RKkit/issues
|
|
@@ -32,6 +32,14 @@ With sage do:
|
|
|
32
32
|
|
|
33
33
|
`sage -pip install RKkit`
|
|
34
34
|
|
|
35
|
+
or (at least if you installed sage with conda):
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
`conda activate sage`
|
|
39
|
+
|
|
40
|
+
`pip install RKkit`
|
|
41
|
+
|
|
42
|
+
|
|
35
43
|
With passagemath:
|
|
36
44
|
|
|
37
45
|
1- Install passagemath in a virtualenv
|
|
@@ -154,7 +162,7 @@ and then, launch the notebook _Exemple1.ipynb_from Notebooks.
|
|
|
154
162
|
|
|
155
163
|
## Gaussian formulas (and other methods obtained by collocation) ##
|
|
156
164
|
|
|
157
|
-
|
|
165
|
+
Gaussian formulae with n steps are obtained by collocation at the roots of the Legendre P polynomials of degree n, shifted from [-1,1] to [0,1].
|
|
158
166
|
|
|
159
167
|
RKcolloc.colloc computes the Butcher arrays, given collocation points
|
|
160
168
|
in [0,1] and returns a Runge-Kutta method class (note that
|
|
@@ -202,3 +210,9 @@ if you use passagemath, you can install jupyter in the virtualenv:
|
|
|
202
210
|
A precedent version was using Sage's
|
|
203
211
|
[@lazy_attribute](http://doc.sagemath.org/html/en/reference/misc/sage/misc/lazy_attribute.html)
|
|
204
212
|
decorator, which could be disturbing.
|
|
213
|
+
|
|
214
|
+
#### Note about graphics: ####
|
|
215
|
+
|
|
216
|
+
When using the code with passagemath/ipython, graphics -if any- cannot
|
|
217
|
+
be displayed. But in any case (using sage ou passagemath/sage) they
|
|
218
|
+
can be saved in png files (see for example PythonExamples/Gaussian.py).
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
# Let us, for axample compute "all" the properties of a Gauss formula.
|
|
9
9
|
|
|
10
10
|
#
|
|
11
|
-
|
|
11
|
+
try:
|
|
12
|
+
import passagemath_flint
|
|
13
|
+
print("Using passagemath")
|
|
14
|
+
except:
|
|
15
|
+
print("Not using passagemath")
|
|
16
|
+
#
|
|
12
17
|
from sage.functions.orthogonal_polys import legendre_P
|
|
13
18
|
from sage.rings.qqbar import *
|
|
14
19
|
#
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
# coding: utf-8
|
|
3
3
|
|
|
4
4
|
# # Playing with Runge-Kutta methods ##
|
|
5
|
-
|
|
5
|
+
try:
|
|
6
|
+
import passagemath_flint
|
|
7
|
+
print("Using passagemath")
|
|
8
|
+
except:
|
|
9
|
+
print("Not using passagemath")
|
|
10
|
+
#
|
|
6
11
|
#
|
|
7
12
|
from RKkit import *
|
|
8
13
|
# Let us import somme predefined Runge-Kutta method descriptions:
|
|
@@ -70,25 +75,7 @@ print(F.order())
|
|
|
70
75
|
print(F.is_Symplectic())
|
|
71
76
|
|
|
72
77
|
|
|
73
|
-
# Now, let us plot the stability domain:
|
|
74
|
-
|
|
75
|
-
# In[17]:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
#@interact
|
|
79
|
-
def P(WindowSize=(0.1,10,0.5),Translate=(-50,50,5)):
|
|
80
|
-
RKplot(F,fill=True,ncurves=2,Enlarge=WindowSize,TranslateX=Translate).show()
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
# We can also plot the orde star (slow):
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
#@interact
|
|
87
|
-
def PStar(WindowSize=(0.01,10,0.5),Translate=(-50,50,5)):
|
|
88
|
-
RKplot(F,fill=True,ncurves=1,type="star",Enlarge=WindowSize,TranslateX=Translate).show()
|
|
89
|
-
|
|
90
78
|
|
|
91
|
-
# In[ ]:
|
|
92
79
|
|
|
93
80
|
|
|
94
81
|
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
# ### Gaussian formulae ###
|
|
5
5
|
#
|
|
6
|
-
|
|
6
|
+
try:
|
|
7
|
+
import passagemath_flint
|
|
8
|
+
print("Using passagemath")
|
|
9
|
+
except:
|
|
10
|
+
print("Not using passagemath")
|
|
11
|
+
#
|
|
7
12
|
from sage.rings.qqbar import *
|
|
8
13
|
from sage.functions.orthogonal_polys import legendre_P
|
|
9
14
|
from RKkit import *
|
|
@@ -40,7 +45,11 @@ for n in range(2,4):
|
|
|
40
45
|
print("conserve quadratic invariants?",F.conserve_quadratic_invariants())
|
|
41
46
|
print("symplectic ?",F.is_Symplectic())
|
|
42
47
|
p=RKplot(F,fill=True,ncurves=2,Enlarge=1)
|
|
43
|
-
p.show()
|
|
44
48
|
q=RKplot(F,fill=True,ncurves=2,type="star",Enlarge=1)
|
|
49
|
+
p.show()
|
|
45
50
|
q.show()
|
|
46
|
-
|
|
51
|
+
pfile=f"{G.Title}.stability.png"
|
|
52
|
+
p.save(pfile)
|
|
53
|
+
qfile=f"{G.Title}.starfuntion.png"
|
|
54
|
+
q.save(qfile)
|
|
55
|
+
print(f"Graphics are saved in {pfile} and {qfile}")
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# coding: utf-8
|
|
3
3
|
|
|
4
|
-
# ##
|
|
4
|
+
# ## Illustrates how to create a Runge-Kutta method.
|
|
5
5
|
#
|
|
6
6
|
# Remember that we must use exact sets of number, namely (real) algebraic nubers (AA or QQbar) or rationals (QQ) when defining Runge-Kutta methods.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
try:
|
|
9
|
+
import passagemath_flint
|
|
10
|
+
print("Using passagemath")
|
|
11
|
+
except:
|
|
12
|
+
print("Not using passagemath")
|
|
13
|
+
|
|
9
14
|
from sage.rings.qqbar import *
|
|
10
15
|
#
|
|
11
16
|
from RKkit import *
|
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
# Here we use Tchemychev polynomials.
|
|
8
8
|
# The formulas does not present any interesting application !
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
try:
|
|
11
|
+
import passagemath_flint
|
|
12
|
+
print("Using passagemath")
|
|
13
|
+
except:
|
|
14
|
+
print("Not using passagemath")
|
|
15
|
+
|
|
11
16
|
from sage.functions.orthogonal_polys import chebyshev_T
|
|
12
17
|
#
|
|
13
18
|
|
|
@@ -40,9 +45,13 @@ for n in range(3,5):
|
|
|
40
45
|
print("algebraically stable?",F.is_algebraically_stable())
|
|
41
46
|
print("conserve quadratic invariants?",F.conserve_quadratic_invariants())
|
|
42
47
|
p=RKplot(F,fill=True,ncurves=2,Enlarge=1)
|
|
48
|
+
pfile=f"{G.Title}.stability.png"
|
|
43
49
|
p.show()
|
|
50
|
+
p.save(pfile)
|
|
44
51
|
q=RKplot(F,fill=True,ncurves=2,type="star",Enlarge=1)
|
|
45
52
|
q.show()
|
|
46
|
-
|
|
53
|
+
qfile=f"{G.Title}.starfuntion.png"
|
|
54
|
+
q.save(qfile)
|
|
55
|
+
print(f"Graphics are saved in {pfile} and {qfile}")
|
|
47
56
|
|
|
48
57
|
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
# coding: utf-8
|
|
3
3
|
|
|
4
4
|
# ## Test: can we compute all properties for all coded formulas? ##
|
|
5
|
-
|
|
5
|
+
try:
|
|
6
|
+
import passagemath_flint
|
|
7
|
+
print("Using passagemath")
|
|
8
|
+
except:
|
|
9
|
+
print("Not using passagemath")
|
|
6
10
|
from sage.rings.qqbar import *
|
|
7
11
|
import sage.rings.qqbar
|
|
8
12
|
#
|
|
@@ -10,6 +10,14 @@ With sage do:
|
|
|
10
10
|
|
|
11
11
|
`sage -pip install RKkit`
|
|
12
12
|
|
|
13
|
+
or (at least if you installed sage with conda):
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
`conda activate sage`
|
|
17
|
+
|
|
18
|
+
`pip install RKkit`
|
|
19
|
+
|
|
20
|
+
|
|
13
21
|
With passagemath:
|
|
14
22
|
|
|
15
23
|
1- Install passagemath in a virtualenv
|
|
@@ -132,7 +140,7 @@ and then, launch the notebook _Exemple1.ipynb_from Notebooks.
|
|
|
132
140
|
|
|
133
141
|
## Gaussian formulas (and other methods obtained by collocation) ##
|
|
134
142
|
|
|
135
|
-
|
|
143
|
+
Gaussian formulae with n steps are obtained by collocation at the roots of the Legendre P polynomials of degree n, shifted from [-1,1] to [0,1].
|
|
136
144
|
|
|
137
145
|
RKcolloc.colloc computes the Butcher arrays, given collocation points
|
|
138
146
|
in [0,1] and returns a Runge-Kutta method class (note that
|
|
@@ -180,3 +188,9 @@ if you use passagemath, you can install jupyter in the virtualenv:
|
|
|
180
188
|
A precedent version was using Sage's
|
|
181
189
|
[@lazy_attribute](http://doc.sagemath.org/html/en/reference/misc/sage/misc/lazy_attribute.html)
|
|
182
190
|
decorator, which could be disturbing.
|
|
191
|
+
|
|
192
|
+
#### Note about graphics: ####
|
|
193
|
+
|
|
194
|
+
When using the code with passagemath/ipython, graphics -if any- cannot
|
|
195
|
+
be displayed. But in any case (using sage ou passagemath/sage) they
|
|
196
|
+
can be saved in png files (see for example PythonExamples/Gaussian.py).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|