From: Steven_Lord on


"Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in
message news:i3t093$mk5$1(a)fred.mathworks.com...
> "Anna Kaladze" <anna.kaladze(a)gmail.com> wrote in message
> <i3spl3$t1v$1(a)fred.mathworks.com>...
>> Yes, thanks a lot for the answer and sorry, F(u) and f(u) are the SAME
>> functions -- just a typo. Is there any code I can to write to solve the
>> problem? I mean technically it is possible to solve the problem in Excel
>> (one column for the inner integral where t argument will take the value
>> from 0 to whatever), and then sum-up the values in that column using the
>> trapezoidal rule. A smaller step size would give a reasoanble degree of
>> approximation). But is there a way to do something like that in MATLAB?
>> Thanks a lot.
> - - - - - - - - - - - -
> It's the statement "I have a non-integrable function, f(u)" that you made
> in the first post that is the stumbling block here. In mathematics and in
> matlab circles too, when you say a function is non-integrable, it is
> because that function is sufficiently ill-behaved over the desired
> integration range that it is impossible to obtain an integral for it.
> Perhaps it ascends to infinity in the wrong way, the range is infinite and
> it doesn't get small fast enough, or it is seriously discontinuous. An
> example is the integral of 1/x^2*sin(1/x) from 0 to 2/pi which is not
> well-behaved as it approaches x = 0. The integrated value keeps
> oscillating endlessly back and forth more and more rapidly from -1 to +1
> as the lower limit approaches zero and consequently is non-integrable over
> that full range.

Now that I think about it a little more, there may still be hope, if the OP
meant "I have a function that I can't symbolically integrate" when they said
"non-integrable function f(u)". For example, if f(u) was exp(-u^2) and the
OP didn't know about the error function ERF, it would appear this has no
symbolic integral but it is possible to numerically evaluate the integral.

> I am guessing since you are still talking about trying to get your
> function's integral that this isn't what you meant by "non-integrable".
> If so, you should take the advice you were given more seriously. The
> double quadrature routine 'quad2d' allows for varying limits of
> integration in its inner integral, which is what it sounds like you are
> faced with when you say, "The inner integral (where integrand is F(u)) has
> a low limit 0, but the upper limit is t (in principle, t takes the value
> from 0 to 1)." I suggest you look into it.

I second Roger's suggestion.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com