Post Reply 
Adaptive Simpson and Romberg integration methods
03-25-2021, 10:13 PM (This post was last modified: 03-25-2021 10:17 PM by robve.)
Post: #13
RE: Adaptive Simpson and Romberg integration methods
(03-25-2021 08:43 PM)Albert Chan Wrote:  As you had mentioned, with bisecting intervals, you cannot reuse previous points.
As a compromise, I reuse the sum for generating next trapezoids.

m = f1 + f3 + f5 + ... + fn-1

Each point have weight of 2h, thus m*h only get half the midpoint area, using n/2 points.
Again, m was produced only because it was free, a by-products of getting next t.

---

Instead of theory, try ∫(f(x), x=0 .. 1), mid-point rule, from 1 to 3 intervals.

m1 = f(1/2)
m3 = (f(1/6) + f(1/2) + f(5/6)) / 3

Note that previous point, f(1/2), is reused.

It looks like (in the code?) you're aligning the midpoints to derive a closed formula to compare trapezoidal to midpoint and reuse points, right? I got that. It makes sense to do this to compare the errors of the trapezoidal versus midpoint results.

I expect the Romberg open interval method to converge slower, not only in practice, but also in theory, as we know by the error behaviors: at each midpoint step the error decreases by 1/9th it size (while evaluating three times as many points), whereas at each trapezoidal step the error decreases by 1/4th its size (while evaluating two times as many points).

What I was trying to say is that the extended midpoint points of the open interval are not aligned to the extended trapezoidal points of the closed interval. So that everyone understands to avoid confusion. We can also illustrate this by running the code. The first 9 points for each method on a=0 to b=1 are:

- Closed (extended trapezoidal): x=0 x=1 x=0.5 x=0.25 x=0.75 x=0.125 x=0.375 x=0.625 x=0.875

- Open (extended midpoint): x=0.5 x=0.166667 x=0.833333 x=0.0555556 x=0.277778 x=0.388889 x=0.611111 x=0.722222 x=0.944444

The same number of points, not aligned except the first and only one x=0.5.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Adaptive Simpson and Romberg integration methods - robve - 03-25-2021 10:13 PM



User(s) browsing this thread: 1 Guest(s)