diff options
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 |
