Computational Physics Trapezoidal Rule - Group 1-6
Computational Physics Trapezoidal Rule - Group 1-6
GROUPS
BASIC INFORMATION
a) How it works
The Trapezoidal Rule is an integration rule that calculates the area under a curve. The
technique works by approximating the definite integral in numerical analysis by dividing
the curve into small slices. Adding all the areas of the divided slices will result in the area
of the curve. Increasing the number of slices within the trapezoid will increase its
accuracy to the real value. Approximating definite integrals is important as most
real-world equations are impossible to be solved by hand and as such approximation
techniques were needed for this specific problem like Trapezoidal Rule and Simpson’s
Rule.
b) Advantages
- More accurate integral approximation than Riemann sum.
- Can be used regardless of odd or even subintervals.
- Concept and derivation of the formula is easier than Simpson’s rule.
- More accurate than the Midpoint rule.
c) Disadvantages
- Less accurate than Simpson’s rule as it uses linear approximation instead of
quadratic approximation.
- If the function is concave up, then the integral is overestimated; if it is concave
down, then the integral is underestimated.
d) Steps
Applying the trapezoidal rule to find the area under the given curve, y = f(x).
- Step 1: Note the number of sub-intervals, "n" and intervals "a" and "b".
- Step 2: Calculate the sub-interval width using the formula.
- Step 3: Substitute the obtained values in the trapezoidal rule formula to find the
approximate area of the given curve,
FORMULA
Let f(x) be a continuous function on the interval [a, b]. Now divide the intervals [a, b] into n equal
subintervals with each of width,
𝑏−𝑎
∆𝑥 = 𝑛
, Such that a = x0 < x1 < x2 < x3 < … < xn = b, y = f(x)
EXAMPLE
import numpy as np
a = 0
b = np.pi
n = 11
h = (b -a) / (n - 1)
x = np.linspace(a, b, n)
f = np.sin(x)
SOMETHING INTERESTING
The Trapezoidal Rule is one rule from a family of formulas for numerical integration. This family
is called the Newton-Cotes formulas. They are said to be an extremely useful and
straightforward family of numerical integration techniques. They play an important role in
numerical integration problems by deriving the simple form of a given expression in integration.
Other rules from the family are Simpson’s first and second rules.
FUN FACTS
- Reportedly has been used since 50 BCE in Babylon to measure Jupiter’s velocity along
the Earth’s orbital plane around the sun.
- The rule is named after trapezoids, because when calculating the area, its total area is
divided into trapezoids instead of rectangles, that one difference is the reason why it’s
not called Riemann Sum rules.
- The trapezoidal rule can be used to create a simple and effective algorithm for solving
the game Tetris by estimating the fit of each potential block placement.
- The trapezoidal rule is widely used in engineering, physics, and other fields to
approximate definite integrals when analytical solutions are not available.
- We could use the trapezoidal rule to approximate rainfall, this tells how much rain would
be on land if it didn’t get soaked up by the ground. This could then be applied to
agriculture sectors or help out in case of flood disasters
REFERENCES
- Trapezoidal Rule - Formula | Trapezoidal Formula (cuemath.com)
- Whats' the difference between the Trapezoidal Rule and Simpon's Rule for
approximating integrals? What're the advantages/disadvantages of each method?... -
eNotes.com
- Ancient Babylonian astronomers calculated Jupiter’s position from the area under a
time-velocity graph | Science
- Trapezoidal Rule for Integration (Definition, Formula, and Examples) (byjus.com)
- Newton-Cotes Formulas -- from Wolfram MathWorld
- Trapezoidal Rule | MyCareerwise
- Trapezoidal Rule - Python Programming and Numerical Methods
- Trapezoidal Rule - Real World application