#11143: define symbolic functions for exponential integrals
-------------------------------------------------------------+--------------
Reporter: kcrisman | Owner:
benjaminfjones
Type: defect | Status:
needs_review
Priority: major | Milestone:
sage-5.1
Component: symbolics | Resolution:
Keywords: ei Ei special function maxima sd32 sd40.5 | Work issues:
Report Upstream: N/A | Reviewers:
Burcin Erocal, Karl-Dieter Crisman
Authors: Benjamin Jones | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------------------------+--------------
Comment (by dsm):
Looks good! A few quirks I've noticed:
(1) li behaves a little differently with respect to autoevaluation at 0:
{{{
sage: Si(0)
0
sage: Shi(0)
0
sage: li(0)
log_integral(0)
sage: li(0).simplify()
0
sage: li(0).n()
0.000000000000000
}}}
(2) In the (probably semi-deprecated; it works with Python floats)
exponential_integral_1, we should special-case 0:
{{{
sage: exp_integral_e1(0.01)
4.03792957653811
sage: exponential_integral_1(0.01)
4.037929576538114
sage: exp_integral_e1(0)
exp_integral_e1(0)
sage: exp_integral_e1(0).n()
+infinity
sage: exponential_integral_1(0)
---------------------------------------------------------------------------
PariError Traceback (most recent call
last)
/Users/mcneil/sagedev/sage-5.1.beta0/devel/sage-hack/sage/<ipython
console> in <module>()
/Users/mcneil/sagedev/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/functions/exp_integral.pyc in exponential_integral_1(x, n)
1327 from sage.libs.pari.all import pari
1328 if n <= 0:
-> 1329 return float(pari(x).eint1())
1330 else:
1331 return [float(z) for z in pari(x).eint1(n)]
/Users/mcneil/sagedev/sage-5.1.beta0/local/lib/python2.7/site-
packages/sage/libs/pari/gen.so in sage.libs.pari.gen._pari_trap
(sage/libs/pari/gen.c:49907)()
PariError: (5)
}}}
(3) There's something going on with integration I don't understand:
{{{
sage: integrate(sinh_integral(x), x)
x*sinh_integral(x) - cosh(x)
sage: integrate(sinh_integral(x), x, 0, 1/2)
-cosh(1/2) + 1/2*sinh_integral(1/2) + 1
sage: integrate(sinh_integral(x), x, 0, 1/2).n()
0.125872409703453
sage:
sage: integrate(sinh_integral(x), x, 0.0, 0.5)
0.125872409703 + 1.57079632679*I
}}}
IOW, somehow we pick up a pi/2 I, and it probably happens on our side:
{{{
In [7]: quad(lambda x: shi(x), [0, 0.5])
Out[7]: mpf('0.12587240970345281')
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11143#comment:50>
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.