Purpose:
Iteration is the primary tool for computational modeling in physics and engineering. I like theis definition:
Iteration is the repeated application of a function or process in which the output of each step is used as the input for the next iteration.
Because the iteration process works it's way through a process a little bit at a time we can adjust any parameter as we move from one moment to the next. It also simplifies some things because we assume that everything stays constant during each step in the iteration cycle. We adjust parameters at the end of the cycle before going on the the next cycle. Setting up iterations in Jupyter notebook involves using arrays and loops. As an example you could consider the RockDrop21.ipynb from the PH211 github.
As usual the notebooks for our PH213 class are hosted on my public github. The guidelines for downloading an individual file from a github can be found on the Jupyterlab Resource page linked on the course homepage.
At this point you are likely still working your way into your project. You may have been considering what sorts of data plots or simple models of your project you might implement. Iteration is a tool that would normally show up as you move to more complex physics models which may not happen for everyone. Because iteration is such a fundamental idea I am asking everyone to do this lab to have some modest experience with the ideas of iteration.
The particular python notebook you will be exploring this year is the DENumerical notebook on the PH213 github.
Procedure:
0) Download and explore thoroughly the DENumerical notebook from the github linked above. This will provide a guide and resource for the activities below.
1) In the notebook are three Learning Tasks indicated with RED HEADERS. In each case you are asked to make some changes to the code in specific places and consider the impact on various plots. Write your answers to the prompts in each Learning Task in your copy of the notebook. This assures that you have your answers to the questions embedded in your copy of the notebook for future use.
2) Learning Task: Loss of a (-) sign in phase shift: What is the inconsistency in the plot that is produced by this seemingly modest error. In your own words explain why C is not the initial position of the mass and the phase shift is NOT 0.
3) Learning Task: (-) sign error in the acceleration: Describe the appearance of the plot and what it suggests is happening to the 'damped' spring system. Describe what you see in the first 10 points in the data that is displayed that confirms the previous diagnosis. How is the data more believable after you restore the (-) sign?
4) Learning Task: Non-Linear Solution: For the non-linear plot as you first find it in the python notebook explain the differences between the linear and non-linear models and how the plot (cyan) does or doesn't make sense. After you change the initial x position to 0.1 m (from 1.0 m) describe how the plot changes. Does this strike you as reasonable? Do you have a possible explanation?
Deliverables:
1) Turn in the pdf of your modified DENumerical notebook that has your answers to the Learning Tasks embedded at the end of each relevant cell.