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 pull it out and try numerically evaluating it easily. In fact, it
>>> probably could be done automatically.
>>>
>>
>> sage: a=integrate(250*cos(pi*x/180)^1.8 + 170.35 , x, 0, 18)
>> sage: a
>> integrate(250*cos(pi*x/180)^1.8 + 170.35, x, 0, 18)
>> sage: a.arguments()
>> (250*cos(pi*x/180)^1.8 + 170.35, x, 0, 18)
>>
>
> In that case, it should be simple to feed the integral to scipy. One
> could write a simple wrapper to numerically integrate integrals which
> can't be done analytically.

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
scipy.  To easy steps instead of one hard one.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to