# Ticket #12455: trac_12455-symbolic_airy.patch

File trac_12455-symbolic_airy.patch, 5.9 KB (added by olazo, 10 years ago)
• ## sage/functions/special.py

```# HG changeset patch
# User Oscar Gerardo Lazo Arjona <algebraicamente@gmail.com>
# Date 1328600994 21600
# Node ID 88a61cc0d17afaf33b4043246d8b04642dc3e915
#12455 Make Airy functions symbolical

diff -r 2a2abbcad325 -r 88a61cc0d17a sage/functions/special.py```
 a return NewMaximaFunction() class AiryAi(BuiltinFunction): r""" The function `Ai(x)` and the related function `Bi(x)`, which is also called an *Airy function*, are solutions to the differential equation .. math:: y'' - xy = 0, known as the *Airy equation*. The initial conditions `Ai(0) = (\Gamma(2/3)3^{2/3})^{-1}`, `Ai'(0) = -(\Gamma(1/3)3^{1/3})^{-1}` define `Ai(x)`. The initial conditions `Bi(0) = 3^{1/2}Ai(0)`, `Bi'(0) = -3^{1/2}Ai'(0)` define `Bi(x)`. They are named after the British astronomer George Biddell Airy. They belong to the class of "Bessel functions of fractional order". EXAMPLES:: def airy_ai(x): r""" The function `Ai(x)` and the related function `Bi(x)`, which is also called an *Airy function*, are solutions to the differential equation sage: var('x') sage: airy_ai(x) airy_ai(x) sage: airy_bi(x) airy_bi(x) REFERENCE: - Abramowitz and Stegun: Handbook of Mathematical Functions, http://www.math.sfu.ca/~cbm/aands/ - http://en.wikipedia.org/wiki/Airy_function """ def __init__(self): BuiltinFunction.__init__(self, "airy_ai", latex_name=r"\operatorname{Ai}") .. math:: def _derivative_(self, x, diff_param=None): return airy_ai_prime(x) def _evalf_(self, x, parent=None): r""" EXAMPLES:: sage: float(airy_ai(1.0)) 0.135292416313 """ _init() return RDF(meval("airy_ai(%s)"%RDF(x))) airy_ai=AiryAi() class AiryBi(BuiltinFunction): r""" The function `Ai(x)` and the related function `Bi(x)`, which is also called an *Airy function*, are solutions to the differential equation .. math:: y'' - xy = 0, known as the *Airy equation*. The initial conditions `Ai(0) = (\Gamma(2/3)3^{2/3})^{-1}`, `Ai'(0) = -(\Gamma(1/3)3^{1/3})^{-1}` define `Ai(x)`. The initial conditions `Bi(0) = 3^{1/2}Ai(0)`, `Bi'(0) = -3^{1/2}Ai'(0)` define `Bi(x)`. They are named after the British astronomer George Biddell Airy. They belong to the class of "Bessel functions of fractional order". EXAMPLES:: known as the *Airy equation*. The initial conditions `Ai(0) = (\Gamma(2/3)3^{2/3})^{-1}`, `Ai'(0) = -(\Gamma(1/3)3^{1/3})^{-1}` define `Ai(x)`. The initial conditions `Bi(0) = 3^{1/2}Ai(0)`, `Bi'(0) = -3^{1/2}Ai'(0)` define `Bi(x)`. sage: var('x') sage: airy_ai(x) airy_ai(x) sage: airy_bi(x) airy_bi(x) REFERENCE: - Abramowitz and Stegun: Handbook of Mathematical Functions, http://www.math.sfu.ca/~cbm/aands/ - http://en.wikipedia.org/wiki/Airy_function """ def __init__(self): BuiltinFunction.__init__(self, "airy_bi", latex_name=r"\operatorname{Bi}") def _derivative_(self, x, diff_param=None): return airy_ai_prime(x) They are named after the British astronomer George Biddell Airy. They belong to the class of "Bessel functions of fractional order". def _evalf_(self, x, parent=None): r""" EXAMPLES:: EXAMPLES:: sage: airy_ai(1.0)        # last few digits are random 0.135292416312881400 sage: airy_bi(1.0)        # last few digits are random 1.20742359495287099 sage: float(airy_bi(1.0)) 1.20742359495 """ _init() return RDF(meval("airy_bi(%s)"%RDF(x))) airy_bi=AiryBi() REFERENCE: class AiryAiPrime(BuiltinFunction): r""" The derivative of the Airy function `Ai(x)`. """ def __init__(self): BuiltinFunction.__init__(self, "airy_ai_prime", latex_name=r"\operatorname{Ai}'") airy_ai_prime=AiryAiPrime() - Abramowitz and Stegun: Handbook of Mathematical Functions, http://www.math.sfu.ca/~cbm/aands/ - http://en.wikipedia.org/wiki/Airy_function """ _init() return RDF(meval("airy_ai(%s)"%RDF(x))) def airy_bi(x): r""" The function `Ai(x)` and the related function `Bi(x)`, which is also called an *Airy function*, are solutions to the differential equation .. math:: y'' - xy = 0, known as the *Airy equation*. The initial conditions `Ai(0) = (\Gamma(2/3)3^{2/3})^{-1}`, `Ai'(0) = -(\Gamma(1/3)3^{1/3})^{-1}` define `Ai(x)`. The initial conditions `Bi(0) = 3^{1/2}Ai(0)`, `Bi'(0) = -3^{1/2}Ai'(0)` define `Bi(x)`. They are named after the British astronomer George Biddell Airy. They belong to the class of "Bessel functions of fractional order". EXAMPLES:: sage: airy_ai(1)        # last few digits are random 0.135292416312881400 sage: airy_bi(1)        # last few digits are random 1.20742359495287099 REFERENCE: - Abramowitz and Stegun: Handbook of Mathematical Functions, http://www.math.sfu.ca/~cbm/aands/ - http://en.wikipedia.org/wiki/Airy_function """ _init() return RDF(meval("airy_bi(%s)"%RDF(x))) class AiryBiPrime(BuiltinFunction): r""" The derivative of the Airy function `Bi(x)`. """ def __init__(self): BuiltinFunction.__init__(self, "airy_bi_prime", latex_name=r"\operatorname{Bi}'") airy_bi_prime=AiryBiPrime() def bessel_I(nu,z,algorithm = "pari",prec=53): r"""