Quick integration of a known function

From LPTMS Wiki
Revision as of 16:57, 15 January 2013 by Roux (talk | contribs) (Created page with "Using scipy.integrate <source lang="py"> from scipy.integrate import quad,Inf from math import sqrt,pi,exp print sqrt(pi), quad(lambda x: exp(-x**2),-Inf,Inf) </source>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Using scipy.integrate

<source lang="py"> from scipy.integrate import quad,Inf from math import sqrt,pi,exp

print sqrt(pi), quad(lambda x: exp(-x**2),-Inf,Inf) </source>