From 0c90b794fa3c11d5ca20722369080a52070ffaad Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Mon, 22 Sep 2025 00:44:12 -0600 Subject: Finished off system_of_equations and pde's --- tutorials/module_3/4_numerical_integration.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tutorials/module_3/4_numerical_integration.md') diff --git a/tutorials/module_3/4_numerical_integration.md b/tutorials/module_3/4_numerical_integration.md index 78b0328..06cb8b9 100644 --- a/tutorials/module_3/4_numerical_integration.md +++ b/tutorials/module_3/4_numerical_integration.md @@ -183,9 +183,6 @@ for n in n_list: ```python -#!/usr/bin/env python3 -# Gauss Quadrature using Gauss-Legendre method (manual 2-point & 3-point) - import numpy as np from scipy.integrate import quad # for reference "exact" integral @@ -244,6 +241,7 @@ print(f"Error (3-point): {err3:.2e}") ## Numerical Integration to Compute Work + ## Implementing the Composite Trapezoidal Rule **Objective:** Implement a Python function to approximate integrals using the trapezoidal rule. @@ -266,6 +264,7 @@ for n in [4, 8, 16, 32]: Students should compare results for increasing $n$ and observe how the error decreases with $O(h^2$). +--- ## Gaussian Quadrature Write 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. -- cgit v1.2.3