+
    åûjš   ã                   ó|   € ^ RI HtHtHt ^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt  ! R R	]4      tR
# )é    )ÚSÚooÚdiff)ÚDefinedFunctionÚArgumentIndexError)Ú	fuzzy_not)ÚEq)Úim)Ú	Piecewise)Ú	Heavisidec                   óf   a € ] tR t^t o RtRtRR lt]R 4       tR t	R t
R tRR	 lt]
t]
tR
tV tR# )ÚSingularityFunctionau  
Singularity functions are a class of discontinuous functions.

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

Singularity functions take a variable, an offset, and an exponent as
arguments. These functions are represented using Macaulay brackets as:

SingularityFunction(x, a, n) := <x - a>^n

The singularity function will automatically evaluate to
``Derivative(DiracDelta(x - a), x, -n - 1)`` if ``n < 0``
and ``(x - a)**n*Heaviside(x - a, 1)`` if ``n >= 0``.

Examples
========

>>> from sympy import SingularityFunction, diff, Piecewise, DiracDelta, Heaviside, Symbol
>>> from sympy.abc import x, a, n
>>> SingularityFunction(x, a, n)
SingularityFunction(x, a, n)
>>> y = Symbol('y', positive=True)
>>> n = Symbol('n', nonnegative=True)
>>> SingularityFunction(y, -10, n)
(y + 10)**n
>>> y = Symbol('y', negative=True)
>>> SingularityFunction(y, 10, n)
0
>>> SingularityFunction(x, 4, -1).subs(x, 4)
oo
>>> SingularityFunction(x, 10, -2).subs(x, 10)
oo
>>> SingularityFunction(4, 1, 5)
243
>>> diff(SingularityFunction(x, 1, 5) + SingularityFunction(x, 1, 4), x)
4*SingularityFunction(x, 1, 3) + 5*SingularityFunction(x, 1, 4)
>>> diff(SingularityFunction(x, 4, 0), x, 2)
SingularityFunction(x, 4, -2)
>>> SingularityFunction(x, 4, 5).rewrite(Piecewise)
Piecewise(((x - 4)**5, x >= 4), (0, True))
>>> expr = SingularityFunction(x, a, n)
>>> y = Symbol('y', positive=True)
>>> n = Symbol('n', nonnegative=True)
>>> expr.subs({x: y, a: -10, n: n})
(y + 10)**n

The methods ``rewrite(DiracDelta)``, ``rewrite(Heaviside)``, and
``rewrite('HeavisideDiracDelta')`` returns the same output. One can use any
of these methods according to their choice.

>>> expr = SingularityFunction(x, 4, 5) + SingularityFunction(x, -3, -1) - SingularityFunction(x, 0, -2)
>>> expr.rewrite(Heaviside)
(x - 4)**5*Heaviside(x - 4, 1) + DiracDelta(x + 3) - DiracDelta(x, 1)
>>> expr.rewrite(DiracDelta)
(x - 4)**5*Heaviside(x - 4, 1) + DiracDelta(x + 3) - DiracDelta(x, 1)
>>> expr.rewrite('HeavisideDiracDelta')
(x - 4)**5*Heaviside(x - 4, 1) + DiracDelta(x + 3) - DiracDelta(x, 1)

See Also
========

DiracDelta, Heaviside

References
==========

.. [1] https://en.wikipedia.org/wiki/Singularity_function

Tc                óN  € V^8X  d•   V P                   w  r#pV\        P                  \        P                  \        R4      \        R4      39   d   V P	                  W#V^,
          4      # VP
                  '       d    W@P	                  W#V^,
          4      ,          # R# \        W4      h)aû  
Returns the first derivative of a DiracDelta Function.

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

The difference between ``diff()`` and ``fdiff()`` is: ``diff()`` is the
user-level function and ``fdiff()`` is an object method. ``fdiff()`` is
a convenience method available in the ``Function`` class. It returns
the derivative of the function without considering the chain rule.
``diff(function, x)`` calls ``Function._eval_derivative`` which in turn
calls ``fdiff()`` internally to compute the derivative of the function.

Néþÿÿÿéýÿÿÿ)Úargsr   ÚZeroÚNegativeOneÚfuncÚis_positiver   )ÚselfÚargindexÚxÚaÚns   &&   ÚiC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\sympy\functions\special\singularity_functions.pyÚfdiffÚSingularityFunction.fdiffX   s�   € ð  �qŒ=Ø—i‘i‰GˆA�!Ø”Q—V‘VœQŸ]™]¬A¨b«E´1°R³5Ð9Ô9Ø—y‘y  q¨¥sÓ+Ð+Ø——�ØŸ™ 1¨¨1­Ó-Õ-Ð-ñ ô % TÓ4Ð4ó    c                óR  € TpTpTpWE,
          p\        \        V4      P                  4      '       d   \        R4      h\        \        V4      P                  4      '       d   \        R4      hV\        P
                  J g   V\        P
                  J d   \        P
                  # V^,           P                  '       d   \        R4      hVP                  '       d   \        P                  # VP                  '       dD   VP                  '       d   \        P                  V,          # VP                  '       d	   Wv,          # V\        P                  RRR39   dO   VP                  '       g   VP                  '       d   \        P                  # VP                  '       d   \        # R# R# )a@  
Returns a simplified form or a value of Singularity Function depending
on the argument passed by the object.

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

The ``eval()`` method is automatically called when the
``SingularityFunction`` class is about to be instantiated and it
returns either some simplified instance or the unevaluated instance
depending on the argument passed. In other words, ``eval()`` method is
not needed to be called explicitly, it is being called and evaluated
once the object is called.

Examples
========

>>> from sympy import SingularityFunction, Symbol, nan
>>> from sympy.abc import x, a, n
>>> SingularityFunction(x, a, n)
SingularityFunction(x, a, n)
>>> SingularityFunction(5, 3, 2)
4
>>> SingularityFunction(x, a, nan)
nan
>>> SingularityFunction(x, 3, 0).subs(x, 3)
1
>>> SingularityFunction(4, 1, 5)
243
>>> x = Symbol('x', positive = True)
>>> a = Symbol('a', negative = True)
>>> n = Symbol('n', nonnegative = True)
>>> SingularityFunction(x, a, n)
(-a + x)**n
>>> x = Symbol('x', negative = True)
>>> a = Symbol('a', positive = True)
>>> SingularityFunction(x, a, n)
0

z8Singularity Functions are defined only for Real Numbers.z>Singularity Functions are not defined for imaginary exponents.zASingularity Functions are not defined for exponents less than -4.Nr   r   éüÿÿÿ)r   r
   Úis_zeroÚ
ValueErrorr   ÚNaNÚis_negativeÚis_extended_negativer   Úis_nonnegativeÚis_extended_nonnegativer   Úis_extended_positiver   )ÚclsÚvariableÚoffsetÚexponentr   r   r   Úshifts   &&&&    r   ÚevalÚSingularityFunction.evalq   s-  € ðV ˆØˆØˆØ•ˆä”R˜“Y×&Ñ&×'Ò'ÜÐWÓXÐXÜ”R˜“U—]‘]×#Ò#ÜÐ]Ó^Ð^Ø”A—E‘E‹>˜Q¤!§%¡%›ZÜ—5‘5ˆLØ��E××ÐÜÐ`ÓaÐaØ×%×%Ð%Ü—6‘6ˆMØ××ÐØ�}�}ˆ}Ü—v‘v˜q•yÐ Ø×,×,Ð,Ø•x�Ø”—‘  B¨Ð+Ô+Ø× × Ð  E×$>×$>Ð$>Ü—v‘v�Ø�}�}ˆ}Ü�	ñ ñ ,r   c                ó<  € V P                   w  r4pV\        P                  \        R4      \        R4      \        R4      39   d#   \        \        \        W4,
          ^ 4      3R4      # VP                  '       d%   \        W4,
          V,          W4,
          ^ 8¬  3R4      # R# )zF
Converts a Singularity Function expression into its Piecewise form.

Nr   r   r!   )r   T)r   r   r   r   r   r	   r'   ©r   r   Úkwargsr   r   r   s   &*,   r   Ú_eval_rewrite_as_PiecewiseÚ.SingularityFunction._eval_rewrite_as_Piecewise¶   s{   € ð
 —)‘)‰ˆˆaà”—‘¤ "£¤q¨£u¬a°«eÐ4Ô4Üœb¤" Q¥U¨A£,Ð/°Ó;Ð;Ø××ÐÜ˜q�u q�j¨!­%°1©*Ð5°yÓAÐAñ r   c                ól  € V P                   w  r4pVR8X  d5   \        \        W4,
          4      VP                  P	                  4       ^4      # VR8X  d5   \        \        W4,
          4      VP                  P	                  4       ^4      # VR8X  d5   \        \        W4,
          4      VP                  P	                  4       ^4      # VR8X  d5   \        \        W4,
          4      VP                  P	                  4       ^4      # VP
                  '       d'   W4,
          V,          \        W4,
          ^4      ,          # R# )zO
Rewrites a Singularity Function expression using Heavisides and DiracDeltas.

Nr!   r   r   éÿÿÿÿ)r   r   r   Úfree_symbolsÚpopr'   r2   s   &*,   r   Ú_eval_rewrite_as_HeavisideÚ.SingularityFunction._eval_rewrite_as_HeavisideÂ   sä   € ð
 —)‘)‰ˆˆaà�Œ7Üœ	 !¥%Ó(¨!¯.©.×*<Ñ*<Ó*>ÀÓBÐBØ�Œ7Üœ	 !¥%Ó(¨!¯.©.×*<Ñ*<Ó*>ÀÓBÐBØ�Œ7Üœ	 !¥%Ó(¨!¯.©.×*<Ñ*<Ó*>ÀÓBÐBØ�Œ7Üœ	 !¥%Ó(¨!¯.©.×*<Ñ*<Ó*>ÀÓBÐBØ××ÐØ•E˜A•:œi¨­¨qÓ1Õ1Ð1ñ r   c                óh  € V P                   w  rEpWE,
          P                  V^ 4      pV^ 8  d   \        P                  # VP                  '       d:   VP                  '       d(   VR8X  d   \        P                  # \        P
                  # VP                  '       d	   Wv,          # \        P                  # )r   r7   )r   Úsubsr   r   r"   ÚOner   )r   r   ÚlogxÚcdirÚzr   r   r.   s   &&&&    r   Ú_eval_as_leading_termÚ)SingularityFunction._eval_as_leading_termÔ   sw   € Ø—)‘)‰ˆˆaØ•—‘˜Q Ó"ˆØˆqŒ5Ü—6‘6ˆMØ�Y�YˆY˜5Ÿ=Ÿ=˜=Ø! RœZ”1—6‘6Ð2¬Q¯U©UÐ2Ø××ÐØ•8ˆOÜ�v‰vˆr   Nc                ó˜  € V P                   w  rVpWV,
          P                  V^ 4      pV^ 8  d   \        P                  # VP                  '       d:   VP                  '       d(   VR8X  d   \        P                  # \        P
                  # VP                  '       d!   WV,
          V,          P                  WW4R7      # \        P                  # )r   )r?   r@   r7   )r   r=   r   r   r"   r>   r   Ú_eval_nseries)r   r   r   r?   r@   rA   r   r.   s   &&&&&   r   rE   Ú!SingularityFunction._eval_nseriesß   sŒ   € Ø—)‘)‰ˆˆaØ•—‘˜Q Ó"ˆØˆqŒ5Ü—6‘6ˆMØ�Y�YˆY˜5Ÿ=Ÿ=˜=Ø! RœZ”1—6‘6Ð2¬Q¯U©UÐ2Ø××ÐØ•U˜Q•J×-Ñ-¨a¸Ð-ÓIÐIÜ�v‰vˆr   © )é   )Nr   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úis_realr   Úclassmethodr/   r4   r:   rB   rE   Ú_eval_rewrite_as_DiracDeltaÚ$_eval_rewrite_as_HeavisideDiracDeltaÚ__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r      sR   ø‡ € ñEðN €Gô5ð2 ñBó ðBòH
Bò2ò$	ô	ð #=ÐØ+EÖ(r   r   N)Ú
sympy.corer   r   r   Úsympy.core.functionr   r   Úsympy.core.logicr   Úsympy.core.relationalr	   Ú$sympy.functions.elementary.complexesr
   Ú$sympy.functions.elementary.piecewiser   Ú'sympy.functions.special.delta_functionsr   r   rG   r   r   Ú<module>r\      s-   ðß "Ñ "ß CÝ &Ý $Ý 3Ý :Ý =ô]F˜/ö ]Fr   