Before we fully automate, we should add a couple simple variables. Add a variable called \(N\) to measure the number of steps our photon takes. Set it equal to \(0\) for now. Then add a vairable called \(D\) which measures the distance that our photon is from the center of the star. Set \(D\) equal to the square root of \(X^2 + Y^2\).
To make \(N\) update automatically, add a comma at the end of your expression for the action \(A\). After the comma, add
\[N \to N + 1\]Now when you click the arrow to the left of \(A\), the value of \(N\) should increase.
Now we can automate! Click the + button at the top of the left panel and add a ticker. You should see the ticker appear as a bar above the panel. This ticker will run an action every certain number of milliseconds (10 milliseconds by default). We want it to move the photon randomly until it reaches the edge of our star. We can do this by adding a conditional statement. Following the word Run in the ticker bar, type:
\[\{D<100:A\}\]This means that as long as \(D\) is less than \(100\) (the radius we specified for our star) it will keep running our action A. Drag the photon to the center of the star and click the ticker button (which looks like a metronome) to see our model run!
We are almost done with the model! We can add two more things to make it a little easier to use. First, let's add a Reset button. Add a new expression called R or R_eset. We want to set it equal to three actions, all of which help reset the model.
\[R_{eset} = N \to 0, X \to 0, Y \to 0\]Now whenever you click the arrow next to \(R_{eset}\) the photon moves back to the center of our star and the counter is reset.
Finally, click the wrench icon in the top right of the screen. Under the Grid section, change the graph to polar (circular) coordinates. Then uncheck the boxes next to X-axis and Y-axis. This should make your model a lot more readable.
Congrats!! You just created a fully functional physics simulation. Now we can use our model to build some intuition for how particles move through a star. Take a couple minutes to play around with your graph. And make sure to click the blue save button!
As you run your model, the photon takes a jittery path from the core of the star to its edge. Explain to your activity partner briefly in your own words why the photon takes this path instead of a straight one out of the star.
A photon moving out of the Sun with no resistance should escape the Sun in less than 5 seconds. Based on what you have seen by running your real physical model of a photon traveling through a star, estimate again how long you think it would take a photon making this "random walk" to escape? (Each of you should make your own estimate.)
It's worth noting two differences between your model and real life. First, we are assuming the radius of the star in our model is around 100mm. Of course that isn't a good estimate for the entire star, but it actually is a pretty good model of what is happening in a small sphere inside the star. If we assume the physics are the same for the rest of the star (which they mostly are!) our model does a pretty good job.
Second, it is worth noting that our model assumes the same step length each time the photon moves. In reality, this is an average step length. There is a lot of randomness inside of stars — sometimes the photon barely jumps and sometimes it jumps a lot! But our step length (often referred to scientifically as the "mean free path" which just means the average unobstructed path of the photon) is still a really good estimate of the photon's average step size!
We want to find how long it takes a real photon to escape the Sun. Let's assume your step length in your model is equal to 1 mm (which is pretty accurate for the Sun). Set the radius of your star to equal the Sun's radius in millimeters (\(R_{\odot} = 7*10^{11}~mm\)). Now run your model. What do you see happening? Is it possible to use this simulation to answer this question directly? Why or why not??
Hmm. Maybe we could find a relationship between the straight line distance the photon traveled (here the radius of our star) and the number of steps the photon takes to escape? Try a few different values (0.5, 1, 2, 3, and 5) for the average photon path length (the l
variable in your model) and observe how many steps it takes for the photon to escape. Run your model 3-5 times for each value of the path length and record the average number of steps (\(N\)) it takes the photon to escape the star for each path length.
The number of steps a photon takes is related to the ratio between step length and the radius of the star. What is the approximate relation between \(\dfrac{r}{l}\) and \(N\) (where l is the step length in our model)? Hint: The relation should take the form of a power law: \(N = (\dfrac{r}{l})^x\) where \(x\) is some positive integer. Use the data you collect to find \(x\). Try plotting your points and drawing a curve through them. It's ok if the curve doesn't hit every point that you measured — it should go through the average of them all. See if you can use the curve to find an integer value for \(x\). Also note that we made the radius \(r\) equal to 100 when building the model.
Now use your relation between \(\dfrac{r}{l}\) and \(N\) to calculate the number of total steps a photon needs to take to escape from the Sun. Note: You can create new cells to add any equations or expressions to help you answer this question. (For \(l\) use \(1~mm\) and for \(r\) use the radius of the Sun measured in millimeters from your equation sheet.)
Given the number of steps you estimated, now find how long it takes the photon to escape from the Sun. Does the answer surprise you? Why or why not?
The path length of a photon is affected by two physical properties of a star: the spacing of particles in the star (density) and the likelihood that each particle will interfere with the photon (not all particles interact with and redirect light in the same way). The chance that a particle will redirect (or scatter) a photon is called the "opacity". A high average opacity in a star means a high chance of light scattering off particles (which leads to a low step length) and a low opacity means a low chance of scattering (leading to a higher step length).
When either of these two factors increase (i.e. when the density or the opacity go up), the path length of the photon decreases. Thus we can reason that density and opacity are both inversely related to the path length.
This means we can write an equation for our \(l\) (which just represents our step length). If we call density \(d\) and opacity \(k\), we can change our value for \(l\) and implement the equation:
\[l = \dfrac{1}{dk}\]We can start by returning to our definition of \(l\) and changing it from a value of 1 to instead match the equation above. Now we can define d
and k
. In two new lines below, define both variables, setting them each equal to 1
:
d = 1
k = 1
Your model now includes density and opacity!
Try running your model a few times with different values of density and opacity. What do you notice about the movement of the particle when you make these changes? Use the plotting add ons to zoom in on the individual steps of the particle. Does a higher opacity lead to a shorter or longer escape time? What about a higher density? Do these conclusions make sense? Discuss with your activity partner.
Using your relation between path length and escape time that you found earlier, estimate by what factor the escape time would change if the density of the star was doubled? What about if the opacity was doubled? What if the radius was doubled?
Try sketching the relationships between the key physical properties here. Make three graphs, one with density on the x-axis, one with opacity on the x-axis, and one with radius on the x-axis. Put escape time on the y-axis for all three and then plot a handful of values until you have a general relation. Are the relations intuitive? Explain to your activity partner why your curves have the shapes they do.
Nice work!! You just made a complete model of the interior of a star. That's no small accomplishment. As a group, reflect on what you learned by filling out this Post-Activity Survey. Then head over to the main table for a final discussion.