
    g                         d Z ddlmZmZ ddlmZ ddlmZmZ  G d de          Z	 G d de	          Z
 G d	 d
e	          Z G d de	          Z G d de	          ZdS )z- This module contains the Mathieu functions.
    )FunctionArgumentIndexError)sqrt)sincosc                       e Zd ZdZdZd ZdS )MathieuBasezj
    Abstract base class for Mathieu functions.

    This class is meant to reduce code duplication.

    Tc                     | j         \  }}}|                     |                                |                                |                                          S N)argsfunc	conjugate)selfaqzs       e/var/www/html/ai-engine/env/lib/python3.11/site-packages/sympy/functions/special/mathieu_functions.py_eval_conjugatezMathieuBase._eval_conjugate   s=    )1ayyq{{}}EEE    N)__name__
__module____qualname____doc__
unbranchedr    r   r   r	   r	   	   s9          JF F F F Fr   r	   c                   0    e Zd ZdZddZed             ZdS )mathieusa  
    The Mathieu Sine function $S(a,q,z)$.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Cosine function.

    Examples
    ========

    >>> from sympy import diff, mathieus
    >>> from sympy.abc import a, q, z

    >>> mathieus(a, q, z)
    mathieus(a, q, z)

    >>> mathieus(a, 0, z)
    sin(sqrt(a)*z)

    >>> diff(mathieus(a, q, z), z)
    mathieusprime(a, q, z)

    See Also
    ========

    mathieuc: Mathieu cosine function.
    mathieusprime: Derivative of Mathieu sine function.
    mathieucprime: Derivative of Mathieu cosine function.

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuS/

       c                 f    |dk    r| j         \  }}}t          |||          S t          | |          N   )r   mathieusprimer   r   argindexr   r   r   s        r   fdiffzmathieus.fdiffF   :    q==iGAq! Aq)))$T8444r   c                     |j         r&|j        rt          t          |          |z            S |                                r | |||            S d S r   )	is_Numberis_zeror   r   could_extract_minus_signclsr   r   r   s       r   evalzmathieus.evalM   s_    ; 	"19 	"tAwwqy>>!%%'' 	"C1qbMM>!	" 	"r   Nr   r   r   r   r   r%   classmethodr-   r   r   r   r   r      N        + +Z5 5 5 5 " " [" " "r   r   c                   0    e Zd ZdZddZed             ZdS )mathieuca  
    The Mathieu Cosine function $C(a,q,z)$.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Sine function.

    Examples
    ========

    >>> from sympy import diff, mathieuc
    >>> from sympy.abc import a, q, z

    >>> mathieuc(a, q, z)
    mathieuc(a, q, z)

    >>> mathieuc(a, 0, z)
    cos(sqrt(a)*z)

    >>> diff(mathieuc(a, q, z), z)
    mathieucprime(a, q, z)

    See Also
    ========

    mathieus: Mathieu sine function
    mathieusprime: Derivative of Mathieu sine function
    mathieucprime: Derivative of Mathieu cosine function

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuC/

    r   c                 f    |dk    r| j         \  }}}t          |||          S t          | |          r    )r   mathieucprimer   r#   s        r   r%   zmathieuc.fdiff   r&   r   c                     |j         r&|j        rt          t          |          |z            S |                                r | |||           S d S r   )r(   r)   r   r   r*   r+   s       r   r-   zmathieuc.eval   s]    ; 	"19 	"tAwwqy>>!%%'' 	!3q!aR== 	! 	!r   Nr.   r/   r   r   r   r3   r3   V   N        + +Z5 5 5 5 ! ! [! ! !r   r3   c                   0    e Zd ZdZddZed             ZdS )r"   a"  
    The derivative $S^{\prime}(a,q,z)$ of the Mathieu Sine function.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Cosine function.

    Examples
    ========

    >>> from sympy import diff, mathieusprime
    >>> from sympy.abc import a, q, z

    >>> mathieusprime(a, q, z)
    mathieusprime(a, q, z)

    >>> mathieusprime(a, 0, z)
    sqrt(a)*cos(sqrt(a)*z)

    >>> diff(mathieusprime(a, q, z), z)
    (-a + 2*q*cos(2*z))*mathieus(a, q, z)

    See Also
    ========

    mathieus: Mathieu sine function
    mathieuc: Mathieu cosine function
    mathieucprime: Derivative of Mathieu cosine function

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuSPrime/

    r   c                     |dk    r8| j         \  }}}d|z  t          d|z            z  |z
  t          |||          z  S t          | |          Nr!      )r   r   r   r   r#   s        r   r%   zmathieusprime.fdiff   V    q==iGAq!aCAaCL1$hq!Q&7&777$T8444r   c                     |j         r6|j        r/t          |          t          t          |          |z            z  S |                                r | |||           S d S r   )r(   r)   r   r   r*   r+   s       r   r-   zmathieusprime.eval   sh    ; 	*19 	*773tAwwqy>>))%%'' 	!3q!aR== 	! 	!r   Nr.   r/   r   r   r   r"   r"      r7   r   r"   c                   0    e Zd ZdZddZed             ZdS )r5   a!  
    The derivative $C^{\prime}(a,q,z)$ of the Mathieu Cosine function.

    Explanation
    ===========

    This function is one solution of the Mathieu differential equation:

    .. math ::
        y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0

    The other solution is the Mathieu Sine function.

    Examples
    ========

    >>> from sympy import diff, mathieucprime
    >>> from sympy.abc import a, q, z

    >>> mathieucprime(a, q, z)
    mathieucprime(a, q, z)

    >>> mathieucprime(a, 0, z)
    -sqrt(a)*sin(sqrt(a)*z)

    >>> diff(mathieucprime(a, q, z), z)
    (-a + 2*q*cos(2*z))*mathieuc(a, q, z)

    See Also
    ========

    mathieus: Mathieu sine function
    mathieuc: Mathieu cosine function
    mathieusprime: Derivative of Mathieu sine function

    References
    ==========

    .. [1] https://en.wikipedia.org/wiki/Mathieu_function
    .. [2] https://dlmf.nist.gov/28
    .. [3] https://mathworld.wolfram.com/MathieuFunction.html
    .. [4] https://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuCPrime/

    r   c                     |dk    r8| j         \  }}}d|z  t          d|z            z  |z
  t          |||          z  S t          | |          r:   )r   r   r3   r   r#   s        r   r%   zmathieucprime.fdiff   r<   r   c                     |j         r7|j        r0t          |           t          t          |          |z            z  S |                                r | |||            S d S r   )r(   r)   r   r   r*   r+   s       r   r-   zmathieucprime.eval  sl    ; 	+19 	+GG8CQ	NN**%%'' 	"C1qbMM>!	" 	"r   Nr.   r/   r   r   r   r5   r5      r1   r   r5   N)r   sympy.core.functionr   r   (sympy.functions.elementary.miscellaneousr   (sympy.functions.elementary.trigonometricr   r   r	   r   r3   r"   r5   r   r   r   <module>rD      s:    = < < < < < < < 9 9 9 9 9 9 = = = = = = = =F F F F F( F F F;" ;" ;" ;" ;"{ ;" ;" ;"|;! ;! ;! ;! ;!{ ;! ;! ;!|;! ;! ;! ;! ;!K ;! ;! ;!|;" ;" ;" ;" ;"K ;" ;" ;" ;" ;"r   