Skip to content

Commit

Permalink
[L1-2] Add sentence about zip, ...
Browse files Browse the repository at this point in the history
* Add link to previous notebook at the beginning of the lesson.
* Remove sentence about `enumerate` as it is not used anymore.
* Re-write challenge paragraph as the nested `for` loop is for
the computation of the solution, not the computation of the error.
  • Loading branch information
mesnardo committed Aug 22, 2018
1 parent 9ce4137 commit cb23618
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lessons/01_phugoid/01_02_Phugoid_Oscillation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"source": [
"Welcome back! This is the second Jupyter Notebook of the series _\"The phugoid model of glider flight\"_, the first learning module of the course [**\"Practical Numerical Methods with Python.\"**](https://openedx.seas.gwu.edu/courses/course-v1:MAE+MAE6286+2017/info)\n",
"\n",
"In the first notebook, _\"Phugoid Motion\"_, we described the physics of an aircraft's oscillatory trajectory, seen as an exchange of kinetic and potential energy. This analysis goes back to Frederick Lanchester, who published his book _\"Aerodonetics\"_ on aircraft stability in 1909. We concluded that first exposure to our problem of interest by plotting the flight paths predicted by Lanchester's analysis, known as _phugoids_.\n",
"In the [first notebook](https://nbviewer.jupyter.org/github/numerical-mooc/numerical-mooc/blob/master/lessons/01_phugoid/01_01_Phugoid_Theory.ipynb), _\"Phugoid Motion\"_, we described the physics of an aircraft's oscillatory trajectory, seen as an exchange of kinetic and potential energy. This analysis goes back to Frederick Lanchester, who published his book _\"Aerodonetics\"_ on aircraft stability in 1909. We concluded that first exposure to our problem of interest by plotting the flight paths predicted by Lanchester's analysis, known as _phugoids_.\n",
"\n",
"Here, we will look at the situation when an aircraft is initially moving on the straight-line phugoid (obtained with the parameters $C=2/3$, $\\cos\\theta=1$, and $z=z_t$ in the previous analysis), and experiences a small upset, a wind gust that slightly perturbs its path. It will then enter into a gentle oscillation around the previous straight-line path: a _phugoid oscillation_.\n",
"\n",
Expand Down Expand Up @@ -499,11 +499,7 @@
"source": [
"Now we can plot our exact solution! Even better, we can plot _both_ the numerical solution *and* the exact solution to see how well Euler's method approximated the phugoid oscillations.\n",
"\n",
"To add another curve to a plot, simply type a second `pyplot.plot()` statement. We also add a legend using\n",
"\n",
"```Python\n",
"pyplot.legend()\n",
"```"
"To add another curve to a plot, simply type a second `pyplot.plot()` statement. We also add a legend using `pyplot.legend()`."
]
},
{
Expand Down Expand Up @@ -570,9 +566,7 @@
"E = \\int \\vert z-z_\\rm{exact}\\vert dt\n",
"$$\n",
"\n",
"We check for convergence by calculating the numerical solution using progressively smaller values of `dt`. We already have most of the code that we need. We just need to add an extra loop and an array of different $\\Delta t$ values to iterate through.\n",
"\n",
"You should read the documentation for the function [enumerate](https://docs.python.org/3/library/functions.html#enumerate) and make sure you understand how we're using it below."
"We check for convergence by calculating the numerical solution using progressively smaller values of `dt`. We already have most of the code that we need. We just need to add an extra loop and an array of different $\\Delta t$ values to iterate through."
]
},
{
Expand Down Expand Up @@ -698,7 +692,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now, we iterate through each $\\Delta t$ value and calculate the corresponding error."
"Now, we iterate through each $\\Delta t$ value and calculate the corresponding error.\n",
"In the following code cell, we use the built-in function [`zip`](https://docs.python.org/3/library/functions.html#zip) to create an iterator that aggregates elements from `z_values` and `dt_values`."
]
},
{
Expand Down Expand Up @@ -773,9 +768,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"We calculated the error for several different time step sizes using two nested `for` loops. That worked, but whenever possible, we like to re-use code (and not just copy and paste it!). \n",
"We calculated the solution for several different time-step sizes using two nested `for` loops.\n",
"That worked, but whenever possible, we like to re-use code (and not just copy and paste it!).\n",
"\n",
"Create a function that implements Euler's method and re-write the error analysis cell to use your function."
"Create a function that implements Euler's method and re-write the code cell that computes the solution for different time-step sizes using your function."
]
},
{
Expand Down

0 comments on commit cb23618

Please sign in to comment.