Changeset 7800:5184e5015a4c


Ignore:
Timestamp:
12/06/07 13:58:39 (5 years ago)
Author:
Mike Hansen <mhansen@…>
Branch:
default
Message:

Fixed #1139.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sage/calculus/calculus.py

    r7788 r7800  
    19971997            There is also a function \code{numerical_integral} that implements 
    19981998            numerical integration using the GSL C library.  It is potentially 
    1999             much faster and applies to arbitrary user defined functions.  
     1999            much faster and applies to arbitrary user defined functions. 
     2000 
     2001            Also, there are limits to the precision that Maxima can compute 
     2002            the integral to due to limitations in quadpack. 
     2003 
     2004            sage: f = x 
     2005            sage: f = f.nintegral(x,0,1,1e-14) 
     2006            Traceback (most recent call last): 
     2007            ... 
     2008            ValueError: Maxima (via quadpack) cannot compute the integral to that precision 
    20002009 
    20012010        EXAMPLES: 
     
    20492058        syntax.  
    20502059        """ 
    2051         v = self._maxima_().quad_qags(var(x), 
     2060        try: 
     2061            v = self._maxima_().quad_qags(var(x), 
    20522062                                      a, b, desired_relative_error, 
    20532063                                      maximum_num_subintervals) 
     2064        except TypeError, err: 
     2065            if "ERROR NUMBER = 6" in str(err): 
     2066                raise ValueError, "Maxima (via quadpack) cannot compute the integral to that precision" 
     2067            else: 
     2068                raise TypeError, err 
     2069             
    20542070        return float(v[0]), float(v[1]), Integer(v[2]), Integer(v[3]) 
    20552071 
Note: See TracChangeset for help on using the changeset viewer.