Article 71M7Y Weddle integration rule

Weddle integration rule

by
John
from John D. Cook on (#71M7Y)

I was reading about Shackleton's incredible expedition to Antarctica, and the Weddell Sea features prominently. That name sounded familiar, and I was trying to remember where I'd heard of Weddell in math. I figured out that it wasn't Weddell exactly but Weddle I was thinking of.

The Weddell Sea is named after James Weddell (1787-1834). Weddle's integration rule is named after Thomas Weddle (1817-1853).

I wrote about Weddle's integration rule a couple years ago. Weddle's rule, also known as Bode's rule, is as follows.

bodes_rule.svg

Let's try this on integrating sin(x) from 1 to 2.

If we divide the interval [1, 2] into 6 subintervals,h = 1/6. The 8th derivative of sin(x) is also sin(x), so it is bounded by 1. So we would expect the absolute value of the error to be bounded by

9 / (69 * 1400).

Let's see what happens in practice.

import numpy as npx = np.linspace(1, 2, 7)h = (2 - 1)/6weights = (h/140)*np.array([41, 216, 27, 272, 27, 216, 41])approx = np.dot(weights, np.sin(x))exact = np.cos(1) - np.cos(2)print("Error: ", abs(approx - exact) )print("Expected error: ", 9/(1400*6**9))

Here's the output:

Error: 6.321198009473505e-10Expected error: 6.379009079626363e-10
Related postsThe post Weddle integration rule first appeared on John D. Cook.
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments