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:
double infinite integral

Subject: double infinite integral

From: ati

Date: 27 Mar, 2010 17:55:09

Message: 1 of 5

Hi,
I'd like to evaluate double improper intagral, like:
>>F=@(t,x)exp(-x.*t)./t.^3;

>>dblquad(F,1,inf,0,inf));
results: Warning: Infinite or Not-a-Number function value encountered. ans= NaN

and
>> int(int(F,t,1,inf),x,0,inf);
results: ??? Undefined function or variable 't'.

Help is much appreciated.

Subject: double infinite integral

From: Roger Stafford

Date: 27 Mar, 2010 20:10:24

Message: 2 of 5

"ati " <nati02@t-online.hu> wrote in message <holgpt$3fk$1@fred.mathworks.com>...
> Hi,
> I'd like to evaluate double improper intagral, like:
> >>F=@(t,x)exp(-x.*t)./t.^3;
>
> >>dblquad(F,1,inf,0,inf));
> results: Warning: Infinite or Not-a-Number function value encountered. ans= NaN
>
> and
> >> int(int(F,t,1,inf),x,0,inf);
> results: ??? Undefined function or variable 't'.
>
> Help is much appreciated.

  You can try a change of variables that makes both limits finite to see if that helps. For example, try u = 1/t and y = 1/(x+1). That brings both u and y into the finite range from 0 to 1, which would avoid that first warning you received.

  Unfortunately the transformed integrand becomes

 u/y^2*exp((y-1)/(u*y))

and you might receive a different warning if 'dblquad' evaluates this for values of u and y that are too close to zero. If that happens, you could fudge the two limits up just a very small amount away from zero to avoid such computational difficulties. The integrand values would actually be exceedingly small for such values of u and y in spite of the division by y^2.

  As for attempting to find a symbolic integral with 'int', my (admittedly rather ancient) integral table lists only a power series for that particular integral, so I suspect that you would receive a matlab message to the effect that there was "no explicit solution found".

Roger Stafford

Subject: double infinite integral

From: Walter Roberson

Date: 27 Mar, 2010 22:22:39

Message: 3 of 5

ati wrote:
> Hi,
> I'd like to evaluate double improper intagral, like:
>>> F=@(t,x)exp(-x.*t)./t.^3;
>
>>> dblquad(F,1,inf,0,inf));
> results: Warning: Infinite or Not-a-Number function value encountered.
> ans= NaN
>
> and
>>> int(int(F,t,1,inf),x,0,inf);
> results: ??? Undefined function or variable 't'.

If you reverse the order of integration, then a symbolic package (Maple)
quickly gives an answer of 1/3 for the double integration. On the other
hand, the inner integration is then expressed in terms of a limit, so I
do not have an intuitive understanding of what that really means or
whether the simple final answer is really correct. I am attempting some
numeric verification.... yes, Maple's int() function with the numeric
option confirms the 1/3.

Subject: double infinite integral

From: Roger Stafford

Date: 27 Mar, 2010 23:42:02

Message: 4 of 5

Walter Roberson <roberson@hushmail.com> wrote in message <hom0fg$7oc$1@canopus.cc.umanitoba.ca>...
> If you reverse the order of integration, then a symbolic package (Maple)
> quickly gives an answer of 1/3 for the double integration. On the other
> hand, the inner integration is then expressed in terms of a limit, so I
> do not have an intuitive understanding of what that really means or
> whether the simple final answer is really correct. I am attempting some
> numeric verification.... yes, Maple's int() function with the numeric
> option confirms the 1/3.

  Yes, you're right, Walter. The answer is indeed 1/3. In fact it can easily be done by hand that way. I just didn't think to try reversing the order.

Roger Stafford

Subject: double infinite integral

From: ati

Date: 28 Mar, 2010 20:53:06

Message: 5 of 5

"ati " <nati02@t-online.hu> wrote in message <holgpt$3fk$1@fred.mathworks.com>...
> Hi,
> I'd like to evaluate double improper intagral, like:
> >>F=@(t,x)exp(-x.*t)./t.^3;
>
> >>dblquad(F,1,inf,0,inf));
> results: Warning: Infinite or Not-a-Number function value encountered. ans= NaN
>
> and
> >> int(int(F,t,1,inf),x,0,inf);
> results: ??? Undefined function or variable 't'.
>
> Help is much appreciated.

Thanx for your replies.
Actually, I am coding the NORTA method for gamma random variables with linear correlations. In the initialization step a double intagral must be evaluated (several times) with the standard bivariate normal distribution as the integrator to find implied correlations. The posted example was only to clearify my problem. Now I use a reasonable finite domain, and so far seems to work well.

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