Daniel Farrell wrote:
> Hello,
> 
> Is there a quadrature equivalent to integrate(f,a,b)? I have an
> equation with no analytical integral so quadrature is the only
> alternative, for example by, simps or trapz.
> 


You can use numerical_integral or the scipy quad function:

http://docs.scipy.org/doc/scipy/reference/integrate.html


sage: from scipy.integrate import quad
sage: x2 = lambda x: x**2
sage: quad(x2,0.,4.)
(21.333333333333332, 2.3684757858670003e-13)
sage: numerical_integral(x2,0,4)
(21.333333333333332, 2.3684757858670003e-13)


Jason


-- 
Jason Grout


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

Reply via email to