Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Integration

Subject: Integration

From: Anna Kaladze

Date: 10 Aug, 2010 15:46:04

Message: 1 of 6

Dear all,
I have a non-integrable function, f(u). The problem it is involved in an inner integral of a double integral, and the inner one has a variable limit of integration. Like this:
"Integral [(Integral of F(u), du)] dt"
The outer integral (where the integrand is [(Integral of F(u), du)]) has finite limits (1 and 2, and the variable of integration is t). 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). Can someone help me to deal with this issue? If the inner integral had constant limits, there would have been no problem even for a dummy like myself, but the inner one's upper limit is t. Thanks a lot.
Anna.

Subject: Integration

From: Roger Stafford

Date: 10 Aug, 2010 16:39:04

Message: 2 of 6

"Anna Kaladze" <anna.kaladze@gmail.com> wrote in message <i3rs7s$a7p$1@fred.mathworks.com>...
> Dear all,
> I have a non-integrable function, f(u). The problem it is involved in an inner integral of a double integral, and the inner one has a variable limit of integration. Like this:
> "Integral [(Integral of F(u), du)] dt"
> The outer integral (where the integrand is [(Integral of F(u), du)]) has finite limits (1 and 2, and the variable of integration is t). 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). Can someone help me to deal with this issue? If the inner integral had constant limits, there would have been no problem even for a dummy like myself, but the inner one's upper limit is t. Thanks a lot.
> Anna.
- - - - - - - - -
  Matlab's quad2d will accept variable limits on the inner integral.

Roger Stafford

Subject: Integration

From: Steven_Lord

Date: 10 Aug, 2010 17:20:59

Message: 3 of 6



"Anna Kaladze" <anna.kaladze@gmail.com> wrote in message
news:i3rs7s$a7p$1@fred.mathworks.com...
> Dear all,
> I have a non-integrable function, f(u). The problem it is involved in an
> inner integral of a double integral, and the inner one has a variable
> limit of integration. Like this:
> "Integral [(Integral of F(u), du)] dt"

Assuming that f(u) and F(u) are the same function, I think you're out of
luck here. You've said f(u) is non-integrable, yet you're trying to
integrate it as part of a double integral!

Or are f(u) and F(u) actually different functions that are related in some
way? If that's the case, SAY SO when you post your question, please.

--
Steve Lord
slord@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

Subject: Integration

From: Anna Kaladze

Date: 11 Aug, 2010 00:08:03

Message: 4 of 6

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.

Subject: Integration

From: Roger Stafford

Date: 11 Aug, 2010 02:01:07

Message: 5 of 6

"Anna Kaladze" <anna.kaladze@gmail.com> wrote in message <i3spl3$t1v$1@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.

  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.

Roger Stafford

Subject: Integration

From: Steven_Lord

Date: 11 Aug, 2010 13:59:34

Message: 6 of 6



"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in
message news:i3t093$mk5$1@fred.mathworks.com...
> "Anna Kaladze" <anna.kaladze@gmail.com> wrote in message
> <i3spl3$t1v$1@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@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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us