Definite integral with huge variations in magnitude
- From: axlq@xxxxxxxxxxx (axlq)
- Date: Wed, 9 Aug 2006 01:10:58 +0000 (UTC)
What numerical integration technique would be best for a definite
integral, evaluated over a finite interval.
* Definite integral over a finite interval, z = z1 to z2.
* The integrand is continuous over the interval, as are its
derivatives.
* The integrand is well-behaved in magnitude over MOST of the
interval.
* Over a TINY part of the interval, it makes some oscillations
many orders of magnitude above the values along the rest of the
interval. For example, over 99% of the interval the integrand
varies smoothly with values between +/- 10e5. In a tiny piece of
the interval it makes a sudden oscillation between +/- 10e11.
The integrand is below. It appears to have no analytical solution,
so I have to solve it numerically. (Believe it or not, I have to
implement this in an Excel Visual Basic macro).
integrand = (d2*Cos[k*R] - d1*Sin[k*R]) dz
where
d1 = k*R * (3*a^2 - 2*R^2)
d2 = 2*R^2 + a^2 * (k^2 * R^2 - 3)
R = Sqrt[a^2 + (q-z)^2]
k = 400 * Pi / 3
a = 3.75E-6
q = 0.0000875
interval: z1 = -0.0025, z2 = 0.0025
The wild oscillations occur between 0.00086 and 0.00089. I have
confirmed that the function IS continuous here although at first
glance it looks like a blow-up to infinite values.
Any suggestions on a good algorithm I should look for to solve this
efficiently? Romberg takes about a second on my machine, but as
I said, I can't trust it (the error term is huge). I tried the
adaptive algorithm at http://www.netlib.org/textbook/mathews/chap7.f
(which was easy to translate into Visual Basic) and it converges
with an error < 1E-6 but it's giving me a different result than
Mathcad gives.
-A
.
- Follow-Ups:
- Re: Definite integral with huge variations in magnitude
- From: Robert Israel
- Re: Definite integral with huge variations in magnitude
- From: carlos
- Re: Definite integral with huge variations in magnitude
- Prev by Date: Integration from known partial derivatives in a box
- Next by Date: Re: Definite integral with huge variations in magnitude
- Previous by thread: Integration from known partial derivatives in a box
- Next by thread: Re: Definite integral with huge variations in magnitude
- Index(es):