Hi

If you look a few lines before, the if statement is there; so I don't think
it is that.

        try:
            return max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a))
for a in args])))
        except RuntimeError, error:
            s = str(error)
            *if "Divergent" in s or "divergent" in s:*
# in pexpect interface, one looks for this - e.g. integrate(1/x^3,x,-1,3)
gives a principal value
*#            if "divergent" in s or 'Principal Value' in s:*
                raise ValueError, "Integral is divergent."
            elif "Is" in s: # Maxima asked for a condition
                j = s.find('Is ')
                s = s[j:]
                k = s.find(' ',4)
                raise ValueError, "Computation failed since Maxima
requested additional constraints; using the 'assume' command before
integral evaluation *may* help (example of legal syntax is 'assume(" +
s[4:k] +">0)', see `assume?` for more details)\n" + s
            else:
                raise error

Regards,
Jan


On 1 March 2013 09:39, Jan Groenewald <j...@aims.ac.za> wrote:

> Sage 5.7 on Ubuntu 12.04.2
>
> sage:
> integral(e^(-abs(x))/cosh(x),x,-infinity,infinity)
>
> 2*log(2)
> sage: integral(e^(-abs(x))/cosh(x),x,-infinity,infinity)
> ---------------------------------------------------------------------------
> ValueError                                Traceback (most recent call last)
> ...
> <snip>
> ...
> /usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc
> in sr_integral(self, *args)
>     737 # in pexpect interface, one looks for this - e.g.
> integrate(1/x^3,x,-1,3) gives a principal value
>     738 #            if "divergent" in s or 'Principal Value' in s:
> --> 739                 raise ValueError, "Integral is divergent."
>     740             elif "Is" in s: # Maxima asked for a condition
>     741                 j = s.find('Is ')
>
> ValueError: Integral is divergent.
> sage:
>
> It runs fine in maxima repeatedly...
>
> 0 jan@muizenberg:/var/autofs/misc/home/jan$sage --maxima
> ;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/sb-bsd-sockets.fas"
> ;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/sockets.fas"
> ;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/defsystem.fas"
> ;;; Loading #P"/usr/lib/sagemath/local/lib/ecl/cmp.fas"
> Maxima 5.29.1 http://maxima.sourceforge.net
> using Lisp ECL 12.12.1
> Distributed under the GNU Public License. See the file COPYING.
> Dedicated to the memory of William Schelter.
> The function bug_report() provides bug reporting information.
> (%i1)  integral(e^(-abs(x))/cosh(x),x,-infinity,infinity);
>                               1
> (%o1)         integral(---------------, x, - infinity, infinity)
>                         abs(x)
>                        e       cosh(x)
> (%i2)  integral(e^(-abs(x))/cosh(x),x,-infinity,infinity);
>                               1
> (%o2)         integral(---------------, x, - infinity, infinity)
>                         abs(x)
>                        e       cosh(x)
> (%i3)
>
> Regards,
> Jan
> --
>   .~.
>   /V\     Jan Groenewald
>  /( )\    www.aims.ac.za
>  ^^-^^
>



-- 
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to