You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EXP orbit integration yields a large deviation from Gadget simulation #159
When attempting to predict the orbit of a particle in several EXP potentials representing galaxy components in a Gadget n-body simulation, the particle displays a completely different behavior from the simulation. The particle should remain in a stable orbit around the galaxy center for the duration of the simulation. However after 3 Gyr, the particle escapes from the host galaxy.
The Gadget orbit itself has been 'kicked out' of the galaxy so it seems that pyEXP playback is actually doing a pretty good job here. See more details below...
Nota Bene
For anyone else looking at this: I needed to comment out the import of pygadgetreader, needed by load_utils.py but not used in the example notebook.
A more detailed look at the orbit
The following two plots show the x, y vs time for the replay and the simulation. I did not have access to the exact times for the orbit grid, so I simply used the array index as a proxy for time.
The x-y values look fairly similar at early times in this plot. Something clearly happens at later time. Now let's look at the same plots for the z coordinate.
Again, the two are fairly close at early time but at t>=0.003, the simulation orbit leaves the disk plane, as does the pyEXP orbit. This is the same point where the large deviation begins to be evident in the x-y plane plots.
Some overall conclusions and comments
The orbits in an n-body system are generally exponentially divergent. We rely confining integrals of motion to get nice rosette orbits, etc., but given that the information about the gravitational field is discretized, the simulation and the playback will exponentially diverge no matter what.
Even for nicely bound disk orbits one will find that they will diverge from the original simulation orbits in some finite number of orbital times. It's part of the physics. One can delay the divergence with denser time sampling of the phase space, but can't eliminate it.
In this particular orbit, it's clear that the Gadget simulation itself has 'kicked out' the orbit. This dynamics is especially exponentially sensitive (i.e. the exact trajectory depends on a sudden change which depends sensitively on time), so a larger deviation between the playback and the simulation should be expected here. One way to think about this is: whatever feature causes the Gadget orbit to be 'kicked' makes a saddle-point in the gravitational field. And saddle points promote strong exponential divergence.
Activity
The9Cat commentedon Aug 28, 2025
TL;DR
The Gadget orbit itself has been 'kicked out' of the galaxy so it seems that
pyEXPplayback is actually doing a pretty good job here. See more details below...Nota Bene
For anyone else looking at this: I needed to comment out the import of
pygadgetreader, needed byload_utils.pybut not used in the example notebook.A more detailed look at the orbit
The following two plots show the
x, yvs time for the replay and the simulation. I did not have access to the exact times for the orbit grid, so I simply used the array index as a proxy for time.The
x-yvalues look fairly similar at early times in this plot. Something clearly happens at later time. Now let's look at the same plots for thezcoordinate.Again, the two are fairly close at early time but at
t>=0.003, the simulation orbit leaves the disk plane, as does thepyEXPorbit. This is the same point where the large deviation begins to be evident in thex-yplane plots.Some overall conclusions and comments
michael-petersen commentedon Nov 25, 2025
I'm tempted to close this, as it looks like we understand the issue. Maybe one last chance @M1ssing-N0 to weigh in?