summaryrefslogtreecommitdiff
path: root/tutorials/module_3/4_numerical_integration.md
diff options
context:
space:
mode:
Diffstat (limited to 'tutorials/module_3/4_numerical_integration.md')
-rw-r--r--tutorials/module_3/4_numerical_integration.md61
1 files changed, 32 insertions, 29 deletions
diff --git a/tutorials/module_3/4_numerical_integration.md b/tutorials/module_3/4_numerical_integration.md
index c486825..4c7876c 100644
--- a/tutorials/module_3/4_numerical_integration.md
+++ b/tutorials/module_3/4_numerical_integration.md
@@ -1,15 +1,11 @@
## Midpoint Method
-
## Trapezoidal Method
-
## Romberg Integration
-
## Gaussian Integration
-
## Simpson's Rule
### Simpsons 1/3
@@ -21,9 +17,7 @@
# Numerical Integration
## Why Numerical?
-Integration is one of the fundamental tools in engineering analysis. Mechanical engineers frequently encounter integrals when computing work from force–displacement data, determining heat transfer from a time-dependent signal, or calculating lift and drag forces from pressure distributions over an airfoil. While some integrals can be evaluated analytically, most practical problems involve functions that are either too complex or are available only as experimental data. As engineering we choose numerical integration—also known as quadrature—provides a systematic approach to approximate the integral of a function over a finite interval.
-
-In this tutorial, we will study several standard methods of numerical integration, compare their accuracy, and implement them in Python. By the end, you will understand not only how to apply each method, but also when one method may be more suitable than another.
+Integration is one of the fundamental tools in engineering analysis. Mechanical engineers frequently encounter integrals when computing work from force–displacement data, determining heat transfer from a time-dependent signal, or calculating lift and drag forces from pressure distributions over an airfoil. While some integrals can be evaluated analytically, most practical problems involve functions that are either too complex or are available only as experimental data. In engineering, numerical integration provides a systematic approach to approximate the integral of a function over a finite interval.
---
@@ -39,8 +33,8 @@ $$
Here, $x_i$ are the chosen evaluation points and $w_i$ are their associated weights.
### Midpoint Rule
-The midpoint rule divides the interval into $n$ subintervals of equal width $h = (b-a)/n$ and
-evaluates the function at the midpoint of each subinterval:
+The midpoint rule divides the interval into $n$ sub-intervals of equal width $h = (b-a)/n$ and
+evaluates the function at the midpoint of each sub-interval:
$$
I \approx \sum_{i=0}^{n-1} h \, f\!\left(x_i + \tfrac{h}{2}\right).
$$
@@ -57,7 +51,7 @@ its accuracy is of order $O(h^2)$.
Simpson’s rules use polynomial interpolation to achieve higher accuracy.
- **Simpson’s 1/3 Rule (order $O(h^4)$)**
- Requires an even number of subintervals $n$:
+ Requires an even number of sub-intervals $n$:
$$
I \approx \frac{h}{3}\Big[f(x_0) + 4\sum_{\text{odd } i} f(x_i) +
2\sum_{\text{even } i<n} f(x_i) + f(x_n)\Big].
@@ -79,7 +73,31 @@ polynomials) to maximize accuracy. With $n$ evaluation points, Gaussian quadratu
---
-## Exercise — Implementing the Composite Trapezoidal Rule
+## Taking this further
+
+- **Romberg Integration:** Demonstrates how extrapolation accelerates convergence of trapezoidal approximations.
+- **Gaussian Quadrature:** Introduces optimal integration points and highlights efficiency for
+polynomial and smooth functions.
+- **Simpson’s Rules:** Show how higher-order polynomial interpolation improves accuracy.
+
+These methods will be implemented and compared in subsequent assignments to build a deeper understanding of numerical integration accuracy and efficiency.
+
+---
+
+
+## More integral
+
+### Newton-Cotes Algorithms for Equations
+### Adaptive Quadrature
+
+
+
+
+# Problems
+
+## Numerical Integration to Compute Work
+
+## Implementing the Composite Trapezoidal Rule
**Objective:** Implement a Python function to approximate integrals using the trapezoidal rule.
@@ -101,28 +119,13 @@ for n in [4, 8, 16, 32]:
Students should compare results for increasing $n$ and observe how the error decreases with $O(h^2$).
----
-
-## Taking this further
-
-- **Romberg Integration:** Demonstrates how extrapolation accelerates convergence of trapezoidal approximations.
-- **Gaussian Quadrature:** Introduces optimal integration points and highlights efficiency for
-polynomial and smooth functions.
-- **Simpson’s Rules:** Show how higher-order polynomial interpolation improves accuracy.
-
-These methods will be implemented and compared in subsequent assignments to build a deeper understanding of numerical integration accuracy and efficiency.
-
----
-
-## Assignment 1 — Gaussian Quadrature
+## Gaussian Quadrature
-Implement a Python function for two-point and three-point Gauss–Legendre quadrature over an
-arbitrary interval $[a,b]$. Verify exactness for polynomials up to the appropriate degree and
-compare performance against the trapezoidal rule on oscillatory test functions.
+Implement a Python function for two-point and three-point Gauss–Legendre quadrature over an arbitrary interval $[a,b]$. Verify exactness for polynomials up to the appropriate degree and compare performance against the trapezoidal rule on oscillatory test functions.
---
-## Assignment 2 — Simpson’s 1/3 Rule
+## Simpson’s 1/3 Rule
Implement the composite Simpson’s 1/3 rule. Test its accuracy on smooth functions and compare its performance to the trapezoidal rule and Gaussian quadrature. Document error trends and discuss cases where Simpson’s method is preferable.