Types of Nbody ODE Integration Methods
June 9, 1996
34
This method will not be found in any books, it is an ad hoc method that I created
early in the development of XStar. Before I had even really looked into the books on
solving this kind of differential equation, I knew that I could use the previous values to
help out. An early version of XStar, version 1.1.0, used the formula:
But the
term is expensive to calculate, so it was approximation by:
Simply adding this approximation made a dramatic improvement in the overstep
problem when stars passed close together. The reason for this is fairly apparent: when an
overstep occurs, the acceleration goes from being a large positive number to being a fairly
large negative number. The difference is going to be a very large negative number. This
dramatically reduces the amount of energy that is gained. The result looks like the star
`just missed' the collapsar.
One of my next thoughts was to try and approximate
even closer by using
additional terms. This is typically done by taking the derivative of the Lagrange polyno
mial. The Lagrange polynomial,
L(t)
, is the fairly straight forward polynomial that
matches a given set of output values for a given set of values of t. Between those selected
times, however, the values of the Lagrange polynomial can fluctuate widely. The more
terms that the Lagrange polynomial has, the more it can fluctuate. Thus, when you take the
derivative of the Lagrange polynomial, the result can get worse with additional terms.
(2:15762,4:2958,15:97,13:313)
I tried using the Lagrange polynomial of order 2 (i.e. the above formula), 3 and 4.
The results were clearly the best for the 3rd order derivative.
The AdamBashford method uses any number of previous values to help calculate
the next value of
. This method has forms of any order, but they are all in the
form of:
Where
r, a
1
, a
2
..., a
n
, are constants.
x
t
h
+
(
)
x
t
(
)
hv
t
(
)
12
h
2
f
x
t
(
)
(
)
16
h
3
f
'
x
t
(
)
(
)
+
+
+
=
f
'
x
t
(
)
(
)
f
'
t
(
)
a
'
t
(
)
=
a
t
(
)
a
t
h

(
)

f
'
t
(
)
x
'
t
(
)
f
x
t
(
)
(
)
=
x
t
h
+
(
)
x
t
(
)
hr
a
1
f
x
t
(
)
(
)
a
2
f
x
t
h

(
)
(
)

a
3
f
x
t
2

(
)
(
)
...

+
[
]
+
=
This document is best viewed as nbody.pdf because the translation to html was buggy.