| 588 | class AiryAi(BuiltinFunction): |
| 589 | r""" |
| 590 | The function `Ai(x)` and the related function `Bi(x)`, |
| 591 | which is also called an *Airy function*, are |
| 592 | solutions to the differential equation |
| 593 | |
| 594 | .. math:: |
| 595 | |
| 596 | y'' - xy = 0, |
| 597 | |
| 598 | known as the *Airy equation*. The initial conditions |
| 599 | `Ai(0) = (\Gamma(2/3)3^{2/3})^{-1}`, |
| 600 | `Ai'(0) = -(\Gamma(1/3)3^{1/3})^{-1}` define `Ai(x)`. |
| 601 | The initial conditions `Bi(0) = 3^{1/2}Ai(0)`, |
| 602 | `Bi'(0) = -3^{1/2}Ai'(0)` define `Bi(x)`. |
| 603 | |
| 604 | They are named after the British astronomer George Biddell Airy. |
| 605 | They belong to the class of "Bessel functions of fractional order". |
| 606 | |
| 607 | EXAMPLES:: |
589 | | def airy_ai(x): |
590 | | r""" |
591 | | The function `Ai(x)` and the related function `Bi(x)`, |
592 | | which is also called an *Airy function*, are |
593 | | solutions to the differential equation |
| 609 | sage: var('x') |
| 610 | sage: airy_ai(x) |
| 611 | airy_ai(x) |
| 612 | sage: airy_bi(x) |
| 613 | airy_bi(x) |
| 614 | |
| 615 | REFERENCE: |
| 616 | |
| 617 | - Abramowitz and Stegun: Handbook of Mathematical Functions, |
| 618 | http://www.math.sfu.ca/~cbm/aands/ |
| 619 | |
| 620 | - http://en.wikipedia.org/wiki/Airy_function |
| 621 | """ |
| 622 | def __init__(self): |
| 623 | BuiltinFunction.__init__(self, "airy_ai", latex_name=r"\operatorname{Ai}") |
599 | | known as the *Airy equation*. The initial conditions |
600 | | `Ai(0) = (\Gamma(2/3)3^{2/3})^{-1}`, |
601 | | `Ai'(0) = -(\Gamma(1/3)3^{1/3})^{-1}` define `Ai(x)`. |
602 | | The initial conditions `Bi(0) = 3^{1/2}Ai(0)`, |
603 | | `Bi'(0) = -3^{1/2}Ai'(0)` define `Bi(x)`. |
| 659 | sage: var('x') |
| 660 | sage: airy_ai(x) |
| 661 | airy_ai(x) |
| 662 | sage: airy_bi(x) |
| 663 | airy_bi(x) |
| 664 | |
| 665 | REFERENCE: |
| 666 | |
| 667 | - Abramowitz and Stegun: Handbook of Mathematical Functions, |
| 668 | http://www.math.sfu.ca/~cbm/aands/ |
| 669 | |
| 670 | - http://en.wikipedia.org/wiki/Airy_function |
| 671 | """ |
| 672 | def __init__(self): |
| 673 | BuiltinFunction.__init__(self, "airy_bi", latex_name=r"\operatorname{Bi}") |
| 674 | def _derivative_(self, x, diff_param=None): return airy_ai_prime(x) |
617 | | - Abramowitz and Stegun: Handbook of Mathematical Functions, |
618 | | http://www.math.sfu.ca/~cbm/aands/ |
619 | | |
620 | | - http://en.wikipedia.org/wiki/Airy_function |
621 | | """ |
622 | | _init() |
623 | | return RDF(meval("airy_ai(%s)"%RDF(x))) |
624 | | |
625 | | def airy_bi(x): |
626 | | r""" |
627 | | The function `Ai(x)` and the related function `Bi(x)`, |
628 | | which is also called an *Airy function*, are |
629 | | solutions to the differential equation |
630 | | |
631 | | .. math:: |
632 | | |
633 | | y'' - xy = 0, |
634 | | |
635 | | known as the *Airy equation*. The initial conditions |
636 | | `Ai(0) = (\Gamma(2/3)3^{2/3})^{-1}`, |
637 | | `Ai'(0) = -(\Gamma(1/3)3^{1/3})^{-1}` define `Ai(x)`. |
638 | | The initial conditions `Bi(0) = 3^{1/2}Ai(0)`, |
639 | | `Bi'(0) = -3^{1/2}Ai'(0)` define `Bi(x)`. |
640 | | |
641 | | They are named after the British astronomer George Biddell Airy. |
642 | | They belong to the class of "Bessel functions of fractional order". |
643 | | |
644 | | EXAMPLES:: |
645 | | |
646 | | sage: airy_ai(1) # last few digits are random |
647 | | 0.135292416312881400 |
648 | | sage: airy_bi(1) # last few digits are random |
649 | | 1.20742359495287099 |
650 | | |
651 | | REFERENCE: |
652 | | |
653 | | - Abramowitz and Stegun: Handbook of Mathematical Functions, |
654 | | http://www.math.sfu.ca/~cbm/aands/ |
655 | | |
656 | | - http://en.wikipedia.org/wiki/Airy_function |
657 | | """ |
658 | | _init() |
659 | | return RDF(meval("airy_bi(%s)"%RDF(x))) |
660 | | |
| 695 | class AiryBiPrime(BuiltinFunction): |
| 696 | r""" |
| 697 | The derivative of the Airy function `Bi(x)`. |
| 698 | """ |
| 699 | def __init__(self): |
| 700 | BuiltinFunction.__init__(self, "airy_bi_prime", latex_name=r"\operatorname{Bi}'") |
| 701 | airy_bi_prime=AiryBiPrime() |