comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to calculate the abscissa values for the given vertical values
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to calculate the abscissa values for the given vertical values [message #68124 is a reply to message #68121] Mon, 05 October 2009 10:55 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Oct 5, 11:34 am, "dux...@gmail.com" <dux...@gmail.com> wrote:
> Y is a time series and X is the sampling time.
> Both X and Y are discrete.
> I don't know the analytical form of the relation bewteen X and Y.

Ok - then this is much easier and Jean indicated a good approach
- with minor modifcations to take into account the case where
a datapoint is exactly zero.

Ciao,
Paolo

>
> To get the vertical value NY for a given time NX, I can use 'NY =
> interpol(Y, X NX)'.
> Similarly, I want to get the correspondent time CX for a fixed
> vertical value CY.
> But the values of correspondent time are not unique. CX should be not
> a scalar but an array.
> So I cannot use 'CX = interpol(X, Y, CY)' to get these values.
>
> On Oct 5, 4:55 pm, Paolo <pgri...@gmail.com> wrote:
>
>> On Oct 5, 9:43 am, "dux...@gmail.com" <dux...@gmail.com> wrote:
>
>>> Maybe my statement is not clear.
>
>>> There is a function Y=F(X), and I want to calculate the correspondent
>>> abscissa values X for Y=0.
>>> It means that there are serval intersection points between the line Y=F
>>> (X) and the horizonal line Y=0,
>>> and I want to get the correspondent abscissa values of these points.
>
>> You should realize that what you *want* and what you can *achieve*
>> are two different things. This is a hard problem for general F...
>> I believe you should read chapter 9 (on root finding) of the
>> numerical recipes book.
>
>> But - this problem becomes more easy if you do know something about
>> the properties of your function - for instance if you can bracket
>> your solutions - so maybe the question is, what do you know about F?
>
>> Ciao,
>> Paolo
>
>>> On Oct 5, 3:10 pm, Wox <s...@nomail.com> wrote:
>
>>>> On Mon, 5 Oct 2009 01:56:20 -0700 (PDT), "dux...@gmail.com"
>
>>>> <dux...@gmail.com> wrote:
>>>> >Hi, all.
>>>> >I want to calculate the abscissa values for the given vertical values.
>
>>>> >For example,
>>>> >     x = findgen(1000)/1000*4*pi
>>>> >     y = cos(x)
>>>> >I want to get the abscissa values for y=0.
>>>> >For this example, the results shoule be [!pi/2, 3*!pi/2, 5*!pi/2, 7*!
>>>> >pi/2].
>>>> >But how can I get it by IDL codes?
>
>>>> >Best wishes,
>>>> >jdu
>
>>>> Just for this function:
>>>> print,(indgen(ceil(max(x)/!pi))+1)*!pi/2
>
>>>> What do you need exactly? You can always find the answer analytically
>>>> no?
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Earn Free cash From DoEarn
Next Topic: rois

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 10:33:08 PDT 2025

Total time taken to generate the page: 2.71994 seconds