help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quadl can't integrate sin or cos over a period


From: Dmitri A. Sergatskov
Subject: Re: quadl can't integrate sin or cos over a period
Date: Tue, 8 Jul 2008 00:27:11 -0500

On Mon, Jul 7, 2008 at 11:41 PM, Adam Higuera <address@hidden> wrote:
> When I enter the command:
>
> quadl(@sin, 0, 2*pi)
>
> octave 3.0.1 under Fedora 9 hangs and fails to produce a result.  However,
>

Perhaps it is a bug in the algorithm itself. In any case it does not
really hangs,
it just take a very long time to finish. You can speed it up by specifying
tolerance :

octave:12> tic; x=quadl(@sin, 0, 2*pi, 1e-2); toc
Elapsed time is 0.6039 seconds.
octave:13> x
x =  1.3878e-16
octave:14> tic; x=quadl(@sin, 0, 2*pi, 1e-3); toc
Elapsed time is 2.542 seconds.
octave:15> x
x =  1.1102e-16
octave:16> tic; x=quadl(@sin, 0, 2*pi, 1e-4); toc
Elapsed time is 7.278 seconds.
octave:17> x
x =  1.1102e-16
octave:18> tic; x=quadl(@sin, 0, 2*pi, 1e-5); toc
Elapsed time is 28.99 seconds.
octave:19> x
x =  1.1102e-16
octave:20>

Dmitri.
--


reply via email to

[Prev in Thread] Current Thread [Next in Thread]