Re: Integrated area [message #49031] |
Fri, 09 June 2006 08:04 |
Julio[1]
Messages: 52 Registered: May 2005
|
Member |
|
|
Yes... It does make sense...
Thanks
Julio
Julio escreveu:
> Hi, let me try to explain my question...
>
> Supose I have a curve defined my the vectors x and y:
>
> x=indgen(10)
> y=[0.2, 0.25, 0.34, 0.40, 0.55, 0.60, 0.52, 0.42, 0.30, 0.28]
>
> Now I'm calculating the area of the curve between 2 and 8 (in the x
> axis):
>
> Area=int_tabulated(x[2:8],y[2:8])
>
> This returns me the area below the curve considering y=0, the point
> where x and y crosses. However, I need to calculate the area below the
> curve considering y=0.2. How can I do that... I hope I was clear to
> explain my doubt -:)
>
> Any comments welcome,
>
> Best,
> Julio
|
|
|
Re: Integrated area [message #49033 is a reply to message #49031] |
Fri, 09 June 2006 06:26  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Julio writes:
> Hi, let me try to explain my question...
>
> Supose I have a curve defined my the vectors x and y:
>
> x=indgen(10)
> y=[0.2, 0.25, 0.34, 0.40, 0.55, 0.60, 0.52, 0.42, 0.30, 0.28]
>
> Now I'm calculating the area of the curve between 2 and 8 (in the x
> axis):
>
> Area=int_tabulated(x[2:8],y[2:8])
>
> This returns me the area below the curve considering y=0, the point
> where x and y crosses. However, I need to calculate the area below the
> curve considering y=0.2. How can I do that... I hope I was clear to
> explain my doubt -:)
>
> Any comments welcome,
Uh, this is probably naive, but if you take the area you
have here, and subtract the area you would get if you
perform the analysis again with y = intarr(10) + 0.2,
wouldn't that be the value you are looking for? :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|