Re: Use of EPSILON () Intrinsic Function
- From: monirg@xxxxxxxxxxxx
- Date: 15 Feb 2007 12:07:15 -0800
On Feb 15, 12:57 am, "Peter" <petersamsim...@xxxxxxxxxxx> wrote:
On Feb 14, 11:45 am, mon...@xxxxxxxxxxxx wrote:
On Feb 13, 11:00 am, "Peter" <petersamsim...@xxxxxxxxxxx> wrote:
On Feb 9, 7:49 pm, mon...@xxxxxxxxxxxx wrote:
<snip>
Hello;
1. Skip's example is a good one, though it is a bit above my head!
Skip, Ron, Bart's suggestion to examine the SPACING () function is
reasonable, yet the function is not available in my FORTRAN V5.0 !!
2. Let me explain what I'm trying to do, so that you may be able with
your collective knowledge and experience, guide me on the right
track. I'll try to simplify the problem without getting into too much
details.
3. I'm integrating a function FUNC1(X) from X=0.0 to X=infinity. The
function is oscillating unevenly about the X-axis, and approaching
zero at infinity.
4. Depending on the parameters (constants) combinations in the
function, the upper limit X=infinity could be replaced by, say, X=40.,
X=500., or whatever, depending on how fast the function is approaching
zero for a given parameters combination.
5. This upper limit must be specified to perform the integration. If
it is underestimated (say, X=50 instead of X=300), then the value of
integral would be wrong!! On the other hand, if the upper limit is
overestimated (say, X=400 instead of 60) then the round-off errors
(resulting from adding 1000s of extremely small values)would be
serious enough to ruin the computation!!
6. Since there're 1000s of parameters combinations for the function,
it would be extremely useful and very efficient to (some how) link
FUNC1(X) to EPSILON() or similar, to determine with confidence the
appropriate value of the upper limit to use for each parameter
combination.
In other words, the upper limit would then be the value of X where the
'absolute' value of the function is less than the floating point
(single) precision of the computer. Keep in mind that the function
FUNC1(X) has many zero crossings as it oscilates unevenly about the X-
axis and asymptotically approaches 0.0 at infinity.
Any suggestion(s)??
Thank you for your help.
Monir
Monir, since you have an oscillating integrand, if you can either
analytically or numerically determine the locations of (some of) the
zero crossings, you can separately integrate over each interval, then
sum these results to obtain an alternating series. There are many
convenient and efficient methods for accelerating the convergence of
alternating series. One of the simplest is the repeated averaging
method, a special case of Euler's method, as described in Section 3.2
of Dahlquist and Bjork, Numerical Methods, Prentiss-Hall, 1974. For
an example of its use, see Problem 1 inhttp://www.vcnet.com/~simonp/
solutions.pdf . This example includes the Matlab source code.
HTH,
Peter- Hide quoted text -
- Show quoted text -
Peter;
Could you please check the link you provided ??
Thank you.
Monir
Hi, Monir.
The link got line-wrapped and the final /solutions.pdf got cut off.
It should read
http://www.vcnet.com/~simonp/solutions.pdf
--Peter- Hide quoted text -
- Show quoted text -
Hi Peter;
Thank you for the updated link. It clearly demonstrates your
mathematical and programming skills.
Problem 1. is related to what I'm trying to do, but not quite!
Let me try to explain the problem in relatively simple terms.
1. I'm integrating an oscillating uneven function about the X-axis
from XL=0 to XU=infinity. It approaches 0.0 asymptotically at
infinity. The integral is not singular either at the end points or
anywhere between the limits. There does not appear to be a closed-
form solution to the integral!
2. Breaking the integral into two and using a change of variable X=1/Z
for the second integral does no good due to the pathological nature of
the function in the new range.
3. Assume for now that the integral can not be accurately evaluated
for the full range X=0 to X=infinity. Since the integrand approaches
0.0 at infinity, it would make sense to integrate the function up to X
where the abs value of the function is not much greater than the
floating-point (single) precision of the m/c (EPS=~3.E-8). The rounded-
up X-value where the function-value reaches, say, <2.E-8, would be a
good enough XU. Smaller values of EPS or larger value of XU would gain
us nothing, and infact may have an adverse side effects (accumulated
round-off errors, and slower computation).
Do you agree with me so far ??
Keep in mind that the function has many zero-crossings and has
numerically undetermined global maxima or global minima.
4. There're 10,000 of such function in the numerical/computer model,
each with a different set of parameters but with similar behaviour.
Thus, each function would have a different value of XU; depending on
how fast the function approaches zero. The question then becomes: How
would you (quickly & afficiently) determine the XU?? (assuming again
that the integration for 0.0<=X<=infinity can not be performed
accurately).
That's why I initially thought the use (some how) of the FORTRAN
EPSILON() intrinsic function would help in that regard. I've since
given up that thought, partly because no one in the group has taken it
up !!!!
Please review my post "Definite Integrals - Combination of
Trigonometric & Algebric Functions" under
sci-num-analysis group, for relevant additional details.
Your help would be greatly appreciated.
Monir
.
- Follow-Ups:
- Re: Use of EPSILON () Intrinsic Function
- From: Peter
- Re: Use of EPSILON () Intrinsic Function
- References:
- Use of EPSILON () Intrinsic Function
- From: monirg
- Re: Use of EPSILON () Intrinsic Function
- From: Ron Shepard
- Re: Use of EPSILON () Intrinsic Function
- From: Herman D . Knoble
- Re: Use of EPSILON () Intrinsic Function
- From: Ron Shepard
- Re: Use of EPSILON () Intrinsic Function
- From: Bart Vandewoestyne
- Re: Use of EPSILON () Intrinsic Function
- From: monirg
- Re: Use of EPSILON () Intrinsic Function
- From: monirg
- Re: Use of EPSILON () Intrinsic Function
- From: Peter
- Re: Use of EPSILON () Intrinsic Function
- From: monirg
- Re: Use of EPSILON () Intrinsic Function
- From: Peter
- Use of EPSILON () Intrinsic Function
- Prev by Date: installing g95
- Next by Date: Re: installing g95
- Previous by thread: Re: Use of EPSILON () Intrinsic Function
- Next by thread: Re: Use of EPSILON () Intrinsic Function
- Index(es):
Relevant Pages
|