Path: news.mathworks.com!not-for-mail
From: "leo nidas" <bleonidas25@yahoo.gr>
Newsgroups: comp.soft-sys.matlab
Subject: trapz, numerical integration
Date: Tue, 2 Jun 2009 22:27:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <h048vl$2v$1@fred.mathworks.com>
Reply-To: "leo nidas" <bleonidas25@yahoo.gr>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1243981622 95 172.30.248.35 (2 Jun 2009 22:27:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 2 Jun 2009 22:27:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1194208
Xref: news.mathworks.com comp.soft-sys.matlab:544349



Hi there,

I have a code in a for loop. At the end of each iteration a (matematical) function, let 
f(x), comes up which is always decreasing. x>0 and f(x)->0 as x->Inf, also f(x)>0. Actually it is going exponentially to zero.

My goal is to integrate numerically (using the trapz function) the function from 0 to Inf.
Obviously I cannot insert Inf into the trapz (at least I think so, because it will at least take forever :-)  ).

The thing is that I do not know a priori the exact form of the function to be integrated so as to insert a logical "large" number as an upper bound in the trapz. Till now I visualized some repetitions of the function that came up and the value 60 seemed more that large. But I want to be 100% sure that none of my functions gets away without proper integration.

Is there any trick or any other function that "detects" the logical point up to a function should be integrated, if one wants to integrate it till Inf?

Should I create a condition such as if f(x(i))<0.000001 then x(i) is my number? Or is there any better way?


Thanx in advance!!

P.S. Anallytical integration is not possible.