I believe astrophysics simulation use Lagrange and Hamilton dynamics to solve large problem of celestial bodies.
In particular they us a trick called "the central force problem"
this is a method that allows to cluster group of bodies that are far away form other bodies and resolve the as if they were a single body
for example say you want to simulate the solar system with all planes, moons, and satellite etc.
use the central force formulation, the earth moon is a local body with a center, Jupiter is another central body. and so on.
the this system is no hundred of body is a hierarchical system with 9 bodies, and each body has few child bodies. Now each one of those subsystem can use different scale.
if you want to extend that so the galaxy, the each solar system is a child. of the black hole at the center, and for you want to extend that to the cluster of galaxy the each galaxy is a central system and so on until you can cover the entire visible universe.
notice that the central problem is no a trick or an approximation, this is a presides method the yield the correct solution if the principle of least action is valid.
on the other hand the brute force approach lead to a degenerated simulation doe to the accumulation error.
this lagrigyan and Hamiltonian simulation are at the front for eh prediction of Dark Matter, Dark Energy, and even the 9 or 10 earth planet. which apparently has to be form four to ten earth massed in other for the solar system to be the way it is.
all solar system simulation produce a chaotic system unless they add a 10 heavy planet and they also predict that the plane should be there somewhere.
here is an animation of who a tow body central problem will look.
https://www.google.com/search?q=body+center+moon+earth&rlz=1C1GGRV_enUS751US751&tbm=isch&source=iu&pf=m&ictx=1&fir=DJ75Bkn6swIOYM%253A%252CUPgIMFAOQq1LaM%252C_&usg=__RtKkePVMNLRHwLAn8BEcseNOOZc%3D&sa=X&ved=0ahUKEwjf4bKs1KDXAhUW1WMKHew-AngQ9QEIRDAE#imgrc=DJ75Bkn6swIOYM: