Skip to content

Commit c224f90

Browse files
committed
Clarify use of IAS15 where symplectic integrators can't be used (IAS15 can't be used either in galpy)
1 parent 6e82fc0 commit c224f90

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

doc/source/orbit.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ which are speedy and reliable. For example, compare
10481048
# 4.65 ms ± 86.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)
10491049

10501050
The ``ias15_c`` method uses adaptive timestepping under the hood, and
1051-
can be used in cases where very high precision is required.
1051+
can be used in cases where very high precision is required during orbit integration.
10521052

10531053
If the C extensions are unavailable for some reason, I recommend using
10541054
the ``odeint`` pure-Python integrator, as it is the fastest. Using the

galpy/orbit/Orbits.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,7 @@ def check_integrator(method, no_symplec=False):
12951295
"leapfrog_c",
12961296
"symplec4_c",
12971297
"symplec6_c",
1298+
"ias15_c", # practically speaking, ias15 has the same limitations as symplectic integrators in galpy
12981299
]
12991300
[valid_methods.remove(symplec_method) for symplec_method in symplec_methods]
13001301
if method.lower() not in valid_methods:
@@ -1577,7 +1578,7 @@ def integrate_SOS(
15771578
Surface to punch through (this has no effect in 3D, where the surface is always z=0, but in 2D it can be 'x' or 'y' for x=0 or y=0).
15781579
t0 : float or Quantity, optional
15791580
Initial time.
1580-
method : {'odeint', 'dop853_c', 'dop853', 'rk4_c', 'rk6_c', 'dop54_c', 'ias15_c'}, optional
1581+
method : {'odeint', 'dop853_c', 'dop853', 'rk4_c', 'rk6_c', 'dop54_c'}, optional
15811582
Integration method to use. Default is 'dop853_c'. See Notes for more information.
15821583
progressbar : bool, optional
15831584
If True, display a tqdm progress bar when integrating multiple orbits (requires tqdm to be installed!).
@@ -1601,7 +1602,6 @@ def integrate_SOS(
16011602
- 'dopr54_c' for a 5-4 Dormand-Prince integrator in C
16021603
- 'dop853' for a 8-5-3 Dormand-Prince integrator in Python
16031604
- 'dop853_c' for a 8-5-3 Dormand-Prince integrator in C
1604-
- 'ias15_c' for an adaptive 15th order integrator using Gauß-Radau quadrature (see IAS15 paper) in C
16051605
16061606
- 2023-03-16 - Written - Bovy (UofT)
16071607
@@ -1754,7 +1754,6 @@ def integrate_dxdv(
17541754
- 'dopr54_c' for a 5-4 Dormand-Prince integrator in C
17551755
- 'dop853' for a 8-5-3 Dormand-Prince integrator in Python
17561756
- 'dop853_c' for a 8-5-3 Dormand-Prince integrator in C
1757-
- 'ias15_c' for an adaptive 15th order integrator using Gauß-Radau quadrature (see IAS15 paper) in C
17581757
17591758
- 2011-10-17 - Written - Bovy (IAS)
17601759
- 2014-06-29 - Added rectIn and rectOut - Bovy (IAS)
@@ -4968,7 +4967,7 @@ def SOS(
49684967
----------------
49694968
t0 : float or Quantity, optional
49704969
Time of the initial condition. Default is 0.
4971-
method : {'odeint', 'dop853_c', 'dop853', 'rk4_c', 'rk6_c', 'dop54_c', 'ias15_c'}, optional
4970+
method : {'odeint', 'dop853_c', 'dop853', 'rk4_c', 'rk6_c', 'dop54_c'}, optional
49724971
Integration method. Default is 'dop853_c'. See Notes for more information.
49734972
skip : int, optional
49744973
For non-adaptive integrators, the number of basic steps to take between crossings (these are further refined in the code, but only up to a maximum refinement, so you can use skip to get finer integration in cases where more accuracy is needed). Default is 100.
@@ -4994,7 +4993,6 @@ def SOS(
49944993
- 'dopr54_c' for a 5-4 Dormand-Prince integrator in C
49954994
- 'dop853' for a 8-5-3 Dormand-Prince integrator in Python
49964995
- 'dop853_c' for a 8-5-3 Dormand-Prince integrator in C
4997-
- 'ias15_c' for an adaptive 15th order integrator using Gauß-Radau quadrature (see IAS15 paper) in C
49984996
49994997
50004998
- 2023-03-16 - Written - Bovy (UofT)
@@ -5773,7 +5771,7 @@ def plotSOS(
57735771
Surface to punch through (this has no effect in 3D, where the surface is always z=0, but in 2D it can be 'x' or 'y' for x=0 or y=0). The default is None.
57745772
t0 : float or Quantity, optional
57755773
Time of the initial condition. The default is 0.0.
5776-
method : {'odeint', 'dop853_c', 'dop853', 'dop54_c', 'rk4_c', 'rk6_c', 'ias15_c'}, optional
5774+
method : {'odeint', 'dop853_c', 'dop853', 'dop54_c', 'rk4_c', 'rk6_c'}, optional
57775775
Method to integrate the orbit. The default is 'dop853_c'.
57785776
skip : int, optional
57795777
For non-adaptive integrators, the number of basic steps to take between crossings (these are further refined in the code, but only up to a maximum refinement, so you can use skip to get finer integration in cases where more accuracy is needed). The default is 100.

tests/test_orbit.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -7283,13 +7283,7 @@ def test_orbit_c_sigint_planar():
72837283

72847284
# Test that orbit integration in C gets interrupted by SIGINT (CTRL-C)
72857285
def test_orbit_c_sigint_planardxdv():
7286-
integrators = [
7287-
"dopr54_c",
7288-
"rk4_c",
7289-
"rk6_c",
7290-
"dop853_c",
7291-
"ias15_c",
7292-
]
7286+
integrators = ["dopr54_c", "rk4_c", "rk6_c", "dop853_c"]
72937287
scriptpath = "orbitint4sigint.py"
72947288
if not "tests" in os.getcwd():
72957289
scriptpath = os.path.join("tests", scriptpath)

0 commit comments

Comments
 (0)