So far we have looked into the theoretical aspects of structure formations, but in order to really, reach a deeper understanding of how it works we have to turn to numerical simulations. This is a very common practice in astrophysics and many other sciences. And the reason is that many interesting problems simply do not have analytical solutions. For example, in simple Newtonian gravity, which is about as simple as it gets, we can analytically solve rigorously only a 2 body problem, the Kepler problem. At a third mass point there are no analytical solutions except in some very special circumstances. This was proven analytically by point array 100 years ago, that there are no analytical solutions for more than 2-body problem when talking gravity. Now consider a galaxy with a couple hundred billion mass points of stars. Considered in hundreds of billions of galaxies in the universe. Clearly, we cannot solve a problem analytically, and we can resort to numerical simulations. Thus, numerical simulations are essential. They're not a sign of weakness. It's not just hard to do this, it's simply impossible to do it in any other way than numerically, and to simulate using the right kind of input physics inside a computer what mother nature does out there in the universe. Now, as far as the gravity part is concerned, we're in luck because the physics is relatively simple. It's well understood. We even have good understanding of the initial conditions from primordial density perturbation spectrum. Simulations of purely gravitating systems, just to name gravity, nothing else are relatively straightforward. However, if you start adding dissipative component such as gas, or radiation, things become vastly more complicated and infact, that's where cutting edge of numerical simulations in astrophysics is today. And, then finally we can compare output of the numberical simulations to the actually observations of the large scale structure. The first astrophysical simulation using N body interacting gravitationa lly was done as early as 1941 and not using a computer or rather an analog computer by Eric Homberg. What he did was he used light bulbs and photocells and since their intensity to light Decreases the same proportion as gravity, as inverse square law. You can then measure relative acceleration from each point to each other point. Compute the net accelerations. Move the points. And then repeat the whole thing. A very tedious way to do it. Things really started moving on in the 1970's, with the. Onset of modern digital computers. Here is one of the earliest simulations by Jim Peebles, the famous theoretical cosmologist. Soon enough, people were starting to add more realistic initial conditions and here is another early simulation by Simon White. Notice that these only have few hundred particles, which is obviously vastly less than, than is needed for really realistic simulation. The milestone paper was by Alar and Juri Toomre, who did simulations of colliding disc galaxies using a lot of approximations, but with a great physical intuitions, and they already reproduced interesting Morphological features like tidal distortions, tidal tails and bridges and things like that. With a small number of particles say planets in the solar system gravity works like a clock work and it's fairly simply to see what it happens. But, once you start having many, many bodies new phenomena come into the play. There is a phenomenon o dynamical friction which is when a massive body passes through a sea of utter massive particles, giving away some of its kinetic energy by accelerating them all. In effect, the gravitational field of all target particles acting with viscosity. So, this is what Toomre and Toomre saw. And in fact this a, explained many puzzling observations. We see strange looking galaxies or pairs of galaxies and now we understand that they're all product of galaxy collisions and galaxy mergers. More modern simulations carry out essentially the same thing and show that Toomre and Toomre pretty much g ot everything right. These are from Josh Barnes and his collaboraters and show simple collisions of galaxy discs using more modern computations. So what are simulations used for? First, we can use them to understand the evolution of large scale galaxy clustering. Then we can compare the simulations with actual observations like surveys. We can also use them to make predictions of what should be seen. And help interpret things like surveys. The basic process that goes on is hierarchical merging of smaller pieces into the larger ones. And that is, again, something that can be studied in detail, and compared to observations. Since the dark matter dominates gravitationally, by studying what happens even with just visible components, we can understand a little more about how dark matter is distributed. And thus, get some clues about what it might consist of. And once dissipative effects are understood, we can then study behavior of cosmic gas, radiation feedback by star formation, and so on. Different kinds of physics have to be put in, obviuosly, first the gravity thing, that's something we understand fairly well. But once we start talking about gas and dissipation we have to put hydrodynamics, energy dissipation processess, radiation losses, feedback and so on. So far, at least, magnetic fields do not play an important role in cosmology. But we just don't know really what happens in very early universe and what the origin of these magnetic fields is. Possibly the most challenging at this time is question of the radiation transfer. The photons are much smaller than galaxies and it's an scale. So if we really need to understand how the radiation propagates through universe, interacts with gas. Then we need a very precise More sophisticated simulations that we've been, able to do until recently. But let us focus on gravitational simulations. The N-body method. Once we have sufficiently large number of particles, we can consider them as a fluid. Not the gas that you know but it's a very much compressible fluid consisting of interactive particles, mostly dark matter but also things like stars and gas and sun. To the extent that we look at gravitational interaction alone this is a dissipation-less fluid. Energy is exchanged between particles and systems of particles, but there is no net energy lost to radiation. And so there, there is numerical methods that have been deployed. Direct integration of gravitational accelerations from each particle to each other one, is Very practical and time consuming. So a number of approximations that have been developed that can actually convey master important physics and be done much faster. In some situations like evolutional globular star clusters where we're talking about 10's or 100's or 1000's of mass points, direct simulations are actually viable. However, people do make special computer hardware. They design chips that are optimized to perform gravitational N-Body Simulation. A group in Tokyo is, in particular, being producing machines like that. They call them grape off of gravity pipe. Beyond that large glass of models, uses so called particle mesh simulations, where by collective effect of all other particles except one, is smoothed into a density field, a mesh, and then You can compute interaction of that particle with a density field. Much faster than you would if you say, consider all particles individually. So that reduces compute time from n squared, where n is number of particles, to n log n, which is much easier. There is another class of methods called tree methods or hierarchical methods, which just use clever grouping of particles to compute things again at similar faster pace. Which techniques is used is depending on the actual problem that's being attacked. In often times many of them are used at once for different aspects of the. Problem. Now let's take a look at the simulation by Andre Kravtsov of what a chunk of universe might look like as it's evolving. What's shown here is evolution of a cubical region of universe ab out hundred megaparsec in size and it's being rotate to show you what structure happens in 3D. Let's try it again. You can see that, first, dark matter condenses in smaller clumps. Which then merge into ever larger ones Forming the fila-, filamentary structure that we see, the cosmic web. Now, if we look at slightly smaller scale, we can see more detail. And here, we show formation of a group of galaxies. Again, using same thing. 'Kay. At the beginning, things are very smooth. Those are the initial density perturbations, very low amplitude. But then they grow, condensing into little dark halos, which keep merging into every larger ones. Let's take a look. Very smooth at first, but soon enough, things condense. Under their own gravity and then keep merging hierarchically into larger structures. Let's look at this again, and this is where you see hierarchical structure formation in action. Smaller things condensing under their own gravity, merging together to make larger ones. Here is a similar thing, but in this case simulation of a formation of a cluster of galaxies, done by John Dubinsky, again we start with very smooth sample conditions, and you see objects condensing and merging violently together with each other making larger and larger structures in the middle. Let's take a look again. Note, this is not stars. This is dark matter. If you, if you could see dark matter, this is what you would see.