Keep reading
You are hereCompare a drag orbit with a direct galaxy simulation
Galaxies in close encounters · Reading path
The prescribed drag improved our orbit estimate after the close pass. Before the same pass, the estimate with drag was slightly worse. Compare both intervals at matching times to see where the approximation earned its keep.
Download the reproduction ZIP and unpack it. The diagnostics are from nine direct encounters and eighteen paired isolated controls. Each contains the 151 stored times from start to 36 dimensionless time units. The two resolution levels use 640 and 1,280 massive particles per halo. The shorter of the two time steps is about 0.943 Myr.
Run the command below from the unpacked directory. The three raw files are optional for this command. Download them to inspect the full Float64 positions and velocities. The center IDs are selected once at the beginning and stay fixed.
python -B qualify.py data measured-checks.jsonGalaxy encounter direct-sum runs and archived numerical checks · Kroupa, Initial Conditions for Star Clusters, §8 (Cambridge N-Body Lectures)
The full prograde record first passes close at about 532 Myr. Its measured separation there is 15.0 kpc. Read before_passage and after_passage in the report. For the times up to and including the close sample, the errors in kiloparsecs are 1.33 without drag and 1.36 with it. Afterward they are 76.7 and 10.1.
The routine squares the difference in separation at each saved time, averages and takes a square root. The report uses length units of 10 kpc, so multiply by ten to get these values. A good value from that one number can hide the wrong number or timing of close passes. Scroll along the whole curve in the Lab.

Galaxy encounter direct-sum runs and archived numerical checks · Chandrasekhar, Dynamical Friction I (1943)
The fast pair has moved apart to 237 kpc by the last saved time. It still has a large tracer excess in the outskirts compared with its isolated controls. Track distance and outskirts separately. The first uses the two center tags and the second counts tracers more than 45 kpc from their own tag group.
For the prograde pass the self-gravitating haloes gained internal energy relative to the paired isolated controls. The native run conserves total energy to within about two parts in one hundred thousand at finer resolution. The rigid drag run discards energy from the orbit as a model term. The internal gain quoted here comes from the separate self-gravitating run and its two isolated controls.
Galaxy encounter direct-sum runs and archived numerical checks
The README pins Python, NumPy and SciPy versions and gives the three exact commands for a fine prograde run and both isolated controls. The compiler builds a small C routine for the direct sum. To repeat the numerical comparison from scratch, build all three grids and compare the new report with the saved one.
The included record tests the fixed orbit, equal masses, finite softening and sampling here. It leaves out gas and binary black holes. Changing the sideways speed in the Lab switches to the rigid model because the new parameters have no matching archived direct run.
Galaxy encounter direct-sum runs and archived numerical checks
For the later times in the prograde run, by what factor did the drag term reduce the separation RMSE?
About 7.6. Divide 76.7 kpc by 10.1 kpc. This is a comparison against the specific simulated record, with fixed drag strength.
Pause just after the prograde pass. Inspect which separation curves return inward, then save the visible frame and check its time and provenance.
Section III derives drag from weak gravitational deflections. Its field-star distribution is a local approximation in our application.
Equations 8.48–8.51 give the isotropic Plummer model. It supplies the initial distribution in radius and local speed. Our sampled spheres receive a finite softened virial adjustment.
Matched isolated controls, two timesteps, two particle counts and fixed local-drag comparisons for the released trajectories.
You are hereCompare a drag orbit with a direct galaxy simulation
Galaxies in close encounters · Reading path