diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2025-09-15 08:06:46 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2025-09-15 08:07:41 -0600 |
| commit | b7e71424dfde2ad56c4d8baaa2350e64a0f085a7 (patch) | |
| tree | b77b6e7ccad50f913d7339c7f3e7494a09d8e02e /tutorials/module_3/1_numerical_differentiation.md | |
| parent | 17f90913cb9a16ff78ad672fe15a2bd4e7e1b5db (diff) | |
Added heuns method
Diffstat (limited to 'tutorials/module_3/1_numerical_differentiation.md')
| -rw-r--r-- | tutorials/module_3/1_numerical_differentiation.md | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tutorials/module_3/1_numerical_differentiation.md b/tutorials/module_3/1_numerical_differentiation.md index 0926851..441f838 100644 --- a/tutorials/module_3/1_numerical_differentiation.md +++ b/tutorials/module_3/1_numerical_differentiation.md @@ -45,7 +45,7 @@ plt.show() ### Backwards Difference -Uses the point at which we want to find and the previous point in the array. +Uses the point at which we want to find the derivative and the previous point in the array. $$ f'(x_i) = \frac{f(x_{i})-f(x_{i-1})}{x_i - x_{i-1}} $$ @@ -68,10 +68,28 @@ plt.show() Try plotting both forward and backwards ### Central Difference - $$ f'(x_i) = \frac{f(x_{i+1})-f(x_{i-1})}{x_{i+1}-x_{i-1}} $$ +### Problem 1 +Use the forward difference formula to approximate the derivative of $f(x)$ at $x = 1$ using step sizes: $h=0.5$ and $h=0.1$ for the following function. +$$ +f(x) = \ln(x^2 + 1) +$$ +Compare your results with the analytical solution at $x=1$. Comment on how the choice of $h$ affects the accuracy. +```python + +``` +### Problem 2 +Use the central difference formula to approximate the derivative of $f(x)$ at $x = 1.2$ using step sizes: $h=0.5$ and $h=0.1$ for the following function. +$$ +f(x) = e^{-x^2} +$$ +Compare your results with the analytical solution at $x=1.2$. Comment on how the choice of $h$ affects the accuracy. +```python + +``` + --- # Advanced Derivatives |
