#12455: Make Airy functions symbolic
-----------------------------------------------------------------------------------------+
Reporter: olazo
| Owner: olazo
Type: enhancement
| Status: needs_work
Priority: major
| Milestone: sage-5.11
Component: symbolics
| Resolution:
Keywords: Airy functions sd40.5 sd48
| Work issues: circular import, doctest failures
Report Upstream: N/A
| Reviewers: Eviatar Bach, Karl-Dieter Crisman, Burcin Erocal
Authors: Oscar Gerardo Lazo Arjona, Benjamin Jones, D. S. McNeil,
Eviatar Bach | Merged in:
Dependencies: #12289
| Stopgaps:
-----------------------------------------------------------------------------------------+
Changes (by {'newvalue': u'Oscar Gerardo Lazo Arjona, Benjamin Jones, D. S.
McNeil, Eviatar Bach', 'oldvalue': u'Oscar Gerardo Lazo Arjona, Benjamin Jones,
Eviatar Bach'}):
* reviewer: Eviatar Bach, Karl-Dieter Crisman => Eviatar Bach, Karl-
Dieter Crisman, Burcin Erocal
* author: Oscar Gerardo Lazo Arjona, Benjamin Jones, Eviatar Bach =>
Oscar Gerardo Lazo Arjona, Benjamin Jones, D. S.
McNeil, Eviatar Bach
Old description:
> As discussed in [http://groups.google.com/group/sage-
> support/browse_thread/thread/f458d0f9cfd89c9a sage-support].
>
> Currently sage can evaluate airy functions numerically:
> {{{
> sage: airy_ai(1.4)
> 0.0820380498076
> }}}
>
> but it doesn't work symbolically
>
> {{{
> sage: airy_ai(x)
> ---------------------------------------------------------------------------
> TypeError Traceback (most recent call
> last)
>
> /home/oscar/Escritorio/tesis/calculos/<ipython console> in <module>()
>
> /home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
> packages/sage/functions/special.pyc in airy_ai(x)
> 621 """
> 622 _init()
> --> 623 return RDF(meval("airy_ai(%s)"%RDF(x)))
> 624
> 625 def airy_bi(x):
>
> /home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
> packages/sage/structure/parent.so in
> sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7102)()
>
> /home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
> packages/sage/structure/coerce_maps.so in
> sage.structure.coerce_maps.NamedConvertMap._call_
> (sage/structure/coerce_maps.c:4221)()
>
> /home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
> packages/sage/symbolic/expression.so in
> sage.symbolic.expression.Expression._real_double_
> (sage/symbolic/expression.cpp:5391)()
>
> /home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
> packages/sage/symbolic/expression.so in
> sage.symbolic.expression.Expression._eval_self
> (sage/symbolic/expression.cpp:4898)()
>
> TypeError: Cannot evaluate symbolic expression to a numeric value.
> }}}
>
> We should make it symbolical for both airy_ai and airy_bi, as well as
> their derivatives.
>
> ----
>
> Apply [attachment:trac_12455-newstyle-airy-rebase.patch] and
> [attachment:trac_12455-newstyle-airy2-rebase.patch].
New description:
As discussed in [http://groups.google.com/group/sage-
support/browse_thread/thread/f458d0f9cfd89c9a sage-support].
Currently sage can evaluate airy functions numerically:
{{{
sage: airy_ai(1.4)
0.0820380498076
}}}
but it doesn't work symbolically
{{{
sage: airy_ai(x)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/oscar/Escritorio/tesis/calculos/<ipython console> in <module>()
/home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
packages/sage/functions/special.pyc in airy_ai(x)
621 """
622 _init()
--> 623 return RDF(meval("airy_ai(%s)"%RDF(x)))
624
625 def airy_bi(x):
/home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
(sage/structure/parent.c:7102)()
/home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
packages/sage/structure/coerce_maps.so in
sage.structure.coerce_maps.NamedConvertMap._call_
(sage/structure/coerce_maps.c:4221)()
/home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
packages/sage/symbolic/expression.so in
sage.symbolic.expression.Expression._real_double_
(sage/symbolic/expression.cpp:5391)()
/home/oscar/sage/sage-4.7.1/local/lib/python2.6/site-
packages/sage/symbolic/expression.so in
sage.symbolic.expression.Expression._eval_self
(sage/symbolic/expression.cpp:4898)()
TypeError: Cannot evaluate symbolic expression to a numeric value.
}}}
We should make it symbolical for both airy_ai and airy_bi, as well as
their derivatives.
----
Apply
* [attachment:trac_12455-newstyle-airy-rebase.patch]
* [attachment:trac_12455-newstyle-airy2-rebase.patch]
* [attachment: trac_12455-airy_review.patch]
--
Comment:
[attachment:trac_12455-airy_review.patch] fixes a couple of problems:
* `airy_{a,b}i_general` should evaluate to `airy_{a,b}i_simple`,
`airy_{a,b}i_prime`, etc. depending on the first parameter
* differentiating `airy_{a,b}i_general` in the first parameter is not
allowed
* `_evalf_` should not raise errors for unrecognized algorithm argument
This is still needs work because we use indirect doctests everywhere.
There is no reason to go through the `airy_{a,b}i` wrapper functions. We
should call the symbolic functions directly in the doctests. There are
also a lot of code paths that are not tested. I changed the fractional
order behavior, but didn't need to change any doctests.
It would be great if someone else can fix/add doctests. I will move on to
something else now.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12455#comment:40>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.