MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NIntegrate problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27814] Re: NIntegrate problem
  • From: "Paul Lutus" <nospam at nosite.com>
  • Date: Mon, 19 Mar 2001 01:29:05 -0500 (EST)
  • References: <98vh78$8t6@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Martin Richter" <mrMICE.fi at cbs.dk> wrote in message
news:98vh78$8t6 at smc.vnet.net...
> Hi
>
> I'm trying to integrate a simple function, defined as follows:
>
> SeasonTab = {{0/12, -0.5}, {1/12, -.2}, {2/12, -0.5}, {3/12, -0.5}, {4/12,
>         0. - .25}, {5/12, 0.1}, {6/12, 0.5}, {7/12, 0.7}, {8/12,
>         1.1}, {9/12, -0.3}, {10/12, -0.7}, {11/12, -0.6}, {12/12, -0.5}};
> SeasonFunction =
>     Interpolation[SeasonTab, PeriodicInterpolation -> True,
>       InterpolationOrder -> 3];

I am not sure this merits the description "simple function." It is a rather
complex periodic waveform.

> NIntegrate[SeasonFunction[t]*Cos[2*Pi*t], {t, 0, 1}]
>
> I think I have tried every setting in NIntegrate.
>
> The function SeasonFunction[t]*Cos[2*Pi*t] is of course not C\infinity but
> it should not give any problems. So at the moment I'm just ignoring
> the error message but if anyone could tell what this the problem is it
would
> be great.

Okay, here is the rundown:

1. Your function is "oscillatory."
2. NIntegrate reports this, and suggests Method->Oscillatory.
3. If you add the option "Method->Oscillatory", NInetgrate reports that one
of the limits of integration must be set to infinity.
4. If you set one of the limits to infinity, NIntegrate just complains
louder.

So here is what I suggest. Instead of explaining why this method won't work,
why not tell us what the function is supposed to do. I personally think
perhaps it should be converted into the frequency domain (using Fourier or
FourierIntegral) and evaluated in that way, or some other method might be
more appropriate.

Let's say you real purpose is to get an average of the 12 values. This is
much more easily accomplished than the way you are going about it:

Apply[Plus,SeasonTab]/12

But when I do this, I notice another problem right away. Isn't this supposed
to represent twelve months, with associated data? There are 13 months in
your table, "numbered" 0 to 12. If your purpose is to create a
representation of a repeating process, there's no need for the 13th datum,
in fact it may cause problems, depending on which approach you choose.

--
Paul Lutus
www.arachnoid.com





  • Prev by Date: Re: How write output to another notebook?
  • Next by Date: Re: extracting the information from Solve
  • Previous by thread: Re: NIntegrate problem
  • Next by thread: Re: NIntegrate problem