diff --git a/book/numerical_methods/2-derivative.ipynb b/book/numerical_methods/2-derivative.ipynb index b2ede310db4757283373a0154ba8838a7035db8f..d42e11212d5e992137617adc02447351274ce5d6 100644 --- a/book/numerical_methods/2-derivative.ipynb +++ b/book/numerical_methods/2-derivative.ipynb @@ -49,7 +49,7 @@ "\n", "\n", "\n", - "**What does the derivative represents?** A rate of change! In this case, how fast $f(x)$ changes with respect to $x$ (or in the direction of $x$). The derivative can also be with respect to time or another independent variable (e.g., $y,z,t,etc$). Look at the figure to the right. The first derivative evaluated at $x_0$ is illustrated as a simple slope. You can also see that the rate of change at $x_0$ is larger than at $x_1$. " + "**What does the derivative represents?** A rate of change! In this case, how fast $f(x)$ changes with respect to $x$ (or in the direction of $x$). The derivative can also be with respect to time or another independent variable (e.g., $y,z,t,etc$). Look at the figure above. The first derivative evaluated at $x_0$ is illustrated as a simple slope, as is the first derivative evaluated at $x_1$ . You can also see that the rate of change at $x_0$ is larger than at $x_1$. " ] }, { @@ -59,7 +59,7 @@ "## Numerical Freedom to compute derivatives\n", "\n", "\n", - "In the Figure above, the derivative approximation was illustrated arbitarly using two points: the one at which the derivate was evaluated and another point in front of it. However, there are more possibilities. Instead of using points at $x_{-1,0,1}$ a more general notation is used: $x_{i-1,i,i+1}$. The simplest ways to approximate the derivative evaluated at the pont $x_i$ use two points: \n", + "In the Figure above, the derivative approximation was illustrated arbitarly using two points: the one at which the derivate was evaluated and another point in front of it. However, there are more possibilities. Instead of using absolute points at $x_{-1,0,1}$ a more general notation is used: $x_{i-1,i,i+1}$. The simplest ways to approximate the derivative evaluated point $x_i$ is to use two points: \n", "\n", "$$\n", "\\text{forward: }\\hspace{3mm} \\frac{df}{dx}\\bigg\\rvert_{x_i}\\approx\\frac{f(x_{i+1})-f(x_{i})}{x_{i+1}-x_i} \\hspace{5mm} \\text{backward: } \\hspace{3mm} \\frac{df}{dx}\\bigg\\rvert_{x_i}\\approx\\frac{f(x_{i})-f(x_{i-1})}{x_{i}-x_{i-1}} \\hspace{5mm} \\text{central } \\hspace{3mm} \\frac{df}{dx}\\bigg\\rvert_{x_i}\\approx\\frac{f(x_{i+1})-f(x_{i-1})}{x_{i+1}-x_{i-1}}\n", diff --git a/book/numerical_methods/3-taylor-series-expansion.ipynb b/book/numerical_methods/3-taylor-series-expansion.ipynb index daf901f3f98ab79abb3114698814b02280db781c..490a4905cc8cf55aa3846aec326b9e377be6fa83 100644 --- a/book/numerical_methods/3-taylor-series-expansion.ipynb +++ b/book/numerical_methods/3-taylor-series-expansion.ipynb @@ -13,7 +13,7 @@ "source": [ "```{note}\n", "**Important things to retain from this block:**\n", - "* Understand how to compute Taylor series expansion of a given function around a given point and its limitations\n", + "* Understand how to compute Taylor series expansion (TSE) of a given function around a given point and its limitations\n", "* Understand how numerical derivatives are derived from TSE\n", "* Understand that the magnitude error depends on the expression used\n", "**Things you do not need to know:**\n", @@ -33,6 +33,7 @@ "This series is **exact** as long as we include infinite terms. We, however, are limited to a **truncated** expression: an **approximation** of the real function.\n", "\n", "Using only 3 terms and defining $\\Delta x=x-x_i$, the TSE can be rewritten as \n", + "\n", "$$f(x_i+\\Delta x) = f(x_i) + \\Delta x f'(x_i)+\\frac{\\Delta x^2}{2!}f''(x_i)+ \\frac{\\Delta x^3}{3!} f'''(x_i)+ \\mathcal{O}(\\Delta x)^4.$$\n", "\n", "Here $\\Delta x$ is the distance between the point we \"know\" and the desired point. $\\mathcal{O}(\\Delta x)^4$ means that we do not take into account the terms associated to $\\Delta x^4$ and therefore **that is the truncation error order**. From here we can also conclude that **the larger the step $\\Delta x$, the larger the error**!\n", @@ -101,7 +102,7 @@ "\n", "How good is this polynomial? How does the result varies on the number of terms used?\n", "\n", - " Press `rocket` -->`Live Code` to interact with the figure\n", + " Press `rocket` -->`Live Code` to interact with the figure. You should then click 'run all' in the cell below.\n", "\n", ":::" ] @@ -174,7 +175,7 @@ "Relevant conclusions:\n", "- The 1st order, which depends only on the first derivative evaluation, is a straight line. \n", "- The more terms used (larger order) the smaller the error.\n", - "- The farther from the starting point (e.g., in the plots $x_i=0$), the larger the error. " + "- The further from the starting point (e.g., in the plots $x_i=0$), the larger the error. " ] }, { @@ -218,7 +219,7 @@ "f'(x_i)=\\frac{f(x_i+\\Delta x)-f(x_i-\\Delta x)}{2\\Delta x}+ \\mathcal{O}(\\Delta x^2).\n", "$$\n", "\n", - "The second derivative terms cancel each other, therefore **the order error is the step size squared!** From here, it is obvious that the central difference is more accurate. You can notice it as well intuitively in the figure of the previous chapter. \n" + "The second derivative terms cancel each other out, therefore **the order error is the step size squared!** From here, it is obvious that the central difference is more accurate. You can notice it as well intuitively in the figure of the previous chapter. \n" ] }, { @@ -321,7 +322,7 @@ "source": [ "## TSE to define second derivatives\n", "\n", - "There are equations that require second derivatives. The diffusion equation is one of those used in every field of knowledge. The 1-D diffusion equation reads \n", + "There are equations that require second derivatives. One example is the diffusion equation. The 1-D diffusion equation reads: \n", "\n", "$$\n", "\\frac{\\partial f}{\\partial t}=v\\frac{\\partial^2 f}{\\partial x^2} \\text{ where } v \\text{ is the diffusion coefficient.}\n", @@ -329,7 +330,7 @@ "\n", "For the moment we will use TSE to find **only** a numerical expression of the second derivative $\\frac{\\partial^2 f}{\\partial x^2}$.\n", "\n", - "The procedure is simple but cumbersome. The general idea is to isolate the second derivative in the TSE without being a dependency on other derivatives. Below you can find more details about the algebraic manipulation (if you are curious) but you do not need to know it. Here is the result: \n", + "The procedure is simple but cumbersome. The general idea is to isolate the second derivative in the TSE without there being a dependency on other derivatives. Below you can find more details about the algebraic manipulation (if you are curious) but you do not need to know it. Here is the result: \n", "\n", "$$\n", "f''(x_i)=\\frac{f(x_i+2\\Delta x)-2f(x_i+\\Delta x)+f(x_i)}{\\Delta x^2}+ \\mathcal{O}(\\Delta x).\n", @@ -351,7 +352,7 @@ "f(x_i+2\\Delta x) = f(x_i) + 2\\Delta x f'(x_i)+\\frac{(2\\Delta x)^2}{2!}f''(x_i)+ \\mathcal{O}(\\Delta x)^3.\n", "$$\n", "\n", - "Now multiply by two the TSE for a point one step farher from $x_i$: \n", + "Now multiply the TSE by two for a point one step farher from $x_i$: \n", "\n", "$$\n", "2f(x_i+\\Delta x) = 2f(x_i) + 2\\Delta x f'(x_i)+\\frac{2\\Delta x^2}{2!}f''(x_i) + \\mathcal{O}(\\Delta x)^3.\n", diff --git a/book/numerical_methods/4-numerical-integration.ipynb b/book/numerical_methods/4-numerical-integration.ipynb index 5eb47e1ce38cf18f9922a4d43116f55004717ae6..c6f176dbe3d9f73478615a7ae3605483ead70a5e 100644 --- a/book/numerical_methods/4-numerical-integration.ipynb +++ b/book/numerical_methods/4-numerical-integration.ipynb @@ -14,8 +14,8 @@ "NOTE\n", "```{note}\n", "**Important things to retain from this block:**\n", - "* Knowing how to apply different discrete integration techniques\n", - "* Having an idea on how the truncation errors change from technique to technique \n", + "* Know how to apply different discrete integration techniques\n", + "* Have an idea on how the truncation errors change from technique to technique \n", "```" ] }, diff --git a/book/numerical_methods/taylor-series-exercise.ipynb b/book/numerical_methods/taylor-series-exercise.ipynb index cb67dca506da70d19988519116f525619b15bcc3..97888ab0641a12ab20ecd8c5bea33096bc72a57a 100644 --- a/book/numerical_methods/taylor-series-exercise.ipynb +++ b/book/numerical_methods/taylor-series-exercise.ipynb @@ -6,7 +6,7 @@ "source": [ "# Exercises on Taylor expansion\n", "\n", - "This page shows some exercises on calculation Taylor expansion. If you reload this page, you'll get new values.\n", + "This page shows some exercises on calculating Taylor expansions. If you reload this page, you'll get new values.\n", "\n", " Click `rocket` -->`Live Code` to start practising.\n" ] @@ -71,7 +71,7 @@ "\n", "## Exercise 1\n", "\n", - "Calculate the taylor series expension of:\n" + "Calculate the taylor series expansion of:\n" ] }, {