Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
value of a function at y(0) given the definite integral
Say I know the shape of a function y(x). Say it's x^2. Say I know the integral from a to b of this function. Say it's 1.0. What I want to do is find out the value of the function at y(0) given the info above, mainly y(x) = x^2 integral_ab(y(x)) = 1.0 What's the value of y(lowerLimit)? Does anybody know how to solve for this? I was going along the lines of: 1) find indefinate integral of y(x), call this Y 2) so... Y(b) - Y(a) = 1.0. Correct? Then I just solve for Y at lower limit. 3) Y(a) = Y(b) - 1.0. => Y(a) is my answer, I think, or do I have to differentiate this? So if I can find the indefinate integral of y(x) and then just use algebra to solve by that rule Y(upperLimit) - Y(lowerLimit) = definiteIntegral. Am I right? In my above example of y(x) = x^2, say the limits [a,b] are [0,3]. To find what's going on at x=0, I'd have: integral(x^2) = Y = x^3/3 ;the indefinite integral of x^2 Y(3) - Y(0) = 1.0 3^3/3 - Y(0) = 1.0 9 - Y(0) = 1.0 Y(0) = 8 ;what to do now?? I thought I'd just plug in my lower limit (here 0) for x in x^3/3 = 8, but then eqn is in form const=const! 0^3/3 = 8 1/3 = 8 Ok, now I've gone astray. I must be missing something. My problems are 1) I'm not sure if I'm approaching this the correct way and 2) How do I get the indefinite integral in IDL. QSimp(), etc. find only definite integrals. I think I need the indefinite integ. so I can find my value at y(lowerLimit). Or, is my entire approach wrong? Does this make sense?? THanks
Re: value of a function at y(0) given the definite integral
Anybody out there? aqueous0123@yahoo.com (aqueous) wrote in message news:<eecb3de2.0110221241.46cb7d16@posting.google.com>... > Say I know the shape of a function y(x). Say it's x^2. > Say I know the integral from a to b of this function. Say it's 1.0. > > What I want to do is find out the value of the function at y(0) given > the info above, mainly > > y(x) = x^2 > integral_ab(y(x)) = 1.0 > What's the value of y(lowerLimit)? > > > Does anybody know how to solve for this? > > I was going along the lines of: > > 1) find indefinate integral of y(x), call this Y > 2) so... Y(b) - Y(a) = 1.0. Correct? Then I just solve for Y at lower > limit. > 3) Y(a) = Y(b) - 1.0. => Y(a) is my answer, I think, or do I have to > differentiate this? > > So if I can find the indefinate integral of y(x) and then just use > algebra to solve by that rule Y(upperLimit) - Y(lowerLimit) = > definiteIntegral. Am I right? > > In my above example of y(x) = x^2, say the limits [a,b] are [0,3]. To > find what's going on at x=0, I'd have: > > integral(x^2) = Y = x^3/3 ;the indefinite integral of x^2 > Y(3) - Y(0) = 1.0 > 3^3/3 - Y(0) = 1.0 > 9 - Y(0) = 1.0 > Y(0) = 8 > ;what to do now?? I thought I'd just plug in my lower limit (here 0) > for x in x^3/3 = 8, but then eqn is in form const=const! > 0^3/3 = 8 > 1/3 = 8 > > Ok, now I've gone astray. I must be missing something. > > My problems are > 1) I'm not sure if I'm approaching this the correct way and > 2) How do I get the indefinite integral in IDL. QSimp(), etc. find > only definite integrals. I think I need the indefinite integ. so I can > find my value at y(lowerLimit). Or, is my entire approach wrong? > > Does this make sense?? > > THanks
aqueous wrote: > > Say I know the shape of a function y(x). Say it's x^2. > Say I know the integral from a to b of this function. Say it's 1.0. > > What I want to do is find out the value of the function at y(0) given > the info above, mainly > > y(x) = x^2 > integral_ab(y(x)) = 1.0 > What's the value of y(lowerLimit)? > Does this make sense?? No, I suppose not. If you have the function in hand, then: y(x=0)=y(0)=0^2=0 Presumably this result was obvious to you too, and you mean you have an integral over some limits and want to use this information to find the value at x=0, without knowing the function itself? This is of course impossible. Perhaps what you *really* mean is you have some function like: y=Ax^2 where you want to determine an overall normalization constant "A" from a known integral over a fixed range of the given functional form. This is a much more sensible problem, and quite common in practice. It can be approached numerically (for which IDL can offer some help), or analytically (for which IDL is useless). In both cases, the simple relation: integral(Ay(x) dx)=A integral(y(x) dx) will guide the way. JD
Hmmm... ;find integral of known fn x^2 over interval [0,1] x = findgen(11)/10. print, int_tabulated( x, x^2 ) 0.333406 Here, we know 1) integral_aTOb = 1/3 (where a=0 & b=1) 2) y(0) = 0^2 = 0 3) y(1) = 1^2 = 1 Using JD's stuff, let's find A for this plain jane case A integral_0to1(x^2 dx) = 1/3 A * (1^3/3 - 0^3/3) = 1/3 A = 1 Of course, it should be 1 because that's the normalization constant we assumed when we calculated using int_tabulated( x, x^2 ) above. But, how do you relate A to the value of y(0)? We know y(0) in this case is equal to 0, not 1. I think the problem is that his integral_aTOb is not = 1/3, but something else, like 10. Therefore the y(0) must not be 0 but must be greater than this, like 2.7234. I think he's looking for the *offset* of y(0) that would make the area under the curve x^2 = 10 (or whatever). Wouldn't this be an addition y(x)+A, not multiplication A*y(x)? Under JD's solution for the example here of integral_aTOb(x^2) = 10: A * integral_0to1(x^2 dx) = 10 A * (1^3/3 - 0^3/3) = 10 A * 1/3 = 10 A = 30 Again, I don't see it how this value relates to the value of y at x=0? Sorry, just getting curious/ john "JD Smith" <jdsmith@astro.cornell.edu> wrote in message news:3BD9C768.8F4A8721@astro.cornell.edu... > > integral(Ay(x) dx)=A integral(y(x) dx) > > will guide the way. > > JD