Due: December 7, 2018 @ 11:59pm
Obtain the GitHub repository
you will use to complete the homework assignment, which contains the
starter Jupyter notebook file homework7.ipynb
. The notebook template
provides space for you to answer each question. Your notebook should run
without error when you select Restart Kernel and Run All
Cells:
When you’re done, save your file, then stage, commit, and push (upload) it to GitHub, and then follow the instructions in the How to submit section.
For questions 1 and 2, use the code provided to you in the heat diffusion lecture notebook, https://github.com/jkglasbrenner/cds411-course-materials/blob/master/class_notes/heat_diffusion, as a starting point.
-
Starting with diffusion code provided to you, implement the other two kinds of boundary conditions described in the chapter, those being absorbing boundary conditions and periodic boundary conditions. The absorbing boundary condition should assume a constant value of on the boundary. Re-calculate the animation for all three boundary conditions and discuss the similarities and differences in the output.
When implementing the other boundary conditions, you should do this by extending one of the already existing functions in the simulation. Your changes should not remove the ability to use the other boundary conditions; instead your code should allow the user to select any of the three boundary conditions by changing one of the inputs to this function.
-
Instead of using the formula for diffusion in the section “Heat Diffusion,” employ the filter in Figure 10.2.13. Thus, to obtain the value at a site for time , we add 25% of the site’s temperature to the selected site at time , 12.5% to each of its north, east, south, and west neighbor cells at time , and 6.25% to each of the northeast, southeast, southwest, and northwest corner cells at time . This sum is called a weighted sum with each nutrition value carrying a particular weight as indicated. Revise the model using this configuration and then run both unweighted and weighted versions of the simulation, creating animations for each and then discussing the similarities and differences. For each simulation run, use reflecting boundary conditions.
Run simulations for three different cases:
-
Using the same input parameters provided in chapter 10.2 of the textbook.
-
Starting with the chapter 10.2 parameters, change the ambient temperature from to .
-
Starting with the chapter 10.2 parameters, change the temperature for the hot spots from to .
Close with a couple of remarks discussing how each change affected how diffusion propagates in the simulation (consider both the changes in input parameters as well as going from an unweighted sum to a weighted sum).
-
For question 3, use the code provided to you in the forest fire lecture notebook, https://github.com/jkglasbrenner/cds411-course-materials/blob/master/class_notes/forest_fire, as a starting point.
-
Revise the fire simulation so that a tree takes two time steps to burn completely instead of one step. After implementing the change, re-run the simulation using the default input parameters (see notebook) and generate an animation. Then, reduce
prob_tree
by at least 0.1 units and run the simulation a second time (this should be separate from the first). Create and watch the animation for this run.After running the simulations, discuss any differences you see between these two runs. Then, explain whether this change to the model make it more or less likely for the entire forest to burn down compared to the original implementation, all else being equal.
To lock in your submission time, export your notebook to PDF and upload the PDF file to the assignment posting on Blackboard.
In addition, be sure to save, commit, and push your final result so that everything is synchronized to GitHub. I may want to inspect your source files directly and run your notebook, so it’s very important that the files in your homework repository match what I see in the PDF export uploaded to Blackboard.