Monte Carlo Simulations

Most real world processes have some random components in them. That is why we have to investigate the statistical properties of such systems/processes. For example, we may be interested in computing the expected performance of a system or the expected distance in a random walk process, or the mean power of a received signal or the expected number of people in a waiting room (see the last example in Chapter 5). Many mathematical tools have been derived to compute such metrics, however in most cases the systems are too complex to derive any tractable results. In such scenarios, simulations with random sampling, also known as Monte Carlo simulations, can provide the desired analysis. This technique is based on the assumption that if we perform random sampling of a random variable sufficiently many times, we can derive the approximate statistical properties of it. On the other hand, we sometimes add the random component into a computation or algorithm deliberately when deterministic computation is very extensive or difficult. Monte Carlo simulations are also very useful in such cases.


History of the Monte Carlo
The first thoughts and attempts I made to practice [the Monte Carlo Method] were suggested by a question which occurred to me in 1946 as I was convalescing from an illness and playing solitaires.The question was what are the chances that a Canfield solitaire laid out with 52 cards will come out successfully?After spending a lot of time trying to estimate them by pure combinatorial calculations, I wondered whether a more practical method than "abstract thinking" might not be to lay it out say one hundred times and simply observe and count the number of successful plays.This was already possible to envisage with the beginning of the new era of fast computers, and I immediately thought of problems of neutron diffusion and other questions of mathematical physics, and more generally how to change processes described by certain differential equations into an equivalent form interpretable as a succession of random operations.
Later [in 1946], I described the idea to John von Neumann, and we began to plan actual calculations.
[Stanisław Ulam, co-inventer of the hydrogen bomb] "Stanisław Ulam is probably best known for realising that electronic computers made it practical to apply statistical methods to functions without known solutions, and as computers have developed, the Monte Carlo method has become a ubiquitous and standard approach to many problems."[Wikipedia on Stanislaw Ulam] 3 MCs often easier to implement than other methods and easier to get uncertainties from.Use them!

19-5 Mean Free Path
In considering the motion of molecules, a question often arises: If molecules move so fast (hundreds of meters per second), why does it take as long as a minute or so before you can smell perfume when someone opens a bottle across a room (only a few meters away)?To answer this question, we continue to examine the motion of molecules in an ideal gas. Figure 19-5 shows the path of a typical molecule as it moves through the gas, changing both speed and direction abruptly as it collides elastically with other molecules.Between collisions, our typical molecule moves in a straight line at constant speed.
Although the figure shows all the other molecules as stationary, they too are moving similarly.
One useful parameter to describe this random motion is the mean free path λ of the molecules.As its name implies, λ is the average distance traversed by a molecule between collisions.We expect λ to vary inversely with N/V, the number of molecules per unit volume (or "number density" of molecules).The larger N/V is, the more collisions there should be and the smaller the mean free path.We also expect λ to vary inversely with the size of the molecules, say, with their diameter d. (If the molecules were points, as we have assumed them to be, they would never collide and the mean free path would be infinite.)Thus, the larger the molecules are, the smaller the mean free path.We can even predict that λ should vary (inversely) as the square of the molecular diameter because the cross section of a molecule-not its diameter-determines its effective target area.

FIGURE 19-5
A molecule traveling through a gas, colliding with other gas molecules in its path.Although the other molecules are shown as stationary, we believe they are also moving in a similar fashion.

From Prof. Bill Lanford
Chapter 19 of textbook: The Kinetic Theory of Gases The expression for the mean free path does, in fact, turn out to be 2 1 (ideal gas mean free path).
(20-24) 2 / d N V To justify Eq. 19-24, we focus attention on a single molecule and assume-as Fig. 19-5 suggests-that our molecule is traveling with a constant speed v and that all the other molecules are at rest.Later, we shall relax this assumption.
We assume further that the molecules are spheres of diameter d.A collision will then take place if the centers of the molecules come within a distance d of each other, as in Fig. 19-6a.Another, more helpful way to look at the situation is to consider our single molecule to have a radius of d and all the other molecules to be points, as in Fig. 19-6b.This does not change our criterion for a collision.
As our single molecule zigzags through the gas, it sweeps out a short cylinder of cross-sectional area πd 2 between successive collisions.If we watch this molecule for a time interval Δt, it moves a distance vΔt, where v is its assumed speed.Thus, if we align all the short cylinders swept out in Δt, we form a composite cylinder (Fig. 19-7) of length vΔt and volume (πd 2 )(vΔt).The number of collisions that occur in time Δt is then equal to the number of (point) molecules that lie within this cylinder.Since N/V is the number of molecules per unit volume, the number of molecules in the cylinder is N/V times the volume of the cylinder, or (N/V)(πd 2 vΔt).This is also the number of collisions in time Δt.The mean free path is the length of the path (and of the cylinder) divided by this number: This equation is only approximate because it is based on the assumption that all the molecules except one are at rest.In fact, all the molecules are moving; when this is taken properly into account, Eq. 19-24 results.Note that it differs from the (approximate) Eq. 19-25 only by a factor of 1/ 2 .We can even get a glimpse of what is "approximate" about Eq. 19-25.The v in the numerator and that in the denominator are-strictly-not the same.The v in the numerator is v , the mean speed of the molecule relative to the container.The v in the denominator is rel v , the mean speed of our single molecule relative to the other molecules, which are moving.It is this latter average speed that determines the number of collisions.A detailed calculation, taking into account the actual speed distribution of the molecules, gives rel 2 v v and thus the factor 2 .
The mean free path of air molecules at sea level is about 0.1 μm.At an altitude of 100 km, the density of air has dropped to such an extent that the mean free path rises to about 16 cm.At 300 km, the mean free path is about 20 km.A problem faced by those who would study the physics and chemistry of the upper atmosphere in the laboratory is the unavailability of containers large enough to hold gas samples that simulate upper Can replace with > cross section, which is not literally geometric anymore, in most cases, in highenergy particle and nuclear physics REST fine assumption for us atmospheric conditions.Yet studies of the concentrations of freon, carbon dioxide, and ozone in the upper atmosphere are of vital public concern.
Recall the question that began this section: If molecules move so fast, why does it take as long as a minute or so before you can smell perfume when someone opens a bottle across a room?We now know part of the answer.In still air, each perfume molecule moves away from the bottle only very slowly because its repeated collisions with other molecules prevent it from moving directly across the room to you.

TOUCHSTONE EXAMPLE 19-3: Mean Free Path
(a) What is the mean free path λ for oxygen molecules at temperature T = 300 K and pressure P = 1.00 atm?Assume that the molecular diameter is d = 290 pm and the gas is ideal.SOLUTION The Key Idea here is that each oxygen molecule moves among other moving oxygen molecules in a zigzag path due to the resulting collisions.Thus, we use Eq.19-24 for the mean free path, for which we need the number of molecules per unit volume, N/V.Because we assume the gas is ideal, we can use the ideal gas law of Eq. 19-1 (PV = Nk B T) to write N/V = P/k B T. Substituting this into Eq.19-24, we find  Between collisions, the molecule travels, on average, the mean free path λ at average speed v .Thus, the average time between collisions is

vt v
This tells us that, on average, any given oxygen molecule has less than a nanosecond between collisions.
To find the frequency f of the collisions, we use this Key Idea: The average rate or frequency at which the collisions occur is the inverse of the average time t between collisions.Thus,

19-6 The Distribution of Molecular Speeds
What is Cross Section?Step-by-Step Instructions • Usual headers (will also need <random>) and namespace • You'll need uniform real (double) random num gens o One from 0 to 1 and one from -1 to 1 ideally (latter for cos of theta, as explained) • Loop within loop: while for interactions within a for loop of the #of neutrons.(Unless debugging, don't cout or cerr!) o Initialize to random direction in 3D but position at origin (0,0,0).Energy = 17e6 eV o The while loop continues until the neutron is captured, leaves, or goes too low in E o Don't allow 0 or negative energy of course, and use for loop for multiple neutrons

FIGURE 19
FIGURE 19-6 (a) A collision occurs when the centers of two molecules come within a distance d of each other, d being the molecular diameter.(b) An equivalent but more convenient representation is to think of

FIGURE 19 - 7
FIGURE 19-7 In time Δt the moving molecule effectively sweeps out a cylinder of length v Δt and radius d.
Assume the average speed of the oxygen molecules is 450 m/s v .What is the average time interval Δt between successive collisions for any given molecule?At what rate does the molecule collide; that is, what is the frequency f of its collisions?SOLUTION To find the time interval Δt between collisions, we use this Key Idea: This tells us that, on average, any given oxygen molecule makes about 4 billion collisions per second.

••FINAL•
https://www.symmetrymagazine.org/article/speakphysics-what-is-a-cross-section• Not to be confused with standard deviation or error!8 N or eta or https://www.albany.edu/physics/news/2024ualbany-physicists-find-preliminary-evidencesubcritical-chain-reaction-For the current assignment: Java-based Plot Digitizer for Windows, Apple Mac, and Linux \ Unix (at least some flavors) at http://plotdigitizer.sourceforge.net/o If for any reason this fails to work for your machine, Googling "digitizing plots" as an exact phrase should provide alt programs.(Beware of logs!) • Often much easier, and much faster, than asking the original authors to provide you the raw data J Homework #3: A Simple MC Simulation due Thur.Feb 15 • Create a MC sim for my Lithium Fluoride nuclear fission reactor idea (100% Li-7) o You only have to do 1 initial starting energy E, of 17 MeV • Assume mass density of 2.639 g/cm^3 and molar mass of 26 g/mol (Li-7 + F-19) o Use the standard method for converting a mass density into a number density by means of Avogadro's number • Keep units of cm, cm^2, cm^3, cm^-3 everywhere for simplicity until final result o And energy in eV everywhere (thus, convert 17 above) • Assume the cross section is only one of two options: capture or scatter (sum the elastic and inelastic curves from slides) o 4 options: capture or scatter on Li-7, or one of those on F 12 Kinetic (and potential) energy will be deposited by an energetic traveling particle in the lithium fluoride solid o Kinetic = elastic, potential = inelastic.Real life has rich mixture of both • Simulate MFP mean free path as a "live" function of neutron kinetic energy.For simplicity, assume the energy goes as x0.5 with each collision (of any type) o So, if your energy variable is called E then E /= 2.0 is an acceptable code line o The energy depends on the target masses and angle in real life, and E levels • Also, assume new random angles in three dimensions o Randomize phi between 0 and 2pi (RADIANS) but COSINE of theta from -1 to 1.The cosine very critical there, otherwise you don't have direction uniformity.http://corysimon.github.io/articles/uniformdistn-on-sphere/o You may mix Cartesian &spherical coordinates in the code • Next: coding instructions in English haha, not in C++.To get good results (ignoring fission, secondary particles) o In real-life research, you very often do not know what the "correct" answer is.
But this is only MEAN.Choose a random free path length based on exp ran num o Otherwise, you wouldn't actually be randomizing enough, getting lot of sameness • Update variables within your primary, type 'while' loop o New position based on previous direction; new energy; new random direction • After while loop ends, and after for loop ends, write out to screen or file the total FRACTION of neutrons within radius Keep your code almost exactly the same, except include the contribution of Li-6 within natural Lithium, instead of simulating enriched Lithium (enriched in Lithium-7).Use 6's natural % Impress me with new plot • In your report, explain why Lithium-7 enrichment is a good idea for nuclear reactors based on 7's fission • Set MFP (mean free path) with sigma(E), i.e. cross-section o o What radius?Infinite, or go in half-log steps (1, 2, 5, 10, 20, 50, 100, 200, 500cm) 15 Bonus • 16 STILL only 17 MeV, not any other different E. Continue to ignore fission byproducts Trying is not enough for extra credit, as usual.You MUST succeed.17Notjust "modern," but CONTEMPORARY Physics.Not usually covered anywhere