0% found this document useful (0 votes)
162 views4 pages

Computational Physics Trapezoidal Rule - Group 1-6

The Trapezoidal Rule is a numerical analysis technique for approximating the definite integral of a function by dividing the area under the curve into trapezoids. It is more accurate than the Riemann sum and can be used for both even and odd intervals. While less accurate than Simpson's Rule, it has an easier formula and is still effective for real-world applications like estimating rainfall or tetris block placement.

Uploaded by

Pewter -tan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views4 pages

Computational Physics Trapezoidal Rule - Group 1-6

The Trapezoidal Rule is a numerical analysis technique for approximating the definite integral of a function by dividing the area under the curve into trapezoids. It is more accurate than the Riemann sum and can be used for both even and odd intervals. While less accurate than Simpson's Rule, it has an easier formula and is still effective for real-world applications like estimating rainfall or tetris block placement.

Uploaded by

Pewter -tan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Trapezoidal Rule

GROUPS

1 Philipus Adriel Tandra, Peter Nelson Subrata


2 Rendy Gunawan, Dafa Ramadhan Syaidina
3 Kenneth Samuel Djasmin, Vincent Yono
4 Kimberly Mazel, Alysha Maulidina
5 Chellshe Love, Rachel Anastasia Wijaya
6 Christopher Owen, Justin Theofilus

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)

trapezoidal = (h/2)*(f[0] + 2 * sum(f[1:n-1]) + f[n-1])


print(trapezoidal)
π
Here is an example of the trapezoidal rule for the equation:∫ 𝑠𝑖𝑛(𝑥)𝑑𝑥
0
The output of the code above would result in 1.9835235375094546 which is very close to the
exact answer of 2. While an approximation, it gets very close to the exact answer to the
question which showcases its potential for its real-world application.

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

You might also like