# How do various astrophysical models deal with so many orders of magnitude in scale? Are there completely different models for different scales?

If we just model our solar system's dynamics, one could use a straightforward numerical integrator with all n(n-1)/2 gravitational interactions along with some torques and non-gravitational forces. However it was found to be no less accurate (limited by the availability of measured data with with to fit) to treat certain tightly bound systems as somewhat isolated. For example, forces between the smallest moons of two widely separated planets don't need to be treated explicitly, and using the Jovian system's barycenter is sufficient to perturb Mercury's orbit.

Similarly, in the dynamics within a single galaxy numerical models don't treat all n(n-1) two-body forces when n=1011. Instead models can use some hybrid techniques - treating each of a large number of small volumes of the galaxy as having an average density, while at the same time using different models that operate on what's put inside each of those volumes.

Those are just examples of my meagre understanding of the topic.

But I'd like to ask, and this is a hard question to formulate and may be hard to answer - how do various astrophysical models deal with so many orders of magnitude in scale? Have they sort-of settled on some standard ways of chopping things up?

Just for a hypothetical example "class I" for solar systems, class II for stellar clusters or groups (IIa and IIb might be with or without a black hole) class III for entire galaxies, class IV for galactic clusters and class V for bigger/biggest?

You might embed one class in another, a galactic model might also contain say 100,000 stars with randomly initiated solar systems as sort of "test particles" within a fluid representing the rest of the matter.

Or is it better to characterize the current state of the art as still in the process of trying out all kinds of ways of dealing with scale?

For a nice illustration of how many orders of magnitude are involved, have a nice experience zooming out at https://htwins.net/scale2/

• distance from Earth to Moon at 108.8 meters
• distance from Voyager to Earth at 1013.5 meters
• observable universe at 1026.5 meters
• There are some interesting ideas for dealing with stuff at cosmological scales in this article from 2007: astronomy.swin.edu.au/sao/guest/knebe There's more recent info (also primarily about cosmological scales) in the article I linked here: astronomy.stackexchange.com/questions/55010/… Commented Oct 27, 2023 at 22:30
• Most of that is just built in to how floating point numbers work. A 64 bit floating point number stores about 15 digits of precision, then varies the mantissa for scale, anywhere from about $10^{-308}$ to $10^{308}$. When it comes time to add them together, they are added together starting with the smallest absolute values, ending with the largest. Commented Oct 28, 2023 at 2:42
• @GregMiller The issue isn't as much the mix of large and small distances as it is the vast numerical quantity of individual sources of gravity that has to be managed by grouping them. For n object the number of pairs is n(n-1)/2. When n = $10^{11}$ that's a lot of objects to store in memory and a lot of pair-wise forces to evaluate every cycle, no matter what precision you choose.
– uhoh
Commented Oct 28, 2023 at 2:46
• @uhoh but then your question is not about dealing with orders of magnitude, but simply about the size of number of nodes of the simulations. That is not so different than elsewhere. Commented Oct 28, 2023 at 2:55
• @Greg It's not $10^{11}$ numbers. It's $10^{11}$ bodies in a n-body gravity integration, with each body having a mass, and 3D position & velocity vectors. And then you want to compute the forces at each step, preferably without having to consider each of the $10^{22}/2$ pairs of bodies separately. Commented Oct 28, 2023 at 17:58

If I understand correctly, the problem you describe appears in numerical simulations where you have to choose between simulating a large enough volume, and fine enough details. If so, then the answer is subgrid physics.

As an example, let's say a cosmological hydro-simulation uses $$10^{11}$$ particles to simulate a cubic gigalightyear. If I've done my maths right, this would mean that each particle would represent $$\sim10^7\,M_\odot$$. With a minimum of 10 (poor) to 100 (preferred) particles to represent a galaxy, this is acceptable if you're interested in, say, number statistics or clustering statistics of galaxies above $$10^{8\text{–}9}\,M_\odot$$.

But $$10^7\,M_\odot$$ is only the upper limit of the mass range of the molecular clouds from which stars are born, so how can you ever simulate star formation, which is important not only if you're interested in stellar populations and galaxy luminosities, but actually also affects the galaxy masses through their feedback which may push gas out of the galaxies?

The answer is that you use results from observations, analytical models, and lower-volume, higher-resolution simulations that teach you how stars are formed and how they affect the gas around them. From these you know for instance that gas needs to be 1) dense and 2) cold, in order to form a star. In your huge simulation you can then say "If the density of gas particles exceeds a certain threshold, and their temperature is below some threshold, and if they have a negative velocity gradient, then (a fraction of) the gas particles should be converted to star particles."

Subsequently you can say that stars are treated as either 1) low-mass or 2) high-mass. For the purposes of the simulation, given the size of a time step low-mass stars live forever while high-mass stars die instantly, being converted back into gas particles. A gas particle has an associated metallicity (and possibly dust), which has now increased by some yield, and because massive stars die not with a whimper, but with a bang, a certain amount of energy is now dumped into the surrounding gas particles as either heat, or momentum, or a mixture thereof, giving rise to feedback.

The scenario described above uses particles as an example, but the same approach is used for cell-based simulations. In both cases, we're dealing with physics that is not resolved by the particles/cells, and hence is referred to as subgrid physics.

The highest-resolution hydro-simulations of molecular clouds contain individual stars, but the stars themselves are not resolved. So how do we know how much energy they produce when they explode, how much metals they produce, what kind of spectrum they emit, etc.? Yes, by observations, analytical models, and even higher-resolution simulations that tell you how stars evolve.

• Thanks! You definitely understand the question correctly, and "subgrid physics" is the concept I needed to hear about. It also seems that no matter what the scale, simulations are generally better described as hydrodynamic than as n-body-like, i.e. there's a grid (though it may or may not be fixed). I wonder if there are a few well-defined scales that characterize most modern work (e.g. my class I through class V example) or not.
– uhoh
Commented Nov 1, 2023 at 19:13
• @uhoh It's true that hydro-sims are more realistic than pure N-body (given that the real world is not composed of dark matter only), but on the largest scales it's a rather minor error to not include it, so N-body codes definitely still are important. I don't think there's a scale that characterize most modern work, but to be honest I don't pay so much attention to scales that are significantly smaller than a galaxy.
– pela
Commented Nov 2, 2023 at 11:13
• In my work, that is. In my normal life I do occasionally pay attention to things that are smaller than galaxies.
– pela
Commented Nov 2, 2023 at 11:14