Hi Oscar,

On Tue, 7 Feb 2012 00:08:04 -0800 (PST)
Oscar Lazo <algebraicame...@gmail.com> wrote:

> Done:
> 
> http://trac.sagemath.org/sage_trac/ticket/12455

Thanks!

> I've added a patch, which should do the job, but it has a few
> shortcomings:
> 
> 1.-The resulting symbolic functions seem to remain on hold:
> 
> sage: airy_ai(1.0)
> airy_ai(1.00000000000000)
> 
> You need to force it to evaluate:
> 
> sage: airy_ai(1.0).n()
> 0.135292416313

You need to add an _eval_() function which calls _evalf_() if the
argument is not exact. See this patch for an example:

http://trac.sagemath.org/sage_trac/attachment/ticket/4498/trac_4498-symbolic_arg.cleanup.patch


> 2.- This doesn't work:
> 
> sage: airy_ai(2.0).n(digits=100)
> 0.0349241304233

The _evalf_() function in your patch hard codes RDF. You need to do
something like this:

sage: from sage.libs.mpmath import utils as mpmath_utils
sage: import mpmath
sage: mpmath_utils.call(mpmath.airyai, 1, parent=RR)
0.135292416312881


> 3.- There is no evaluation for airy_ai_prime or airy_bi_prime

I don't think we want to have separate functions for the derivatives in
Sage. These might help you get around the printing problem for now, but
they are not useful in general.

BTW, #6244 has a patch that changes the way derivatives are printed:

http://trac.sagemath.org/sage_trac/ticket/6344#comment:2

> 4.- I'm not sure about how should the functions be called, some
> possible schemes are
> 
> {ai,bi,aip,bip} {ai,bai,aip,baip}
> {airy_ai,airy_bi,airy_ai_prime,airy_bi_prime}
> 
> And also whether the latex representation should be capitalized or
> not. I chose the third scheme, and capitalized typesetting.

I like airy_{a,b}i and capitalized typesetting as well.


Cheers,
Burcin

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to