[sage-support] Re: numerical evaluation of integral?

2008-12-08 Thread Stan Schymanski
Dear all, Thanks a lot for your help. It looks like there is yet another useful function going to be implemented in sage. Just to give an example where quad is faster than GSL (sorry for the length): sage: def insol1(epsilon,ecc,varpi,phi,lambd): ... S0=1368 ... phirad=phi*pi/180.

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread William Stein
On Wed, Dec 3, 2008 at 12:44 AM, Stan Schymanski [EMAIL PROTECTED] wrote: Dear all, I would like to evaluate a symbolic equation containing an integral numerically: ((integrate(250*cos(pi*x/180)^1.8 + 170.35,x,0,18)/a_v)(a_v=1)).n() does not work. Is there a way of doing this? The real

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Robert Dodier
On Dec 4, 2:04 pm, William Stein [EMAIL PROTECTED] wrote: sage: f.n() and get back a floating point number. This is surprisingly not implemented in Sage, but it isn't. (That's basically because Maxima itself doesn't seem to have such functionality.) I'm guessing that f.n() just turns on

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Jason Grout
Robert Dodier wrote: On Dec 4, 2:04 pm, William Stein [EMAIL PROTECTED] wrote: sage: f.n() and get back a floating point number. This is surprisingly not implemented in Sage, but it isn't. (That's basically because Maxima itself doesn't seem to have such functionality.) I'm guessing

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Tim Lahey
On Dec 4, 2008, at 9:38 PM, Jason Grout wrote: Robert Dodier wrote: On Dec 4, 2:04 pm, William Stein [EMAIL PROTECTED] wrote: sage: f.n() and get back a floating point number. This is surprisingly not implemented in Sage, but it isn't. (That's basically because Maxima itself doesn't seem

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Jason Grout
Tim Lahey wrote: Jason Is there an easy way to get the integrand, variable and bounds out of the integral? That way, if one has tried to analytically evaluate it, they can pull it out and try numerically evaluating it easily. In fact, it probably could be done automatically. sage:

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Tim Lahey
On Dec 4, 2008, at 10:05 PM, Jason Grout wrote: Tim Lahey wrote: Jason Is there an easy way to get the integrand, variable and bounds out of the integral? That way, if one has tried to analytically evaluate it, they can pull it out and try numerically evaluating it easily. In fact,

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread William Stein
On Thu, Dec 4, 2008 at 7:11 PM, Tim Lahey [EMAIL PROTECTED] wrote: On Dec 4, 2008, at 10:05 PM, Jason Grout wrote: Tim Lahey wrote: Jason Is there an easy way to get the integrand, variable and bounds out of the integral? That way, if one has tried to analytically evaluate it, they can

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Tim Lahey
On Dec 4, 2008, at 10:14 PM, William Stein wrote: It would be better to call the numerical_integral function that is already in Sage, which Josh Kantor wrote, which is pretty sophisticated. It uses GSL and a C callback function. Then improve the implementation of that function to also use

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Jason Grout
William Stein wrote: On Thu, Dec 4, 2008 at 7:11 PM, Tim Lahey [EMAIL PROTECTED] wrote: On Dec 4, 2008, at 10:05 PM, Jason Grout wrote: Tim Lahey wrote: Jason Is there an easy way to get the integrand, variable and bounds out of the integral? That way, if one has tried to analytically

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Jason Grout
Tim Lahey wrote: On Dec 4, 2008, at 10:14 PM, William Stein wrote: It would be better to call the numerical_integral function that is already in Sage, which Josh Kantor wrote, which is pretty sophisticated. It uses GSL and a C callback function. Then improve the implementation of that

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread William Stein
On Thu, Dec 4, 2008 at 7:25 PM, Jason Grout [EMAIL PROTECTED] wrote: William Stein wrote: On Thu, Dec 4, 2008 at 7:11 PM, Tim Lahey [EMAIL PROTECTED] wrote: On Dec 4, 2008, at 10:05 PM, Jason Grout wrote: Tim Lahey wrote: Jason Is there an easy way to get the integrand, variable and

[sage-support] Re: numerical evaluation of integral?

2008-12-04 Thread Jason Grout
William Stein wrote: Should we phase GSL out of numerical_integral too? Should we replace it with the equivalent scipy call (which would make it massively shorter and simpler)? Yes, it is very tempting to do so. One thing is that each function evaluation could in theory be much faster