computer simulations
https://kipac.stanford.edu/taxonomy/term/1762
enSimulating the universe as the ultimate Big Data problem
https://kipac.stanford.edu/highlights/simulating-universe-ultimate-big-data-problem
<span>Simulating the universe as the ultimate Big Data problem</span>
<div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><em>by Devon Powell</em></p>
<p><img alt="Devon Powell. (Photo courtesy D. Powell.)" data-entity-type="file" data-entity-uuid="bbaa016a-e25c-4513-9a09-2dd36eb98ee7" height="293" src="https://kipac.stanford.edu/sites/default/files/inline-images/DevonThumb.jpg" width="220" /></p>
<p><strong>A complicated calculation</strong></p>
<p>In the early summer of 1945, physicist Bob Christy asked fellow physicist Richard Feynman to carry out a task as quickly as possible. The deadline was the Trinity nuclear test, the first nuclear bomb and the culmination of years of secret work by Manhattan Project scientists. The task was to predict the total energy that would be released by the Gadget device, the prototype implosion bomb designed at Los Alamos.</p>
<p>Although this type of calculation had been done before, the rush caused Feynman to drop everything and rally his troops. In those days, mathematical operations were carried out by literal human “computers” either working by hand (i.e. looking at a table of logarithms) or using mechanical arithmetic machines. This meant that each human computer could perform one operation every few seconds. Time management was of the utmost importance.</p>
<p> </p>
<figure role="group" class="caption caption-img">
<img alt="A room of human computers at work at NACA (now NASA) in 1949. (Credit: NASA.)" data-entity-type="file" data-entity-uuid="ba3383c6-3d3e-43d6-9201-208abc5f621a" height="412" src="https://kipac.stanford.edu/sites/default/files/inline-images/Human_computers_-_Dryden_0.jpg" width="526" />
<figcaption><em>A room of human computers at work at NACA (now NASA) in 1949.<br />
(Credit: NACA (NASA).)</em></figcaption>
</figure>
<p> </p>
<p>The resulting system was, in typical Feynman style, elegant. Predicting the bomb yield involved many high-level calculations, each consisting of many computer operations. These calculations did not all depend on each other, so some could be worked on independently. Results of individual operations were passed from human computer to human computer on cards, which were color-coded by the calculation they belonged to. In addition to the colors allowing operations to be done in parallel, they also allowed cards from different calculations to be mixed. This meant that a queue of cards from any number of different calculations could be fed through the same specialized mathematical operation, and sorted back out afterwards. Jobs of different priorities could also be reordered. Errors could also be quickly identified and traced back through a stack of cards, so that downtime for error correction was minimized. This system today might be referred to as an <em>algorithm</em>.</p>
<p>(<strong>Note</strong>: important technical terms are in italics, and can be found in a short glossary at the end of this post.)</p>
<p>Feynman and his team finished the job. The types of physics they needed to simulate the bomb are typical of many science applications in astrophysics and cosmology. Some of the computational techniques they pioneered to help simulate them are still in use at the world’s largest supercomputers. Hydrodynamics (the study of moving fluids), radiation transport (modeling the propagation of light or radiation through a fluid), and nuclear physics (modeling interactions between radiation and atomic nuclei) are all fields of active research in modern astrophysics. Together, hydrodynamics, radiation transport, nuclear physics, chemistry, and gravity are important for studying nuclear fusion in stars and supernovae, interstellar gas, ionization, accretion around black holes, and much more.</p>
<p> </p>
<figure role="group" class="caption caption-img">
<img alt="A diagram of an active galactic nucleus. (Credit: By Original: Unknown; Vectorization: Rothwild [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via Wikimedia Commons.)" data-entity-type="file" data-entity-uuid="445ee379-04ab-4227-b9fc-128116151606" src="https://kipac.stanford.edu/sites/default/files/inline-images/550px-Galaxies-AGN-Inner-Structure.svg__0.png" />
<figcaption><em>A diagram of an active galactic nucleus (AGN), one of the brightest types of long-term objects known to exist in the Universe. Many types of complex physics interact to produce a bright jet of plasma moving close to the speed of light. To fully model an active galactic nucleus, one would need to consider radiation transport, gravity (Einsteinian general relativity), hydrodynamics, and magnetohydrodynamics. (Image available via Wikimedia Commons.)</em></figcaption>
</figure>
<p> </p>
<p><strong>What does it mean to simulate a physics problem on a computer?</strong></p>
<p>Astrophysical processes are described by partial differential equations (PDEs). This is a special type of equation describing how physical systems change over time. Here are several examples:</p>
<figure role="group" class="caption caption-img">
<img alt="Euler equations." data-entity-type="file" data-entity-uuid="a856e3b4-2813-4577-9135-e9b731e79dd1" height="177" src="https://kipac.stanford.edu/sites/default/files/inline-images/EulerPDE_0.JPG" width="257" />
<figcaption><em>The Euler equations describe the motion of a fluid, such as interstellar gas.</em></figcaption>
</figure>
<p> </p>
<figure role="group" class="caption caption-img">
<img alt="Vlasov-Poisson equations." data-entity-type="file" data-entity-uuid="f192e02a-8588-4094-abc3-eff4820286c3" src="https://kipac.stanford.edu/sites/default/files/inline-images/Vlasov-PoissonPDE_0.JPG" />
<figcaption><em>The Vlasov-Poisson system describes the motion of dust and dark matter under the influence of gravity.</em></figcaption>
</figure>
<p> </p>
<figure role="group" class="caption caption-img">
<img alt="Radiative transfer equation." data-entity-type="file" data-entity-uuid="e6aded83-907f-4c37-b937-6ccabb2dd977" src="https://kipac.stanford.edu/sites/default/files/inline-images/RadiativeTransferPDE_0.JPG" />
<figcaption><em>The radiation transport (or radiative transfer) equation describes the propagation of radiation and the interaction between radiation and matter.</em></figcaption>
</figure>
<p> </p>
<p>Don’t worry about understanding these equations if you are unfamiliar with the pieces of them—I’m just showing you to give you a sense of their complexity (the actual solutions would occupy many more pages, yet). They are called <em>non-linear PDEs</em> by physicists, and they are very difficult to solve by hand. Analytic solutions to these equations (mathematical expressions that can be written down succinctly) are rare and are often uninteresting for learning about the complex physics in space. This means that in most cases, the only way to study a complicated nonlinear system in detail is to simulate it on a computer.</p>
<p>In fact, solving nonlinear PDEs is so difficult that when we simulate them on the computer, we are actually solving for an <em>approximation</em> to the true solution. This is by necessity, since computers only have a finite amount of memory and processing power. So, we reduce the amount of information the computer needs to hold by <em>discretizing</em> the data. This means that we break the simulation into a large, but manageable, set of numbers in computer memory. The way in which this is done must be derived mathematically so that the discrete version of the simulation is consistent with the original equations. There are many ways to do this for different equations, but the important thing to remember is that we can run a simulation on some finite data set meant to approximate the true solution.</p>
<p>Clearly, though, an approximation is not a true solution to a problem. This is a philosophical challenge often posed to computational physicists: Why bother simulating something that is just an approximation? As it turns out, the <a href="https://en.wikipedia.org/wiki/Lax_equivalence_theorem" target="_blank">Lax Equivalence Theorem</a> states that if we did have an infinitely large computer, and we discretized our simulation into an infinitely large memory bank, then we would in fact get the exact solution. This is true as long as the discretized simulation is mathematically consistent with the original physics PDE. Furthermore, the more information we store on a real computer with finite memory, the closer to the true solution our approximation becomes. This is a very powerful phenomenon called convergence. In a nutshell, it means that a higher fidelity simulation will produce a result closer to the true solution.</p>
<p>Imagine two digital photos side-by-side: the one taken with a 10-megapixel camera will look much better than the one taken with a first-generation iPhone. It’s not as perfect as looking at the actual scene with your eyes, but it’s extremely close. In the same way, as we apply more and more memory and processing power to our simulation (of, say, the Milky Way, as an example) we will continue to develop a much clearer scientific picture.</p>
<p><strong>What I use this for</strong></p>
<p>My research interests lie in using computational geometry to create more physically consistent discretizations for astrophysical systems by taking advantage of 3D solid geometry calculations. During my graduate career, I have written or improved upon computer codes that solve all three of the above PDEs: the Euler equations for hydrodynamics, the Vlasov-Poisson equation for gravity, and the radiative transfer equation. These are three very different types of physics, so different algorithms are needed to solve them. The latter two are most relevant to my work, so I will focus on them.</p>
<p>The Vlasov-Poisson equation describes how dust or dark matter (any pressureless fluid) moves under the influence of its own gravity. This is the physical system that N-body simulations approximate in order to study the distribution of matter on cosmic scales. I <a href="https://arxiv.org/abs/1412.4941" target="_blank">published a paper</a> with my advisor, Tom Abel, on the use of a new dark matter discretization to create much smoother and clearer pictures of the matter density distribution in the Universe. This was the topic of a previous KIPAC blogpost, <a href="https://kipac.stanford.edu/highlights/where-invisible-things-are-probing-phase-space-structure-dark-matter" target="_blank">"Where the invisible things are: Probing the phase space structure of dark matter"</a>. Our method relies technically on being able to compute the exact volume contained in the intersection between a tetrahedron and a cube. Researching this seemingly simple problem exposed me to a world of computational geometry that had never been applied to physics calculations.</p>
<p>Below is a figure showing the time evolution of the cosmic density field using this new discretization. The simulation is smoother and more physically consistent with the original Vlasov-Poisson equation than traditional N-body methods. However, the new method requires many more individual computer operations.</p>
<figure role="group" class="caption caption-img">
<img alt="Time sequence of a cosmological simulation. (Credit: Devon Powell.)" data-entity-type="file" data-entity-uuid="06348afc-1d99-4b81-839c-ca801e100b0a" height="432" src="https://kipac.stanford.edu/sites/default/files/inline-images/lg3_p256_g256.png" width="575" />
<figcaption><em>A time sequence of a cosmological simulation I ran using our new dark matter discretization and remapping technique to create accurate cosmological mass maps. Each panel is a slice through the density field, with blue being the least dense and red the densest. Time moves from high redshift (top left) to low redshift (bottom right). (This simulation was run on 128 nodes, taking a couple of hours on a modest supercomputer rather than the days it would on my laptop.) (Credit: Devon Powell.)</em></figcaption>
</figure>
<p> </p>
<p>I have most recently been applying the same computational geometry algorithm used for the Vlasov-Poisson system to the radiation transport problem. The radiative transfer equation is very interesting in astrophysics and nuclear physics. The first stars in the Universe drastically altered the chemistry of the cosmos with their ultraviolet radiation, a process called “reionization” that we would like to understand better. The radiative transfer equation above looks complicated, but has a rather straightforward physical meaning: radiation in a vacuum should propagate freely, while radiation passing through matter should be absorbed or scattered. The details of how this new method works are largely based on <a href="https://en.wikipedia.org/wiki/Ray_tracing_(physics)" target="_blank">ray-tracing methods</a>. Our improvement on ray tracing was to pass radiation through precisely calculated intersection volumes between grid cells and a beam of radiation. This gives a much more accurate calculation of the amount of radiation that should be absorbed or allowed to pass through the matter in a grid cell. There are many types of radiation that can be simulated using this method. Here, “radiation” refers the the ultraviolet photons (UV light) emitted by the first stars and galaxies. However, radiation transport is also used to track nuclear radiation (neutrons, protons, and gamma-ray photons) inside for example, supernovae and nuclear bombs.</p>
<figure role="group" class="caption caption-img">
<img alt="Graphical representation of a radiative transfer algorithm. (Credit: Devon Powell.)" data-entity-type="file" data-entity-uuid="b67c985e-fb32-442a-8021-ed002368e850" height="430" src="https://kipac.stanford.edu/sites/default/files/inline-images/RadTrans_0.JPG" width="576" />
<figcaption><em>A figure from an upcoming paper on radiation transport. The large triangular prism is a beam of radiation propagating out from the source (lower left). The radiation is passed through cubical grid cells containing matter that may absorb or scatter the radiation. Our use of a computational geometry algorithm to find the exact volume shared between the beam and the grid cells makes the radiation field smoother and less noisy. (Credit: Devon Powell.)</em></figcaption>
</figure>
<p> </p>
<p>We again found that by using the more <i>physically consistent discretization</i> given by the geometry of the problem, we were able to get very accurate results while using less memory than previous radiation transport methods. Below is a picture from a simulation that used ~200 data structures to describe the radiation field, rather than many thousands for the previous ray-tracing methods.</p>
<p> </p>
<figure role="group" class="caption caption-img">
<img alt="A test simulation using our new radiation transport method. (Credit: Devon Powell.)" data-entity-type="file" data-entity-uuid="479484d8-6e65-49fb-ba16-85b379a120a6" src="https://kipac.stanford.edu/sites/default/files/inline-images/TestSim_0.JPG" />
<figcaption><em>A test simulation using our new radiation transport method. A star in the lower-left corners shines ultraviolet light into the surrounding neutral hydrogen gas, blowing a “bubble” of ionized hydrogen. Left: The radiation intensity in the x-y plane. Middle: The ionized bubble in the same plane. Right: The fraction of gas that is ionized, as a function of distance from the source. These maps are thin slices through a<br />
3D simulation box.</em> <em>(Credit: Devon Powell.)</em></figcaption>
</figure>
<p> </p>
<p>Both of these projects improve upon the accuracy of simulations by making the numerical algorithms more consistent with the equations describing them. For the Vlasov-Poisson system, we create accurate density maps by finding the exact intersections between tetrahedral mass elements and cubical grid cells. For radiation transport, we pass light through matter by calculating the geometrically exact overlap between the grid cells and the radiation beam. These methods improve on N-body codes and ray-tracing codes, respectively, by more accurately sampling the simulation space using 3D solid geometry rather than point particles or 1D rays. This method is therefore more consistent with the original physical system we want to study. This consistency comes at the cost of computer operations, since the geometric calculations involved are relatively complex. However, supercomputers have increased in power by many orders of magnitude since the first ones were built. This is a result of more and faster processors as well as new options for accelerating code on graphics processing units (GPUs). More and more available computing power will enable more accurate but more complex calculations like the ones I described here to be run in reasonable amounts of time for large-scale simulations.</p>
<p><strong>We have come a loooong way, now.</strong></p>
<p>In our Manhattan Project anecdote, we noted that each human could perform one operation every few seconds. We measure the speed of a computer in FLoating point Operations Per Second, or “flops”. So, a human computer runs at less than a flop. Your laptop can do a few billion (few x 10^9) flops. The “fastest” supercomputers are pushing the petaflop to exaflop range (10^15 to 10^18), though supercomputers are really just a bunch of regular computers linked together in a cooperative network.</p>
<p> </p>
<figure role="group" class="caption caption-img">
<img alt="IBM's Blue Gene supercomputer. (Credit: Argonne National Laboratory.)" data-entity-type="file" data-entity-uuid="681fa2bc-a687-415c-9d67-ec27866db5dd" src="https://kipac.stanford.edu/sites/default/files/inline-images/640px-IBM_Blue_Gene_P_supercomputer_0.jpg" />
<figcaption><em>A supercomputer comprises many individual computers (nodes) networked together. In this image, 16 nodes (horizontal slabs) per tower can be seen on the mounting rack. Each node is comparable in power to a desktop computer, typically containing a handful of processing cores, several GB of memory, and possibly a graphics processing unit (GPU). The fastest supercomputers split a simulation between hundreds of thousands of nodes. (Credit: Argonne National Laboratory.)</em></figcaption>
</figure>
<p> </p>
<p>Compared to modern astrophysics calculations, Richard Feynman’s bomb yield was a relatively simple one. Simulation techniques have continued to develop rapidly since then. New algorithms have greatly increased our ability to run fully three-dimensional, multi-physics simulations with higher and higher resolution. This has given us a much better understanding of astrophysical processes, and will continue to do so as supercomputers become faster and faster.</p>
<p>Despite the huge increase in speed, supercomputers are fundamentally built to do the same thing as the Los Alamos team. They have memory in which to order and store results, they have processors on which to execute different mathematical operations, and they have network links that allow them to share results between processors. The difference is that modern scientists tell the computer what to do by writing software, rather than tediously coordinating the movement of colored cards by hand.</p>
<p>And we are very, very thankful for that!</p>
<p><strong>Glossary</strong></p>
<p><em>Algorithm</em>: A set of instructions given to the computer in order to execute a calculation. Algorithms can be simple or complex depending on the application.</p>
<p><em>Approximation</em>: A solution that is close, but not exactly equal to, the exact solution of an equation. Physics computations on a computer all solve for an approximation to the true solution, but better and faster computers can get ever closer to the true solution. <em>Consistent</em>: When deriving the discrete form of a physics equation, one must make sure that the derivation is correct with regard to the original equation, and will give an approximation close to the exact solution.</p>
<p><em>Convergence</em>: If we solve for an approximation to the discrete version of a non-linear PDE, then the approximation will be closer and closer to the true solution as we use more memory and processing power. This is true if the discrete equation is consistent with the original.</p>
<p><em>Discretize/discrete</em>: To break up the information describing a computer simulation (i.e. the density field) into a large but finite set of numbers. The modified physics equations used to solve this finite, approximate system are known as the discrete form of the equations.</p>
<p><em>Non-linear PDE</em>: Stands for “non-linear partial differential equation.” This is a special type of physics equations that describes how complicated systems change over time.</p>
<p><strong>References and further reading</strong></p>
<ul>
<li><a href="https://en.wikipedia.org/wiki/The_Pleasure_of_Finding_Things_Out" target="_blank">The Pleasure of Finding Things Out</a>, by Richard Feynman.</li>
<li><a href="https://en.wikipedia.org/wiki/Numerical_methods_for_ordinary_differential_equations" target="_blank">Numerical methods for ordinary differential equations</a></li>
<li><a href="https://en.wikipedia.org/wiki/Lax_equivalence_theorem" target="_blank">Lax equivalence theorem</a></li>
<li><a href="https://en.wikipedia.org/wiki/Numerical_stability#Stability_in_numerical_differential_equations" target="_blank">Stability in numerical differential equations</a></li>
<li><a href="https://web.stanford.edu/class/cme306/Discussion/Discussion1.pdf" target="_blank">Convergence, Consistency, and Stability</a> (technical PDF)</li>
<li><a href="http://www.mathematik.uni-dortmund.de/~kuzmin/cfdintro/lecture9.pdf" target="_blank">Properties of numerical methods</a> (technical PDF)</li>
</ul>
</div>
<span><span lang="" about="https://kipac.stanford.edu/user/221" typeof="schema:Person" property="schema:name" datatype="" content="lawhite@slac.stanford.edu" xml:lang="">lawhite@slac.s…</span></span>
<span>Mon, 11/27/2017 - 15:53</span>
<div class="field field--name-field-featured-image field--type-image field--label-hidden field__item"> <img src="https://kipac.stanford.edu/sites/default/files/highlights/RadTrans.JPG" width="611" height="456" alt="Graphical representation of a radiative transfer algorithm. (Credit: Devon Powell.)" title="Illustration of radiative transfer algorithm. (Credit: Devon Powell.)" typeof="foaf:Image" />
</div>
<div class="field field--name-field-related-research-areas field--type-entity-reference field--label-above">
<div class="field__label">Related Research Areas</div>
<div class="field__items">
<div class="field__item"><a href="https://kipac.stanford.edu/research/cosmic-structure" hreflang="und">Cosmic Structure</a></div>
<div class="field__item"><a href="https://kipac.stanford.edu/research/early-universe" hreflang="und">Early Universe</a></div>
</div>
</div>
<div class="field field--name-field-related-people field--type-entity-reference field--label-above">
<div class="field__label">Related People</div>
<div class="field__items">
<div class="field__item"><a href="https://kipac.stanford.edu/people/devon-powell" hreflang="und">Devon Powell</a></div>
</div>
</div>
<div class="field field--name-field-tags field--type-entity-reference field--label-above">
<div class="field__label">Tags</div>
<div class="field__items">
<div class="field__item"><a href="https://kipac.stanford.edu/taxonomy/term/1761" hreflang="en">computational astrophysics</a></div>
<div class="field__item"><a href="https://kipac.stanford.edu/taxonomy/term/1762" hreflang="en">computer simulations</a></div>
</div>
</div>
Mon, 27 Nov 2017 23:53:34 +0000lawhite@slac.stanford.edu3395 at https://kipac.stanford.edu