Post Reply 
Adaptive Simpson and Romberg integration methods
03-26-2021, 06:35 PM
Post: #22
RE: Adaptive Simpson and Romberg integration methods
.
To:  robve and Albert Chan:

(03-26-2021 04:40 PM)robve Wrote:  I noticed that all of the integrals in his post have two distinguishing features: they have a U shape (or inverted) on both or either end that makes them suitable to apply a transform before numerical integration, i.e. change of variable or u-substitution. The trick to pull this off in an implementation is basically to have an initial check of a few points to find evidence of a U on either end and then transform


Seems to me we're talking different subject here.

On the one hand, I'm talking about good quadrature methods that are simply given the function to integrate, the limits of integration and the accuracy to achieve and upon being run the method returns the result meeting the specified accuracy as fast as possible. Period.

The user does nothing else other than supply the function, limits, and accuracy. He does not previously graph and analyze the function to see its shape, he does not study how to tame it if it needs taming, he does not do this or that transformation or another.

He just supplies the function, limits and accuracy and nothing else, The method is the one which does all the work and returns a reliable result, fast. That's in the spirit of what Mr. Kahan says in the HP Journal, I quote (my highlighting):
  • "[...] such a procedure must be a computer program - call it P - that accepts as data two numerical values x and y and a program that calculates f(u) for any given value u, and from that data P must estimate I=∫(x,y),f(u) du. The integration procedure P is not allowed to read and understand the f-program but merely to execute it finitely often, as often as P likes, with any arguments u that P chooses."

My quadrature procedure P does exactly that, with the results seen in the 7 examples I posted.

On the other hand, you're doing exactly the opposite: you're using some quadrature methods which can't deal with difficult integrands and improper integrals in general, and you are doing the "read and understand"-ing of the f(u) on behalf on the quadrature method, graphing the curve, inspecting it for spikes or singularities, etc., then applying some transformation decided by you (not the quadrature method) to spoon-feed it to it, such that it can cope and deliver some acceptable results in acceptable times. Then you go on and say that the method is "really, really good" !?

Seriously: Are you joking ? Seems to me you're in a state of delusion, trying everything under the sun to reach the conclusion you want to reach (that the method is "really, really good"), instead of just throwing the function and the limits and desired accuracy to the method and letting it do what it can on its own, and if it cannot deliver reasonably without extensive help from the user, then you must simply recognize the fact and that's all, the world doesn't end.

Had I provided that kind of help to my procedure for I1, it wouldn't need 512 evaluations, just 16 at most, but I didn't do it because I'm trying to test the method, not my mathematical ability to help it cope. Matter of fact, the very first integral, I1, can be proved to be equivalent to Sin(x)/x, which is orders of magnitude easier to integrate and has only a removable singularity at x = 0, but I didn't apply any transformations and instead let my procedure cope with it on its own, which it did.


To wit, if this conversation is to be of any use, it's essential that we stick to a common ground, namely: you posit whatever methods you want to discuss but you let the methods do the work on their own, supplying them just the original f(x), not some transformation of it, the limits and the accuray, to afterwards judge them on their results and their speed.

To begin with, try my 7 examples as-is (with no transformations or tricks whatsoever) using your preferred methods and post the results here so that we can discuss them and compare their respective performances.

Agreed ?

Regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
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 - Valentin Albillo - 03-26-2021 06:35 PM



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