       Re: Interpolation

• To: mathgroup at smc.vnet.net
• Subject: [mg32309] Re: Interpolation
• From: "Allan Hayes" <hay at haystack.demon.co.uk>
• Date: Sat, 12 Jan 2002 05:18:28 -0500 (EST)
• References: <a1mbl8\$2ot\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Yas,
Here is an idea that might be refined:

dat=Table[{t,Sin[0.75+Exp[Pi*t]]},{t,0.,1.,.001}];
ListPlot[dat]

Cases[Partition[dat,3,
1],{a_,b_,c_}/;a[]\[LessEqual]b[]&&b[]\[GreaterEqual]c[]:>b]

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Yas" <y.tesiram at pgrad.unimelb.edu.au> wrote in message
news:a1mbl8\$2ot\$1 at smc.vnet.net...
> G'day mathgroup,
> I have some general questions on Interpolation as implemented in
> Mathematica. Essentially, I have a series of profiles for which I have
> no general function. The profile is generated by repetitive
> multiplication of rotation matrices and so it is difficult (and also
> questions I have, I have decided to use Interpolation -- a pitiful
> state, nevertheless a shade better than extrapolation. The first step
> involves creating the Interpolating function,
>
> thing1 = Interpolation[data];
>
> Then I find the first derivative,
>
> thing2 = D[thing1[x], {x, 0, lastdatapoint}]
>
> Next I want to find the points where thing2 = 0, but I have run into
> problems with Mathematica complaining about inverse functions etc,
> although plots of thing2 versus x look fine.
>
> My primary question is,
>
> 1. The profiles that I have, have maxima and minima whose co-ordinates I
> want to find, hence the differentiation step. Interpolation does a good
> job reproducing the data points and in finding a derivative that can be
> plotted but not when asked to Solve for thing2 = 0. How do I go about
> finding the accuracy of the Interpolating Function to test whether the
> value near thing2 = 0 is well behaved?
>
> And a secondary question is,
>
> 2. Is there another efficient method of estimating the co-ordinates of
> the minima and maxima by computer of data sets?
>
> The length of each of these data sets is 1000 points and for that reason
> I have not pasted it into the email. As a demonstrative example, the
> Table of values generated by,
>
> Table[Sin[0.75 + Exp[Pi*t]], {t, 0, 1, 1/1000}];
> ListPlot[%]
>
> is closely related.
>
> Any help or comments will be appreciated.
>
> Thanks
> Yas
>
>

```

• Prev by Date: Re: more elements in a list
• Next by Date: How do I assign a variable to be a real positive number ?