#8321: numerical integration with arbitrary precision
-------------------------+--------------------------------------------------
   Reporter:  burcin     |          Owner:  burcin              
       Type:  defect     |         Status:  needs_work          
   Priority:  major      |      Milestone:  sage-4.7.1          
  Component:  symbolics  |       Keywords:  numerics,integration
Work_issues:             |       Upstream:  N/A                 
   Reviewer:             |         Author:  Stefan Reiterer     
     Merged:             |   Dependencies:                      
-------------------------+--------------------------------------------------

Comment(by burcin):

 I hadn't actually done the computation in Sage. I just wanted to note that
 web site here. :)

 With the patch attached to this ticket:

 {{{
 sage: sigma = 1e-4
 sage: ff = exp(-x**2/(2*sigma)) / sqrt(2*pi*sigma)
 sage: from sage.symbolic.integration.integral import definite_integral
 sage: definite_integral(ff, x, -20, 10, hold=True)
 integrate(70.7106781186548*e^(-5000.00000000000*x^2)/sqrt(pi), x, -20, 10)
 sage: definite_integral(ff, x, -20, 10, hold=True).n()
 5.38249970415053e-939
 }}}

 Without the patch:

 {{{
 sage: definite_integral(ff, x, -20, 10, hold=True).n()
 2.1074458151264474e-45
 }}}

 We get a better result if we allow maxima to evaluate the integral
 symbolically:

 {{{
 sage: definite_integral(ff, x, -20, 10).n()
 1.00000000000000
 sage: definite_integral(ff, x, -20, 10)
 0.353553390593*(sqrt(2)*sqrt(pi)*erf(500*sqrt(2)) +
 sqrt(2)*sqrt(pi)*erf(1000*sqrt(2)))/sqrt(pi)
 }}}

 The web site I linked to in comment:24 links to this page, where i got the
 example from:

 
http://trac.openopt.org/openopt/browser/PythonPackages/FuncDesigner/FuncDesigner/examples/integrate1.py

 Here is an excerpt from that file:

 {{{
 '''interalg result: 1.000006 (usually solution, obtained by interalg, has
 real residual 10-100-1000 times less
 than required tolerance, because interalg works with "most worst case"
 that extremely rarely occurs.
 Unfortunately, real obtained residual cannot be revealed).
 Now let's ensure scipy.integrate quad fails to solve the problem and mere
 lies about obtained residual: '''
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8321#comment:26>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
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-trac?hl=en.

Reply via email to