+
    iS                       R t ^ RIt^ RIt^ RIHtHtHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHtHtHtHtHtHtHtHtHtHt ^ RIHtHt ^ RIHtHtHtHtH t H!t!H"t"H#t# ^ R	I$H%t% ^ R
I&H't'H(t(H)t) ^ RI*H+t+H,t,H-t-H.t.H/t/H0t0 ^ RI1H2t2H3t3 ^ RI4H5t5H6t6H7t7H8t8 ^ RI9H:t:H;t;H<t< ^ RI=H>t>H?t? ^ RI@HAtAHBtBHCtCHDtD ^ RIEHFtFHGtGHHtHHItI ^ RIJHKtKHLtL ^ RIMHNtNHOtOHPtP ^ RIQHRtRHStSHTtTHUtU ^ RIVHWtW ^ RIXHYtYHZtZ ^ RI[H\t\H]t]H^t^ ^ RI_H`t`HataHbtbHctcHdtd ^ RIeHftf ^ RIgHhth ^ RIiHjtj ^ RIkHltl ^ RImHntn ^ RIoHptp ^ RIqHrtr ^ R IsHtttHutuHvtv ^ R!IwHxtx ^ syR" tzR# t{R$ t|]zR% 4       t}]zR& 4       t~]zR' 4       t]
R( 4       t]zR) 4       t]zR* 4       t]zR+ 4       t]zR, 4       t]zR- 4       t]zR. 4       t]zR/ 4       t]zR0 4       t]zR1 4       t]zR2 4       t]zR3 4       t]zR4 4       t]zR5 4       t]zR6 4       tR7 tR8 t]zR9 4       t ! R: R;]]4      tROR< lt]zR= 4       t]zR> 4       t]
R? 4       t]zR@ 4       t]zRA 4       t]zRB 4       t]zRC 4       t]zRD 4       t]zRE 4       t]zRF 4       t]zRG 4       t]zRH 4       t]zRI 4       t]zRJ 4       t ! RK RL]]4      tRPRM ltRN tR# )QzLaplace TransformsN)SpiI)Add)cacheit)Expr)
AppliedUndef
Derivativeexpandexpand_complex
expand_mulexpand_trigLambdaWildFunctiondiffSubs)Mulprod)
_canonicalGeGtLt
UnequalityEqNe
Relational)ordered)DummysymbolsWild)reimargAbs
polar_liftperiodic_argument)explog)coshcothsinhasinh)MaxMinsqrt)	Piecewisepiecewise_exclusive)cossinatansinc)besselibesseljbesselkbessely)
DiracDelta	Heaviside)erferfcEi)digammagamma
lowergamma
uppergamma)SingularityFunction)	integrateIntegral)	_simplifyIntegralTransformIntegralTransformError)to_cnf	conjuncts	disjunctsOrAnd)
MatrixBase)_lin_eq2dict)PolynomialError)roots)Poly)together)RootSum)sympy_deprecation_warningSymPyDeprecationWarningignore_warnings)debugfc                    a  V 3R  lpV# )c                    < ^ RI Hp V'       g	   S! V / VB # \        ^ 8X  d   \        R\        P
                  R7       \        RR\        ,          : SP                  : V : 2\        P
                  R7       \        ^,          sSP                  R8X  g   SP                  R8X  dM   R\         n        \        RR\        ,          ,          \        P
                  R7       S! V / VB pR	\         n        MS! V / VB p\        ^,          s\        RR\        ,          : R
V: 2\        P
                  R7       \        ^ 8X  d   \        R\        P
                  R7       V# )    SYMPY_DEBUGfile-LT-   _laplace_transform_integration&_inverse_laplace_transform_integrationFz**** %sIntegrating ...Tz---> zO
------------------------------------------------------------------------------zO------------------------------------------------------------------------------
)sympyr\   	_LT_levelprintsysstderr__name__)argskwargsr\   resultfuncs   *,  w/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/sympy/integrals/laplace.pywrapDEBUG_WRAP.<locals>.wrap1   s    % (((>-cjj1tI~t}}dC::	Q	!AA!II %E*d9n=CJJO4*6*F $E4*6*FQ	$y..&9

K>-cjj1     )rl   rn   s   f rm   
DEBUG_WRAPrr   0   s    4 Krp   c                     ^ RI Hp V'       d0   \        RR\        ,          : V : 2\        P
                  R7       R# R# )rZ   r[   r_   r`   r]   N)rc   r\   re   rd   rf   rg   )textr\   s   & rm   _debugru   N   s$    !T)^T2D rp   c                   aaaaa V3R loVVVV3R loV3R loV3R lpR p^ RI Hp V! V 4      p V! V \        S4      p V! V \        V3R l4      p V! V \        V4      p \        V 4      # )a  
Naively simplify some conditions occurring in ``expr``,
given that `\operatorname{Re}(s) > a`.

Examples
========

>>> from sympy.integrals.laplace import _simplifyconds
>>> from sympy.abc import x
>>> from sympy import sympify as S
>>> _simplifyconds(abs(x**2) < 1, x, 1)
False
>>> _simplifyconds(abs(x**2) < 1, x, 2)
False
>>> _simplifyconds(abs(x**2) < 1, x, 0)
Abs(x**2) < 1
>>> _simplifyconds(abs(1/x**2) < 1, x, 1)
True
>>> _simplifyconds(S(1) < abs(x), x, 1)
True
>>> _simplifyconds(S(1) < abs(1/x), x, 1)
False

>>> from sympy import Ne
>>> _simplifyconds(Ne(1, x**3), x, 1)
True
>>> _simplifyconds(Ne(1, x**3), x, 2)
True
>>> _simplifyconds(Ne(1, x**3), x, 0)
Ne(1, x**3)
c                 x   < V S8X  d   ^# V P                   '       d   V P                  S8X  d   V P                  # R# )   N)is_Powbaser&   )exss   &rm   power_simplifyconds.<locals>.powerv   s,    7999A66Mrp   c                  < V P                  S4      '       d   VP                  S4      '       d   R# \        V \        4      '       d   V P                  ^ ,          p \        V\        4      '       d   VP                  ^ ,          pV P                  S4      '       d   S! ^V,          ^V ,          4      # S! V4      pVf   R#  V^ 8  d4   \        V 4      \        S4      V,          8*  \        P
                  8X  d   R# V^ 8  d6   \        V 4      \        S4      V,          8  \        P
                  8X  d   R# R# R#   \         d     R# i ; i)zRReturn True only if |ex1| > |ex2|, False only if |ex1| < |ex2|.
Else return None. NFT)has
isinstancer#   ri   r   true	TypeError)ex1ex2nabiggerr}   r|   s   && rm   r   _simplifyconds.<locals>.bigger}   s     771::#''!**c3((1+Cc3((1+C771::!C%3''#J9	1u#c(c!fai/AFF:1u#c(c!fai/AFF: ;u 		s   8D9 ;8D9 9EEc                   < V P                   '       g   \        V \        4      '       d)   VP                   '       g   \        V\        4      '       g   W8  # S! W4      pVe   V'       * # W8  # )zsimplify x < y )is_positiver   r#   )xyrr   s   && rm   replie_simplifyconds.<locals>.replie   sP    *Q"4"4As););EN1L=5Lrp   c                 <   < S! W4      pVR9   d   R # \        W4      # T)TF)r   )r   r   br   s   && rm   replue_simplifyconds.<locals>.replue   s"    1L!rp   c                 F    V R9   d   \        V 4      # V P                  ! V!  # r   )boolreplace)r{   ri   s   &*rm   repl_simplifyconds.<locals>.repl   s"    8Ozz4  rp   )collect_absc                    < S! W4      # Nrq   )r   r   r   s   &&rm   <lambda> _simplifyconds.<locals>.<lambda>   s	    va|rp   )sympy.simplify.radsimpr   r   r   r   r   )	exprr|   r   r   r   r   r   r}   r   s	   &ff   @@@rm   _simplifycondsr   U   se    B , !
 3tDb&!Db34Dj&)DT7Nrp   c                >    \        W P                  \        4      4      # )zg
Expand an expression involving DiractDelta to get it as a linear
combination of DiracDelta functions.
)rN   atomsr9   r   s   &rm   expand_dirac_deltar      s     jj455rp   c                 aaaa \        R4      oV P                  \        4      '       d   R# \        V \	        S) S,          4      ,          S\
        P                  \
        P                  34      pVP                  \        4      '       g<   \        VP                  SS4      V4      \
        P                  \
        P                  3# VP                  '       g   R# VP                  ^ ,          w  rEVP                  \        4      '       d   R# VV3R lp\        V4       Uu. uF
  qv! V4      NK  	  ppV U	u. uF?  q^,          \
        P                   8w  g   K   V	^ ,          \
        P                  Jg   K=  V	NKA  	  p
p	V
'       g/   V U	u. uF"  q^,          \
        P                   8w  g   K   V	NK$  	  p
p	\#        \%        V
4      4      pR oVP'                  V3R lR7       V'       g   R# V^ ,          w  rVV3R lpV'       d   \)        VSV4      p\)        VSV4      p\        VP                  SS4      V4      V! V4      \+        V! V4      4      3# u upi u up	i u up	i )zThe backend function for doing Laplace transforms by integration.

This backend assumes that the frontend has already split sums
such that `f` is to an addition anymore.
r|   Nc                8  <a ^ RI Hp \        P                  p\        P                  p\        \        V 4      4      p \        R\        S.R7      w  rErgrp
V\        \        SV,           V,          4      4      ,          V8  V\        \        SV,           V,          4      4      ,          V8*  \        \        SV,           V,          V,          V4      4      V8  \        \        SV,           V,          V,          V4      4      V8*  \        \        \        SV,           4      V,          V,          V4      4      V8  \        \        \        SV,           4      V,          V,          V4      4      V8*  3pV  EF  p\        P                  p. p\        V4       EF  pVP                  '       d(   SVP                   P"                  9   d   VP$                  pVP                  '       d)   \'        V\(        \*        34      '       d   VP,                  pV F  pVP/                  V4      oS'       g   K   M	  S'       d^   SV,          P0                  '       dE   SV,          SV,          ,          \2        ^,          8X  d   \5        SSV,          ,           4      ) ^ 8  pVP/                  V\7        V\        \        SV
,          4      4      ,          V,          4      \        SV,          4      V	,          ,          ,
          ^ 8  4      oS'       gk   VP/                  \7        V\        \        SV,          V
,          V4      4      V,          ,
          4      \        SV,          4      V	,          ,          ^ 8  4      oS'       gt   VP/                  V\7        \        \        \        S4      V,          V
,          V4      4      V,          4      \        SV,          4      V	,          ,          ,
          ^ 8  4      oS'       d\   \8        ;QJ d"    V3R lWgWV
3 4       F  '       d   K   RM	  RM! V3R lWgWV
3 4       4      '       d   \5        S4      SV,          8  pVP;                  \4        R 4      P=                  \5        S4      S4      pVP                  '       d@   VP>                  R	9   g/   VPA                  S4      '       g   VPA                  S4      '       g   W.,          pEKF  V! VS4      pVP                  '       d   VP>                  R	9   d   W.,          pEK~  VPB                  S8X  d     R# \E        VPB                  V4      pEK  	  V\        P                  Jd   \G        W4      pEK  \I        V\K        V!  4      pEK  	  Y#P                  '       d   VPL                  3# T3# )
z6Turn ``conds`` into a strip and auxiliary conditions. _solve_inequalityzp q w1 w2 w3 w4 w5clsexcludec              3   J   <"   T F  pSV,          P                   x  K  	  R # 5ir   )r   ).0wildms   & rm   	<genexpr>H_laplace_transform_integration.<locals>.process_conds.<locals>.<genexpr>   s#      - >,TQtW00 >,s    #FTc                 L    V P                  4       P                  4       ^ ,          # rZ   )r
   as_real_imag)r   s   &rm   r   G_laplace_transform_integration.<locals>.process_conds.<locals>.<lambda>   s    !((*"9"9";A">rp   N)z==z!=)'sympy.solvers.inequalitiesr   r   NegativeInfinityr   rI   rH   r   r   r#   r"   r%   r$   InfinityrJ   is_Relationalrhsfree_symbolsreversedr   r   r   reversedsignmatchr   r   r    r1   allr   subsrel_opr   ltsr-   r,   rL   rK   	canonical)condsr   r   auxpqw1w2w3w4w5patternsca_aux_dpatd_solnr   r|   ts   &                  @rm   process_conds5_laplace_transform_integration.<locals>.process_conds   s6   @ff&-(#* dQC$9 bbb c#q2vqj/""R'c#q2vqj/""b(!1r6A+a-45:!1r6A+a-45;!:a"f#5"9!";R@ABF!:a"f#5"9!";R@ARGI ABDq\???qAEE,>,>'>

A???z!b"X'>'>A#CAq $ 1)))aeAaDjBqD.@A"I*AGGABs3qt9~$5b$8 9#ae*b. HH1LMA$5aeBh$B CB FFGArE
B')*+,A C 1*Q-2CB2F JKBN!!R%j"n- -/012A  ->, - ->, - - -1!AYY>@@DRUA  OOOqxx</G66!99BFF1IICKD(Q/)))T[[L-HCKD88q=TXXr*BM "N #J#r4y)[ \ #4#4#4#--==#==rp   c                 4    V R9   d   ^ # V P                  4       # r   )	count_opsr   s   &rm   cnt+_laplace_transform_integration.<locals>.cnt  s    = ~~rp   c                 6   < V ^ ,          ) S! V ^,          4      3# r   rq   )r   r   s   &rm   r   0_laplace_transform_integration.<locals>.<lambda>  s    qteS1Y/rp   keyc                 (   < V P                  SS4      # r   )r   )r   r|   s_s   &rm   sbs+_laplace_transform_integration.<locals>.sbs!  s    yyBrp   )r   r   r9   rC   r&   r   Zeror   rD   rE   r   r   r   is_Piecewiseri   rJ   falselistr   sortr   r   )fr   r   simplifyFcondr   r   r   r   conds2r   r   r   r   r|   s   &ff$          @@rm   ra   ra      s    	c
AuuZ!C1I+1661::67A55??2113E3EqvvMM>>>ffQiGAuuX=>~ (17!]1E7 :AA$gg#aA$a&8&88 aF :"6Udaggo!!U6!E  
JJ/J01XFA 1a#S!Q'QVVAr]H-s1vz#c(7KKK- 8: 7s$    I6II5I	I+Ic                    \        V \        4      '       g   V # V P                  V4      ;pe   VP                  4       # V P                  pV P
                   Uu. uF  p\        WA4      NK  	  ppV! V!  # u upi )z
This is an internal helper function that traverses through the expression
tree of `f(t)` and collects arguments. The purpose of it is that
anything like `f(w*t-1*t-c)` will be written as `f((w-1)*t-c)` such that
it can match `f(a*t+b)`.
)r   r   as_polyas_exprrl   ri   _laplace_deep_collect)r   r   r   rl   r"   ri   s   &&    rm   r   r   )  sk     aYYq\&yy{66D56VV<Vc!#)VD<; =s   A4c                 A  a \        R4      o\        R4      p \        RS.R7      p\        RS.R7      p\        RS.R7      p\        RS.R7      p\        RS.R7      pV3R	 lp\        R
4       . WV ,          \        P                  \        P
                  V3N\        VS,          V,
          4      \        V ) V,          V,          4      \        V4      ,          \        \        V^ 8  V^ 8  4      \        V^ 8  V^ 8*  4      4      \        P                  V3N\        VS,          V,
          4      \        ^ 4      \        \        V^ 8  V^ 8  4      \        V^ 8  V^ 8*  4      4      \        P                  V3N\        VS,          V,
          4      \        V ) V,          V,          4      V ,          \        V^ 8  V^ 8  4      \        P
                  V3N\        VS,          V,
          4      ^\        V ) V,          V,          4      ,
          V ,          \        V^ 8  V^ 8  4      \        P
                  V3N\        VS,          V,
          4      ^V ,          \        V^ 8  V^ 8*  4      \        P
                  V3N\        VS,          V,
          4      ^ \        V^ 8  V^ 8  4      \        P
                  V3NS^V ^,          ,          \        P                  \        P
                  V3N^VS,          V,           ,          \        V) V,          V ,          4      ) \        V) V,          V ,          4      ,          V,          \        \        W!,          4      4      \        8  \        P
                  V3N^\!        VS,          V,           4      ,          \!        V\        ,          V ,          4      \        W!,          V ,          4      ,          \#        \!        W!,          V ,          4      4      ,          V,          \        \        W!,          4      4      \        8  \        P
                  V3NVS,          V,           \        ^4      ) ^,          ,          ^V\        ^4      ) ^,          ,          ,          ^\        V ,          V,          \        ^4      ^,          ,          ,          \        W!,          V ,          4      ,          \#        \!        W!,          V ,          4      4      ,          V,          ,
          \        \        W!,          4      4      \        8  \        P
                  V3N\!        S4      SV,           ,          \!        \        V ,          4      \        \!        V4      ,          \        W ,          4      ,          \#        \!        W ,          4      4      ,          ,
          \        \        V4      4      \        8  \        P
                  V3N^V\!        S4      ,          SR,          ,           ,          \        V\        ^4      ^,          ,          ,          \        W,          4      ,          \#        \!        W,          4      4      ,          \        P                  \        P
                  V3NSV,          \%        V^,           4      W^,           ,          ,          VR8  \        P
                  V3NVS,          V,           V,          \'        V^,           W!,          V ,          4      \        V) V,          V ,          4      ,          W^,           ,          ,          V,          \        VR8  \        \        W!,          4      4      \        8  4      \        P
                  V3NSV,          SV,           ,          W,          \%        V^,           4      ,          \'        V) W,          4      ,          \        VR8  \        \        V4      4      \        8  4      \        P
                  V3N\        VS,          V,
          4      \        V) 4      W,
          ,          \        P                  \)        V4      V3NS\        VS,          V,
          4      ,          \        V) 4      W,
          ^,          ,          \        P                  \)        V4      V3NSV,          \        VS,          4      ,          \%        V^,           4      W,
          V^,           ,          ,          \)        V4      R8  \)        V4      V3N\        V) S^,          ,          4      \!        \        ^,          V,          4      \        V ^,          ^,          V,          4      ,          \#        V \!        ^V,          4      ,          4      ,          \)        V4      ^ 8  \        P
                  V3NS\        V) S^,          ,          4      ,          ^^V,          ,          ^\!        \        4      ,          ^V,          \        ^4      ^,          ,          ,          V ,          \#        V \!        ^V,          4      ,          4      ,          ,
          \)        V4      ^ 8  \        P
                  V3N\        V) S,          4      ^\!        W,          4      ,          \+        ^^\!        W,          4      ,          4      ,          \)        V4      ^ 8  \        P
                  V3N\!        S4      \        V) S,          4      ,          \        ^4      ^,          \!        \        V ^,          ,          4      ,          ^^\!        W,          4      ,          ,           ,          \        R\!        W,          4      ,          4      ,          \)        V4      ^ 8  \        P
                  V3N\        V) S,          4      \!        S4      ,          \!        \        V ,          4      \        R\!        W,          4      ,          4      ,          \)        V4      ^ 8  \        P
                  V3N\        V) S,          4      S\!        S4      ,          ,          \!        \        V,          4      \        R\!        W,          4      ,          4      ,          \)        V4      ^ 8  \        P
                  V3NSV,          \        V) S,          4      ,          ^W,          V^,           ^,          ,          ,          \+        V^,           ^\!        W,          4      ,          4      ,          \)        V4      ^ 8  \        P
                  V3N\        V) \        S) 4      ,          4      W) ,          \-        W4      ,          \        P                  \        P
                  V3N\        V) \        S4      ,          4      W,          \'        V ) V4      ,          \)        V4      ^ 8  \        P
                  V3N\/        VS,          4      \/        \        \        P0                  4      V ,          V,          4      ) V ,          V^ 8  \        P
                  V3N\/        ^VS,          ,           4      \        W,          4      ) V ,          \        V ) V,          4      ,          \        \        V4      4      \        8  \        P
                  V3N\/        VS,          V,           4      \/        V4      \        W,          V,          4      V ,          V,          \        V ) V,          4      ,          ,
          V ,          V,          \        V^ 8  \        \        V4      4      \        8  4      \        P
                  V3N\/        S4      \!        S4      ,          \!        \        V ,          4      ) \/        ^V ,          \        \        P0                  4      ,          4      ,          \        P                  \        P
                  V3NSV,          \/        S4      ,          \%        V^,           4      W) ^,
          ,          ,          \3        V^,           4      \/        V 4      ,
          ,          \)        V4      R8  \        P
                  V3N\/        VS,          4      ^,          \/        \        \        P0                  4      V ,          V,          4      ^,          \        ^,          ^,          ,           V ,          V^ 8  \        P
                  V3N\5        VS,          4      WP^,          V^,          ,           ,          \        P                  \        \7        V4      4      V3N\        \5        VS,          4      4      WP^,          V^,          ,           ,          \9        \        V ,          ^,          V,          4      ,          V^ 8  \        P
                  V3N\5        VS,          4      S,          \;        WP,          4      \        P                  \        \7        V4      4      V3N\5        VS,          4      ^,          S,          \/        ^^V^,          ,          V ^,          ,          ,           4      ^,          \        P                  ^\        \7        V4      4      ,          V3N\5        VS,          4      ^,          S^,          ,          V\;        ^V,          V ,          4      ,          V \/        ^^V^,          ,          V ^,          ,          ,           4      ,          ^,          ,
          \        P                  ^\        \7        V4      4      ,          V3N\=        VS,          4      W ^,          V^,          ,           ,          \        P                  \        \7        V4      4      V3N\=        VS,          4      ^,          V ^,          ^V^,          ,          ,           V ^,          ^V^,          ,          ,           ,          V ,          \        P                  ^\        \7        V4      4      ,          V3N\5        VS,          4      \5        VS,          4      ,          ^V,          V,          V ,          V ^,          W,           ^,          ,           ,          V ^,          W,
          ^,          ,           ,          \        P                  \        \7        V4      4      \        \7        V4      4      ,           V3N\=        VS,          4      \5        VS,          4      ,          W ^,          V^,          ,
          V^,          ,           ,          V ^,          W,           ^,          ,           ,          V ^,          W,
          ^,          ,           ,          \        P                  \        \7        V4      4      \        \7        V4      4      ,           V3N\=        VS,          4      \=        VS,          4      ,          W ^,          V^,          ,           V^,          ,           ,          V ^,          W,           ^,          ,           ,          V ^,          W,
          ^,          ,           ,          \        P                  \        \7        V4      4      \        \7        V4      4      ,           V3N\?        VS,          4      W^,          V^,          ,
          ,          \        P                  \        \)        V4      4      V3N\A        VS,          4      W ^,          V^,          ,
          ,          \        P                  \        \)        V4      4      V3N\?        VS,          4      ^,          ^V^,          ,          V ^,          ^V^,          ,          V ,          ,
          ,          \        P                  ^\        \)        V4      4      ,          V3N\A        VS,          4      ^,          V ^,          ^V^,          ,          ,
          V ^,          ^V^,          ,          V ,          ,
          ,          \        P                  ^\        \)        V4      4      ,          V3N\?        VS,          4      S,          \/        W,           W,
          ,          4      ^,          \        P                  \        \)        V4      4      V3NSV,          \?        VS,          4      ,          \%        V^,           4      ^,          W,
          V) ^,
          ,          W,           V) ^,
          ,          ,
          ,          VR8  \        V4      V3NSV,          \A        VS,          4      ,          \%        V^,           4      ^,          W,
          V) ^,
          ,          W,           V) ^,
          ,          ,           ,          VR8  \        V4      V3N\C        VS,          4      \        V ^,          ^V,          ^,          ,          4      \#        V ^V,          ,          4      ,          V ,          ^\        \        V4      4      ,          \        8  \        P
                  V3N\E        W1S,          4      W,          \!        V ^,          V^,          ,           4      V \!        V ^,          V^,          ,           4      ,           V,          ,          ,          \)        V4      R8  \        \7        V4      4      V3NSV,          \E        W1S,          4      ,          ^V,          \!        \        4      ,          \%        V\        PF                  ,           4      ,          W,          ,          V ^,          V^,          ,           V) \        PF                  ,
          ,          ,          \        \)        V4      \        PF                  ) 8  \I        W#4      4      \        \7        V4      4      V3NSV,          \E        W1S,          4      ,          ^V^,           ,          \!        \        4      ,          \%        V\        ^4      ^,          ,           4      ,          W,          ,          V ,          V ^,          V^,          ,           V) \        ^4      ^,          ,
          ,          ,          \        \)        V4      R8  \I        W#^,           4      4      \        \7        V4      4      V3N\E        ^ V\!        S^,          VS,          ,           4      ,          4      \        W ,          V\!        V ^,          V^,          ,           4      ,          ,
          4      \!        V ^,          V^,          ,           4      ,          \        \        V4      4      \        8  \        \7        V4      4      V3N\K        W1S,          4      W,          \!        V ^,          V^,          ,
          4      V \!        V ^,          V^,          ,
          4      ,           V,          ,          ,          \)        V4      R8  \        \)        V4      4      V3NSV,          \K        W1S,          4      ,          ^V,          \!        \        4      ,          \%        V\        PF                  ,           4      ,          W,          ,          V ^,          V^,          ,
          V) \        PF                  ,
          ,          ,          \        \)        V4      \        PF                  ) 8  \I        W#4      4      \        \)        V4      4      V3NSV,          \K        W1S,          4      ,          ^V^,           ,          \!        \        4      ,          \%        V\        ^4      ^,          ,           4      ,          W,          ,          V ,          V ^,          V^,          ,
          V) \        ^4      ^,          ,
          ,          ,          \        \)        V4      R8  \I        W#^,           4      4      \        \)        V4      4      V3N\M        ^ VS,          4      R\        ,          \O        W,          4      ,          \!        V ^,          V^,          ,           4      ,          \        P                  \        \7        V4      4      V3N\+        ^ VS,          4      \/        V \!        V ^,          V^,          ,
          4      ,           V,          4      \!        V ^,          V^,          ,
          4      ,          \        P                  \)        V4      ) V3NpVSV 3# )a%  
This is an internal helper function that returns the table of Laplace
transform rules in terms of the time variable `t` and the frequency
variable `s`.  It is used by ``_laplace_apply_rules``.  Each entry is a
tuple containing:

    (time domain pattern,
     frequency-domain replacement,
     condition for the rule to be applied,
     convergence plane,
     preparation function)

The preparation function is a function with one argument that is applied
to the expression before matching. For most rules it should be
``_laplace_deep_collect``.
r   r|   r   r   r   r   tauomegac                    < \        V S4      # r   )r   )r   r   s   &rm   dco!_laplace_build_rules.<locals>.dcoS  s    ,Q22rp   z&_laplace_build_rules is building rulesg      ?)(r   r   ru   r   r   r   r9   r&   r#   rK   rL   r   r:   r=   r"   r   r.   r<   r?   rA   r    r7   r@   r'   
EulerGammar>   r2   r!   r)   r3   r1   r*   r(   r;   r6   Halfr   r5   r8   r+   )	r|   r   r   r   r   r   r   laplace_transform_rulesr   s	           @rm   _laplace_build_rulesr   :  s   $ 	c
Ac
AS1#AS1#AS1#A
uqc
"C1#&E2
34|	
aC	
	| 
AaCE	C1QKA.	CAqAvAE16 2	3	
		S	"| 
AaCE	AaD	CAqAvAE16 2	3	
		S	"| 
1Q3q5	3r!tAv;q=	QUAE	AFFC	)| 
1Q3q5	Ac1"Q$q&kM1,	QUAE	AFFC	)| 
1Q3q5	1Q3	QUAF	QVVS	*| 
1Q3q5	1	QUAE	AFFC	)|" 
AadF	
	#|& 
AaCES!Aa[LQBqDF+A-	SX	QVVS	*'|* 
4!A;QrT!VSQZ/T!#a%[0AA!C	SX	QVVS	*+|. A#a%AaD57		
1!uQw<2a46QqT!V,,SQZ7$tACE{:KKAM	M	SX	QVVS	*/|4 
a!A#RT
2d1g:c!#h#6tDI#FF	SVr	1663	(5|8 
Ad1gIC 	!2a!A$q&k>#ac(#:4QS	?#J	
	9|< 
AuQqSz!c("	
R	=|@ A#a%!Z!QSU+C1QK7aC@B	QVSQS]R'	(!&&#	7A|D 
AqsQT%!*_ZAC%88	QVSQ[2%	&	5E|H 
QqSWsC4y!#	
A	I|L 
3qs3w<cTAC!8+	
A	M|P 
Ac!A#hac
AC1Q3</	ARUC	!Q|T 
aR1WtBqDF|C1QqM1$qac{2CC	AAFFC	!U|X 
3r!Q$w<	
AaC48QqSAaDFO+A-d1T!A#Y;.??	?	AAFFC	!Y|^ 
aRTAd13iK1T!#Y; 77	A!QVVS	"_|b 
aaRT		
1aR1W	q49}	-c"T!#Y,.?	?	A!QVVS	"c|h 
aRT47	DAJs2d13i<'88	A!QVVS	"i|l 
aRTAd1gI	RT
3r$qs)|+< <	AAFFC	!m|p 
Ac1"Q$iACAaC7++GAaC49,EE	AAFFC	!q|B 
aRQBZ!b'*Q"22	
	C|F 
aRAYj!Q//	AAFFC	!G|J 
QqSCALL)!+A-..q0	
Q	K|N 
QqsUc!#hYq[QBqD)	SVr	1663	(O|R 
QqSUc!fSQZ\!^Br!tH44a79	QUCAK"$	%qvvs	4S|V 
QQ$r!t*S1S->)>%??	
	W|Z 
Ac!feAaCjRT*GAaCLQ,?@	AQVVS	"[|^ 
QqS1s3q||,Q.q0114RU1W<a?	
Q	_|b 
U1Wud5!8m,	
RY	&c|f 
Sq\	Ea4q=1$r!tAve|2DD	AFFC	!g|j 
U1Waeg	
RY	&k|n 
U1Wq	C!E1H*QT/ 1214	
3r%y>!3	(o|r 
U1WqA		tAeGAI	qQqz!Q$%6!779	9	
3r%y>!3	(s|@ 
U1WqQ$uax-(	
RY	&A|D 
U1Wq1a4%(
?QT!E1H*_=a?	
3r%y>!3	(E|P 
QqS#ac(	AaCE!GQT13(]3QT13(]C	
RUC1J&	-Q|T 
QqS#ac(	A!tAqDyA~.1acAX>1acAXN	
RUC1J&	-U|X 
QqS#ac(	A!tAqDyA~.1acAX>1acAXN	
RUC1J&	-Y|\ 
acA!tAqDyM	
RUS	"]|` 
acA!tAqDyM	
RUS	"a|d 
acAqAvq!tAadF1H}-	
3r!u:s	$e|h 
acA1Qq!tVad1QT6!8m4	
3r!u:s	$i|l 
ac1c13+&q(	
RUS	"m|p 
Ad1Q3iqsAr!t}acaRT]'BC	
RQ	q|t 
Ad1Q3iqsAr!t}acaRT]'BC	
RQ	u|b 
QqS3q!tQqS1H}%d1ac7m3A5	
3s1v;	QVVS	*c|~ 
aC!$QT!Q$Y41QT	?1BQ0F FG	ASAZ	&|B 
Aga1o		
Ad2huQqvvX	&qt	+QT!Q$Y1"QVV),D	D	RUaffW_bh	'RUS	:C|H 
Aga1o		
QqS$r(	51Q46?	*14	/	11a4191Q46	2J	J	RURZAs	$c"Q%j#	7I|V 
Ad1a4!8n$	%	QS41QT	?""	#DAadO	3	SVr	3r!u:s	,W|\ 
aC!$QT!Q$Y41QT	?1BQ0F FG	ASAZ	&]|` 
Aga1o		
Ad2huQqvvX	&qt	+QT!Q$Y1"QVV),D	D	RUaffW_bh	'RUS	:a|f 
Aga1o		
QqS$r(	51Q46?	*14	/	11a4191Q46	2J	J	RURZAs	$c"Q%j#	7g|p 
AaC"R%ac
*41QT	?:	
RUS	"q|t 
AaC#q41QT	?2A56QT!Q$YH	
"Q%	u|z #Aq((rp   c                   \        RV.R7      p\        R^R7      pV P                  V4      pV'       d   WT,          P                  ^ ,          P	                  V4      pVP                  ! W1,          4      pV'       d|   Ws,          P
                  '       dd   Ws,          ^8w  dW   \        R4       \        ^Ws,          ,          WT,          P                  V4      ,          WWs,          ,          RR7      w  rp
WV
3# R# )	z
This function applies the time-scaling rule of the Laplace transform in
a straight-forward way. For example, if it gets ``(f(a*t), t, s)``, it will
compute ``LaplaceTransform(f(t)/a, t, s/a)`` if ``a>0``.
r   r   g)nargsz     rule: time scaling (4.1.4)Fr   N)	r   r   r   ri   collectr   ru   _laplace_transformrl   )r   r   r|   r   r  ma1r"   ma2r   prcrs   &&&        rm   _laplace_rule_timescaler    s     	S1#AS"A
''!*C
fkk!n$$Q'iin36%%%#&A+45*#&Q'cfHuFIA22;rp   c                   \        RV.R7      p\        R4      p\        R4      pV P                  \        V4      V,          4      ;p'       Ed   Wd,          P                  W,
          4      ;p'       d   Ws,          P                  '       da   \	        R4       \        We,          P                  WWs,          ,           4      WRR7      w  rp
\        Ws,          ) V,          4      V,          W3# Ws,          P                  '       d'   \	        R4       \        We,          WRR7      w  rp
WV
3# Wd,          P                  W1,
          4      ;p'       d   Ws,          P                  '       dK   \	        R	4       \        ^\        WV,          ,
          4      ,
          We,          ,          WRR7      w  rp
WV
3# Ws,          P                  '       d   \	        R
4       ^ ^ \        P                  3# R# )a  
This function deals with time-shifted Heaviside step functions. If the time
shift is positive, it applies the time-shift rule of the Laplace transform.
For example, if it gets ``(Heaviside(t-a)*f(t), t, s)``, it will compute
``exp(-a*s)*LaplaceTransform(f(t+a), t, s)``.

If the time shift is negative, the Heaviside function is simply removed
as it means nothing to the Laplace transform.

The function does not remove a factor ``Heaviside(t)``; this is done by
the simple rules.
r   r   r   r  z     rule: time shift (4.1.4)Fr  z8     rule: Heaviside factor; negative time shift (4.1.4)z      rule: Heaviside window openz"     rule: Heaviside window closedN)r   r   r:   r   ru   r  r   r&   is_negativer   r   )r   r   r|   r   r   r  r  r  r   r	  r
  s   &&&        rm   _laplace_rule_heavisider  ,  s|    	S1#AS	AS	AggilQ&''s'&,,qu%%3%v!!!67.FKKsv:.uF	rSVGaK(1,b55v!!!NP.svqeL	rr{"&,,qu%%3%v!!!9:.11v:..#&8!P	rr{"v!!!;<1aff~%rp   c                   \        RV.R7      p\        R4      p\        R4      pV P                  \        V4      V,          4      pV'       d~   Wd,          P                  V4      P                  W1,          4      pV'       dJ   \	        R4       \        We,          WWs,          ,
          RR7      w  rp
W\        Ws,          4      ,           V
3# R# )	a  
If this function finds a factor ``exp(a*t)``, it applies the
frequency-shift rule of the Laplace transform and adjusts the convergence
plane accordingly.  For example, if it gets ``(exp(-a*t)*f(t), t, s)``, it
will compute ``LaplaceTransform(f(t), t, s+a)``.
r   r   r   zz$     rule: multiply with exp (4.1.5)Fr  N)r   r   r&   r  ru   r  r    )r   r   r|   r   r   r  r  r  r   r	  r
  s   &&&        rm   _laplace_rule_expr  V  s     	S1#AS	AS	A
''#a&(
C
fnnQ%%ac*9:*361h49;IA2"SV*}b))rp   c           
        \        RV.R7      p\        RV.R7      p\        R4      p\        R4      pV P                  \        V4      V,          4      pV'       Ed   Wv,          P                  \        4      '       Eg   Wu,          P	                  V4      P                  WA,          V,
          4      pV'       EdZ   \        R4       W,          W,          ,          p	\        V	4      ^ 8  Ed   \        V	4      ^ 8X  d   \        W,          ) W,          ,          V,          4      Wv,          ,          p
V
P                  \        \        4      '       d$   V
P                  \        4      P                  4       p
V
P                  4        Uu. uF'  qP                  WV,          W,          ,          4      NK)  	  upw  rV^ 8w  d5   W,          W,          ,          \         P"                  \         P$                  3# R# ^ \         P"                  \         P$                  3# Wu,          P'                  V4      '       Ed   \)        Wu,          V4      pV/ 8w  d   \+        VP-                  4       4      ^08X  d   \/        Wu,          V4      p\1        \3        VP5                  4       4       Uu. uFl  p\        V4      ^ 8X  g   K  \        V4      ^ 8  g   K'  \        V) V,          4      Wv,          P                  W4      ,          VP                  W4      ,          NKn  	  up!  pV\         P"                  \         P$                  3# R# u upi u upi )z
If this function finds a factor ``DiracDelta(b*t-a)``, it applies the
masking property of the delta distribution. For example, if it gets
``(DiracDelta(t-a)*f(t), t, s)``, it will return
``(f(a)*exp(-a*s), -a, True)``.
r   r   r   r   r  z#     rule: multiply with DiracDeltaN)r   r   r9   r   r  ru   r    r!   r&   r2   r1   rewriter4   ratsimpas_numer_denomr   r   r   r   is_polynomialrP   setvaluesr   r   r   keys)r   r   r|   r   r   r   r  r  r  locfnr   r   r   rosloper   s   &&&              rm   _laplace_rule_deltar  m  sV    	S1#AS1#AS	AS	A
''*Q-/
"C
s36::j))fnnQ%%ac!e,389&-C#w!|31#&)*36166#s## D)113B:<:K:K:MN:MQqa&-0:MN6CJ(:(:AFFCC1--qvv666""svq!BRxC		,3SVQ#BGGIM.!"Q%1* CACA! Cc1"Q$iA 11%**Q2BBB.MN 1--qvv66 OMs   -L6L;3L;A	L;c                P   \         P                  .p\         P                  .p\        P                  ! V 4       FV  pVP	                  \
        \        \        \        \        4      '       d   VP                  V4       KE  VP                  V4       KX  	  \        V!  p\        V!  pWE3# )z
Helper function for `_laplace_rule_trig`.  This function returns two terms
`f` and `g`.  `f` contains all product terms with sin, cos, sinh, cosh in
them; `g` contains everything else.
)r   Oner   	make_argsr   r2   r1   r*   r(   r&   append)r  trigsothertermr   r  s   &     rm   _laplace_trig_splitr&    sw     UUGEUUGEb!88CdD#..LLLL	 "
 	UAUA4Krp   c                   \        RV.R7      p\        RV.R7      p\        RV.R7      p. p. pV P                  \        4      P                  4       p\        P
                  ! V4       EF   pVP                  V4      '       g$   VP                  RVR^ \        ^ \        ^ /4       K>  \        VP                  RR7      V4      pVP                  V\        W!,          V,           4      ,          4      ;p	ed   VP                  RW,          \        W,          4      ,          RW,          \        \        W,          4      \        \        W,          4      /4       K  VP                  V4       EK  	  WV3# )	a  
Helper function for `_laplace_rule_trig`.  This function expects the `f`
from `_laplace_trig_split`.  It returns two lists `xm` and `xn`.  `xm` is
a list of dictionaries with keys `k` and `a` representing a function
`k*exp(a*t)`.  `xn` is a list of all terms that cannot be brought into
that form, which may happen, e.g., when a trigonometric function has
another function in its argument.
c1r   c0r   kr   r&   )combine)r   r  r&   r
   r   r!  r   r"  r    r!   r   powsimpr   )
r   r   r(  r)  r   xmxnx1r%  r   s
   &&        rm   _laplace_trig_expsumr0    s    
dQC	 B	dQC	 BS1#A	B	B	
3			 Bb!xx{{IIsD#q"aQ78$T\\%\%@!DAc"$r'lN++A8IIQT#ae*_c15BquIr2ae9. / IIdO " 6Mrp   c           	       a . p. pR oV3R lpV3R lpV3R lpV3R lpR p	\        V 4      ^ 8  EdD   V P                  4       p
RpRpRp\        \        V 4      4       EF  pV
\        ,          W,          \        ,          8H  pV
\        ,          W,          \        ,          ) 8H  pV
\        ,          W,          \        ,          8H  pV
\        ,          W,          \        ,          ) 8H  pV'       d1   V'       d)   V
\        ,          ^ 8w  d   V
\        ,          ^ 8w  d   TpK  V'       d   V'       d   V
\        ,          ^ 8w  d   TpK  V'       g   K  V'       g   K  V
\        ,          ^ 8w  g   EK  TpEK  	  Ve   Ve   Ve   VP                  V! V
W,          R,          W,          R,          W,          R,          V4      4       VP                  \        \        V
R	,          4      4      4       WV.pVP                  R
R7       V F  pV P                  V4       K  	  EK  VeW   VP                  V! WV,          R,          V4      4       VP                  V
\        ,          4       V P                  V4       EKX  Ve`   VP                  V! WV,          R,          V4      4       VP                  \        V
\        ,          4      4       V P                  V4       EK  Ve`   VP                  V! WV,          R,          V4      4       VP                  \        V
\        ,          4      4       V P                  V4       EK  VP                  V	! W4      4       VP                  V
\        ,          4       EKT  \        V!  \        V!  3# )z
Helper function for `_laplace_rule_trig`.  This function takes the list of
exponentials `xm` from `_laplace_trig_expsum` and simplifies complex
conjugate and real symmetric poles.  It returns the result as a sum and
the convergence plane.
c                 x   V P                  4       p\        \        V4      4       F  pW,          P                  4       pV^ ,          P	                  \
        4      '       d    W,          P                  \        4      W&   KZ  V^ ,          \        V^,          ,          ,           P                  \        4      W&   K  	  V# r   )	copyrangelenr   r   r!   r  r1   r   )coeffsncr*  ris   &   rm   _simpc"_laplace_trig_ltex.<locals>._simpc  s{    [[]s2wA##%B!uyy}}c*A2a511#6   	rp   c           
        < V R ,          V R,          V \         ,          V \        ,          3w  rVrxWa,           V,           V,           WVV,           V,
          V,
          ,          ^\        ,          V,          V,          ,
          ^\        ,          V,          V,          ,           V^,          V) V,
          V,
          V,
          ,          V^\        ,          V,          V,          ^\        ,          V,          V,          ,           ,          ,           ^V^,          ,          V,          ,           ^V^,          ,          V,          ,           V^,          V) V,
          V,           V,           ,          V^,          ^\        ,          V,          V,          ^\        ,          V,          V,          ,           ^\        ,          V,          V,          ,
          ^\        ,          V,          V,          ,
          ,          ,           V^V^,          ,          V,          ^V^,          ,          V,          ,
          ,          ,           .p	\        P                  \        P
                  ^V^,          ,          ^V^,          ,          ,
          \        P
                  V^,          ^V^,          ,          V^,          ,          ,           V^,          ,           .p
\        \        S! V	4      \        \        V	4      4      RRR1,          4       UUu. uF  w  rWV,          ,          NK  	  upp!  p\        \        V
\        \        V
4      4      RRR1,          4       UUu. uF  w  rWV,          ,          NK  	  upp!  pW,          # u uppi u uppi r   r*  Nr   )
r    r!   r   r   r   r   r   zipr4  r5  )t1k1k2k3r|   r   k0a_ra_ir7  dcr   r   r   r   r9  s   &&&&&          rm   	_quadpole%_laplace_trig_ltex.<locals>._quadpole  sd   S'2c7BrFBrF:sGbL2Bw|b !AaCGBJ.1S;1rcBhmb()1Q3s72:!C
*+,#q&Qhrk* 1rcBhmb()1ac#gbj1Q3s72:-!C
:QqSWRZGHI1S!V8B;36",-.
 EE1661S!V8aQh.FFCFQsAvXc1f_,sAv57 !$VBZs2w"1E!FG!Fa1ff!FGI!$Rs2w")=!>?!>a1ff!>?As
 H?s   :M2

M8
c           
        < V R ,          V R,          V \         ,          V \        ,          3w  r4rVWA,           V) V,          W1,          ,
          ^\        ,          V,          V,          ,           .p\        P                  RV,          V^,          V^,          ,           .p\        \        S! V4      \        \        V4      4      RRR1,          4       U	U
u. uF  w  rWV
,          ,          NK  	  up
p	!  p\        \        V\        \        V4      4      RRR1,          4       U	U
u. uF  w  rWV
,          ,          NK  	  up
p	!  pW,          # u up
p	i u up
p	i r   r*  Nr   r   	r    r!   r   r   r   r   r=  r4  r5  )r>  r?  r|   r   rB  rC  rD  r7  rE  r   r   r   r   r9  s   &&&          rm   _ccpole#_laplace_trig_ltex.<locals>._ccpole  s   S'2c7BrFBrF:sgr"uqt|ac#gbj01eeRVS!Vc1f_-!$VBZs2w"1E!FG!Fa1ff!FGI!$Rs2w")=!>?!>a1ff!>?As
 H?s   E
#E
c           
        < V R ,          V R,          V \         ,          V \        ,          3w  r4rVWA,           W4,          W1,          ,
          ^\        ,          V,          V,          ,
          .p\        P                  R\        ,          V,          V^,          ) V^,          ,
          .p\        \        S! V4      \        \        V4      4      RRR1,          4       U	U
u. uF  w  rWV
,          ,          NK  	  up
p	!  p\        \        V\        \        V4      4      RRR1,          4       U	U
u. uF  w  rWV
,          ,          NK  	  up
p	!  pW,          # u up
p	i u up
p	i rI  rJ  )r>  r@  r|   r   rB  rC  rD  r7  rE  r   r   r   r   r9  s   &&&          rm   _rspole#_laplace_trig_ltex.<locals>._rspole  s   S'2c7BrFBrF:sgqtad{QqSWRZ/0eeRT#XQwa/0!$VBZs2w"1E!FG!Fa1ff!FGI!$Rs2w")=!>?!>a1ff!>?As
 H?s   E
-E
c           
        < V R ,          V R,          rCWA,           W4V,
          ,          .p\         P                  \         P                  V^,          ) .p\        \	        S! V4      \        \        V4      4      RRR1,          4       UUu. uF  w  rxWrV,          ,          NK  	  upp!  p	\        \	        V\        \        V4      4      RRR1,          4       UUu. uF  w  rxWrV,          ,          NK  	  upp!  p
W,          # u uppi u uppi r<  )r   r   r   r   r=  r4  r5  )r>  rA  r|   r   rB  r7  rE  r   r   r   r   r9  s   &&&        rm   _sypole#_laplace_trig_ltex.<locals>._sypole  s    3C2gqr'{#eeQVVadU#!$VBZs2w"1E!FG!Fa1ff!FGI!$Rs2w")=!>?!>a1ff!>?As
 H?s   	D
D
c                 H    V R ,          V R,          r2TpW,
          pWE,          # )r   r*  rq   )r>  r|   r   rB  r   r   s   &&    rm   _simplepole'_laplace_trig_ltex.<locals>._simplepole  s$    3C2Es
rp   Nr*  r   T)reverse)
r5  popr4  r    r!   r"  r#   r   r   r,   )r-  r   r|   resultsplanesrF  rK  rN  rQ  rT  r>  	i_imagsym	i_realsym
i_pointsymireal_eqrealsymimag_eqimagsymindices_to_popr9  s   &&&                 @rm   _laplace_trig_ltexrc    s    GF. b'A+VVX		

 s2wAfb	)Gfr
*Gfb	)Gfr
*G7r"v{r"v{
WB1	WWB1	  ( %)*?*NN"-,bmC.@.-q23 MM#bCk*+ (J?N-#q	 $"NN72)}S'91=>MM"R&!FF9"NN72)}S'91=>MM#bf+&FF9#NN72*~c':A>?MM#bf+&FF:NN;r-.MM"R&!=#v,&&rp   c           
        \        RRR7      pV P                  \        \        \        \
        4      '       g   R# \        V P                  W4      4      w  rE\        WC4      w  rg\        V4      ^ 8  d   R# VP                  V4      '       g(   \        WcV4      w  rWX,          V	\        P                  3# . p
. p\        WSVRR7      w  rpV Fg  pVP                  VR,          VP                  W"VR,          ,
          4      ,          4       V
P                  V\        VR,          4      ,           4       Ki  	  \!        V!  P                  W14      \#        V
!  V3# )	z
This rule covers trigonometric factors by splitting everything into a
sum of exponential functions and collecting complex conjugate poles and
real symmetric poles.
r   TrealNFr  r*  r   )r   r   r2   r1   r*   r(   r&  r   r0  r5  rc  r   r   r  r"  r    r   r,   )r  t_r|   r   r   r  r-  r.  r   r   rY  rX  GG_planeG_condr/  s   &&&             rm   _laplace_rule_trigrk  [  s    	cA66#sD$''rwwr~.DA!!'FB
2w{5588!"+sAqvv~ /a%HFBNN2c7166!r#wY#778MM'"RW+-.  =a$c6lF::rp   c                0   \        RV.R7      p\        RV.R7      p\        R4      pV P                  V\        WQV34      ,          4      pV'       Ed>   Wd,          P                  '       Ed%   We,          P
                   Uu. uF  qwP                  V4      NK  	  pp\        V4      ^8X  d   \        R4       . p	\        Wd,          4       Fy  p
V
^ 8X  d   We,          P                  V^ 4      pM#\        We,          W34      P                  V^ 4      pV	P                  W&V,          V
,
          ^,
          ,          V,          4       K{  	  \        We,          WRR7      w  rpWc,          W&V,          ,          V,          \        V	!  ,
          ,          W3# R# u upi )	z
This function looks for derivatives in the time domain and replaces it
by factors of `s` and initial conditions in the frequency domain. For
example, if it gets ``(diff(f(t), t), t, s)``, it will compute
``s*LaplaceTransform(f(t), t, s) - f(0)``.
r   r   r   r  z"     rule: time derivative (4.1.8)Fr  N)r   r   r   r	   
is_integerri   r   sumru   r4  r   r"  r  r   )r   r   r|   r   r   r  r  r  r   r   r*  r   r   r	  r
  s   &&&            rm   _laplace_rule_diffro  |  s9    	S1#AS1#ASA
''!Jqa&))
*C
ssv   "v{{+{!UU1X{+q6Q;78A36]6Aq)A"36A62771=AVAXaZ*+ # +361%HIA2FA1vIaK#q'12R<< ,s   Fc           
        V P                   '       Ed   ^.p^.p\        P                  ! V 4       F>  pVP                  V4      '       d   VP	                  V4       K-  VP	                  V4       K@  	  \        V4      ^8  Ed   \        V4      p\        Wa4      P                  4       p\        V4      pV^8  EdH   \        V4      p	\        WVRR7      w  rpV
.pRp \        VR,          V4      ) pV
P                  \        4      '       dR   \        V^,
          4       F:  pVP	                  RV^,           ,          \        WV^,           4      ,          4       K<  	  MUV'       dN   VP	                  V4       \        V^,
          4       F&  pVP	                  \        VR,          V4      ) 4       K(  	  V'       dI   \!        \        V4       Uu. uF'  pWxV,
          ^,
          ,          VV,          ,          NK)  	  up!  pVW3# \#        RV.R7      p\#        R4      pV P%                  VV,          V,          4      ;p'       dv   VV,          P&                  '       d]   VV,          P(                  '       dD   \        VV,          WRR7      w  rpRVV,          ,          \        WVV,          34      ,          W3# R#   \         d    Rp ELi ; iu upi )z
This function looks for multiplications with polynoimials in `t` as they
correspond to differentiation in the frequency domain. For example, if it
gets ``(t*f(t), t, s)``, it will compute
``-Derivative(LaplaceTransform(f(t), t, s), s)``.
Fr  r   r   r  Nr   )is_Mulr   r!  r  r"  r5  r   rQ   
all_coeffsr  r   
ValueErrorr   LaplaceTransformr4  r	   r   r   r   rm  r   )r   r   r|   pfacofacfacpexpcNoexr_p_c_derid1r*  r   r   r  r  s   &&&                 rm   _laplace_rule_sdiffr    s<    	xxxss==#C  ##C C 	 $
 t9q=t*Cc((*BBA1u4j/EJ
ttBx++B 66*++"1Q3ZR1Q3K
2!A#0F$FG (KKO"1Q3ZT$r(A%6$67 (qBAb1QiQ//BCAr;& 	S1#AS	Aggad1fosq6Q!3!3!3+CFA5IJBBQ<RSV 55r==) " B Cs   J8 -K8K	K	c                   \        V RR7      pVP                  '       d   \        W1VRR7      # \        V 4      pVP                  '       d   \        W1VRR7      # \        V 4      pVP                  '       d   \        W1VRR7      # W08w  d   \        W1VRR7      # \        \	        V 4      4      pVP                  '       d   \        W1VRR7      # R# )aj  
This function tries to expand its argument with successively stronger
methods: first it will expand on the top level, then it will expand any
multiplications in depth, then it will try all available expansion methods,
and finally it will try to expand trigonometric functions.

If it can expand, it will then compute the Laplace transform of the
expanded term.
Fdeepr  N)r
   is_Addr  r   r   )r   r   r|   r   s   &&& rm   _laplace_expandr    s     	quAxxx!!E::1Axxx!!E::q	Axxx!!E::v!!E::{1~Axxx!!E::rp   c                    \         \        \        \        \        \
        \        .pV F  pV! WV4      ;pf   K  Vu # 	  R# )z_
This function applies all program rules and returns the result if one
of them gives a result.
N)r  r  r  r  rk  ro  r  )r   r   r|   
prog_rulesp_ruleLs   &&&   rm   _laplace_apply_prog_rulesr    sG     *+>)+<$$&9;J
 a A-H  rp   c                   \        4       w  r4pRpRpV F  w  rrpWl8w  d   V! V P                  W/4      4      pTpVP                  V4      pV'       g   KB   V
P                  V4      pT\
        P                  8X  g   Kk  T	P                  T4      P                  YR/4      TP                  T4      \
        P                  3u # 	  R#   \         d     K  i ; i)z^
This function applies all simple rules and returns the result if one
of them gives a result.
 N)r   r   r   xreplacer   r   r   )r   r   r|   simple_rulesrg  r   prep_oldprep_ft_doms_domcheckplaneprepmar   s   &&&            rm   _laplace_apply_simple_rulesr    s     01LbHF,8(eD!&&!/*FH\\% 2NN2&
 AFF{r*//8r*AFF4 4 -9    s   CCCc                   VP                   '       g:   \        RRR7      p\        V P                  W/4      V4      P                  W!/4      # \	        V 4      p. pVP
                   EF  w  rE\        V\        4      '       do   WP
                  9   d_   \        V\        \        34      '       d   V u # VP                  \        VP                  VP                  ,
          4      V,          4       K  \        V\        4      '       d   \        VP
                  4      ^8X  dj   VP
                   FV  pVP                   V8X  d?   VP                  \        VP                  VP                  ,
          4      V,          4       KR  V u u # 	  EK#  \        V\"        4      '       d   \        VP
                  4      ^8X  d   VP
                  w  rxVP                   V8X  d   VP                   V8X  d~   RVP$                  9   d   YrVP                  \        VP                  VP                  ,
          4      \        VP                  VP                  ,
          4      ,
          V,          4       EK   V u # V u # 	  \'        V!  # )z
This function converts a Piecewise expression to an expression written
with Heaviside. It is not exact, but valid in the context of the Laplace
transform.
r   Tre  >)is_realr   _piecewise_to_heavisider  r0   ri   r   r   r   r   r"  r:   gtsr   rK   r5  lhsrL   r   r   )	r   r   r   r   r  r   c2r)  r(  s	   &&       rm   r  r    s    999#D!&qzz1&'91=FFvNNAA
AFF dJ''AN$R))
 488dhh#67:;b!!c$))n&9ii66Q;HHYrvv7:;H	  
 c""s499~':YYFBvv{rvv{"))#rvv/rvv/01345 HA B 7Nrp   c          	        \        R4      p\        R4      p\        R4      p\        R4      p\        V \        4      '       d7   V P                  \        4      '       g   V P                  \
        4      '       g   V # VP                  4        F  w  rgV P                  \	        V! V4      WC4      4      ;pe$   W,          W,          8X  d   V! W,          4      u # V P                  \        V! V4      W4V4      4      ;p f   Kv  W,          W,          8X  g   K  V! W,          4      u # 	  V P                  p	V P                   U
u. uF  p
\        W4      NK  	  pp
V	! V!  # u up
i )a  
This helper function takes a function `f` that is the result of a
``laplace_transform`` or an ``inverse_laplace_transform``.  It replaces all
unevaluated ``LaplaceTransform(y(t), t, s)`` by `Y(s)` for any `s` and
all ``InverseLaplaceTransform(Y(s), s, t)`` by `y(t)` for any `t` if
``fdict`` contains a correspondence ``{y: Y}``.

Parameters
==========

f : sympy expression
    Expression containing unevaluated ``LaplaceTransform`` or
    ``LaplaceTransform`` objects.
fdict : dictionary
    Dictionary containing one or more function correspondences,
    e.g., ``{x: X, y: Y}`` meaning that ``X`` and ``Y`` are the
    Laplace transforms of ``x`` and ``y``, respectively.

Examples
========

>>> from sympy import laplace_transform, diff, Function
>>> from sympy import laplace_correspondence, inverse_laplace_transform
>>> from sympy.abc import t, s
>>> y = Function("y")
>>> Y = Function("Y")
>>> z = Function("z")
>>> Z = Function("Z")
>>> f = laplace_transform(diff(y(t), t, 1) + z(t), t, s, noconds=True)
>>> laplace_correspondence(f, {y: Y, z: Z})
s*Y(s) + Z(s) - y(0)
>>> f = inverse_laplace_transform(Y(s), s, t)
>>> laplace_correspondence(f, {y: Y})
y(t)
r   r|   r   r   )r   r   r   r   rt  InverseLaplaceTransformitemsr   rl   ri   laplace_correspondence)r   fdictr   r|   r   r   r   Yr   rl   r"   ri   s   ""          rm   r  r  F  s   H 	S	AS	AS	AS	A1d##EE*++566gg.qtQ:;;HDADLQT7Ngg5adA!DEEDADLQT7N  66D:;&&A&3"3.&DA; Bs   Ec                  VP                  4        F  w  r4\        \        V4      4       F  pV^ 8X  d"   V P                  V! ^ 4      V^ ,          4      p K+  V^8X  d7   V P                  \	        \        V! V4      V4      V^ 4      V^,          4      p Kh  V P                  \	        \        V! V4      W34      V^ 4      WE,          4      p K  	  K  	  V # )a  
This helper function takes a function `f` that is the result of a
``laplace_transform``.  It takes an fdict of the form ``{y: [1, 4, 2]}``,
where the values in the list are the initial value, the initial slope, the
initial second derivative, etc., of the function `y(t)`, and replaces all
unevaluated initial conditions.

Parameters
==========

f : sympy expression
    Expression containing initial conditions of unevaluated functions.
t : sympy expression
    Variable for which the initial conditions are to be applied.
fdict : dictionary
    Dictionary containing a list of initial conditions for every
    function, e.g., ``{y: [0, 1, 2], x: [3, 4, 5]}``. The order
    of derivatives is ascending, so `0`, `1`, `2` are `y(0)`, `y'(0)`,
    and `y''(0)`, respectively.

Examples
========

>>> from sympy import laplace_transform, diff, Function
>>> from sympy import laplace_correspondence, laplace_initial_conds
>>> from sympy.abc import t, s
>>> y = Function("y")
>>> Y = Function("Y")
>>> f = laplace_transform(diff(y(t), t, 3), t, s, noconds=True)
>>> g = laplace_correspondence(f, {y: Y})
>>> laplace_initial_conds(g, t, {y: [2, 4, 8, 16, 32]})
s**3*Y(s) - 2*s**2 - 4*s - 8
)r  r4  r5  r   r   r	   )r   r   r  r   icr*  s   """   rm   laplace_initial_condsr    s    D s2wAAvIIadBqE*aIId:adA#61=r!uEIId:adQF#;QBBEJ    Hrp   c                 a \         P                  ! V 4      p. p. p. p. pV EF7  p	V	P                  SRR7      w  rVP                  \        4      '       dc   \         P                  ! VP                  \        4      4      pV F1  pVP                  SRR7      w  rVP                  W,          V34       K3  	  K  VP                  \        8X  d{   VP                  \        S4      4      '       g[   \         P                  ! \        VS4      4      pV F1  pVP                  SRR7      w  rVP                  W,          V34       K3  	  EK%  VP                  W34       EK:  	  V EF  w  rVP                  \        4      '       d!   \        VSV4      \        P                  R3pEMHVP                  \        S4      4      '       d<   VP                  \        S4      4      '       g   VP                  \        S4      ^4      p\!        VSV4      ;p f$   \#        VSV4      ;p f   \%        VSV4      ;pe   M\&        ;QJ d2    V3R lVP)                  \*        4       4       F  '       g   K   RM'	  RM#! V3R lVP)                  \*        4       4       4      '       d    \        VSV4      \        P                  R3pM2\-        VSW#R7      ;p e   M\        VSV4      \        P                  R3pVw  pppVP                  V
V,          4       VP                  V4       VP                  V4       EK  	  \        V!  pV'       d   VP/                  RR7      p\1        V!  p\3        V!  pVVV3# )z
Front-end function of the Laplace transform. It tries to apply all known
rules recursively, and if everything else fails, it tries to integrate.
Fas_AddTc              3   D   <"   T F  qP                  S4      x  K  	  R # 5ir   r   )r   undefrg  s   & rm   r   %_laplace_transform.<locals>.<genexpr>  s     G0FuYYr]]0F    r  doit)r   r!  as_independentr   rB   r  r:   r"  rl   r/   r9   r  rt  r   r   r   r  r  r  anyr   r   ra   r   r,   rL   )r  rg  r   r   terms_tterms_stermsrY  
conditionsffr*  ft_terms_termr?  f1r   ri_pi_ci_rk   r  	conditions   &f&$                   rm   r  r    s    mmBGGEFJ!!"U!366%&&]]2::i#89F--b-?adBZ(   WW	!"&&B*@*@]]#:2r#BCF--b-?adBZ(   LL!!  66%&&!"b"-q/A/A4HAvvim$$RVVJrN-C-C WWYr]A.5b"bAAQ 3BB??Q )"b"55QBG0FGG0FGGG &b"b113E3EtL5B3 3!;?@%b"b113E3EtLc3quc#; > ']Fe,LEZ I5)##rp   c                   :   a  ] tR tRt o RtRtR tR tR tRt	V t
R# )	rt  i  a  
Class representing unevaluated Laplace transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute Laplace transforms, see the :func:`laplace_transform`
docstring.

If this is called with ``.doit()``, it returns the Laplace transform as an
expression. If it is called with ``.doit(noconds=False)``, it returns a
tuple containing the same expression, a convergence plane, and conditions.
Laplacec                D    VP                  R R4      p\        WW5R7      pV# )r   Fr  )getra   )selfr   r   r|   hintsrE   LTs   &&&&,  rm   _compute_transform#LaplaceTransform._compute_transform  s#    IIj%0	+A!H	rp   c                    \        V\        V) V,          4      ,          V\        P                  \        P                  34      # r   )rD   r&   r   r   r   )r  r   r   r|   s   &&&&rm   _as_integralLaplaceTransform._as_integral  s,    #qbd)a%<==rp   c                ,   VP                  RR4      pVP                  RR4      p\        RV P                  V P                  V P                  34       V P                  pV P                  pV P                  p\        WdWSR7      pV'       d
   V^ ,          # V# )"  
Try to evaluate the transform in closed form.

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

Standard hints are the following:
- ``noconds``:  if True, do not return convergence conditions. The
default setting is `True`.
- ``simplify``: if True, it simplifies the final result. The
default setting is `False`.
nocondsTr   Fz[LT doit] (%s, %s, %s)r  )r  rW   functionfunction_variabletransform_variabler  )r  r  _nocondsrE   rg  r   r  r   s   &,      rm   r  LaplaceTransform.doit  s     99Y-IIj%0	'$--*.*@*@*.*A*A*C 	D ##$$]]rr>Q4KHrp   rq   N)rh   
__module____qualname____firstlineno____doc___namer  r  r  __static_attributes____classdictcell____classdict__s   @rm   rt  rt    s%      E
> rp   rt  c                  aaa SP                  RR4      pSP                  RR4      p\        V \        4      '       Ed   \        V R4      '       d   SP                  RR4      '       * pV'       dR   V'       dJ   Rp\	        RRVR7       \        \        4      ;_uu_ 4        V P                  VVV3R	 l4      uuR
R
R
4       # V  U	u. uF  p	\        V	SS3/ SB NK  	  p
p	V'       d>   \        V
!  w  rp\        V 4      ! . V P                  OVN5!  pV\        V!  \        V!  3# \        V 4      ! . V P                  OV
N5!  # \        V SS4      P                  RVR7      w  pppV'       g   VVV3# V#   + '       g   i     LA; iu up	i )a  
Compute the Laplace Transform `F(s)` of `f(t)`,

.. math :: F(s) = \int_{0^{-}}^\infty e^{-st} f(t) \mathrm{d}t.

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

For all sensible functions, this converges absolutely in a
half-plane

.. math :: a < \operatorname{Re}(s)

This function returns ``(F, a, cond)`` where ``F`` is the Laplace
transform of ``f``, `a` is the half-plane of convergence, and `cond` are
auxiliary convergence conditions.

The implementation is rule-based, and if you are interested in which
rules are applied, and whether integration is attempted, you can switch
debug information on by setting ``sympy.SYMPY_DEBUG=True``. The numbers
of the rules in the debug information (and the code) refer to Bateman's
Tables of Integral Transforms [1].

The lower bound is `0-`, meaning that this bound should be approached
from the lower side. This is only necessary if distributions are involved.
At present, it is only done if `f(t)` contains ``DiracDelta``, in which
case the Laplace transform is computed implicitly as

.. math ::
    F(s) = \lim_{\tau\to 0^{-}} \int_{\tau}^\infty e^{-st}
    f(t) \mathrm{d}t

by applying rules.

If the Laplace transform cannot be fully computed in closed form, this
function returns expressions containing unevaluated
:class:`LaplaceTransform` objects.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`. If
``noconds=True``, only `F` will be returned (i.e. not ``cond``, and also
not the plane ``a``).

.. deprecated:: 1.9
    Legacy behavior for matrices where ``laplace_transform`` with
    ``noconds=False`` (the default) returns a Matrix whose elements are
    tuples. The behavior of ``laplace_transform`` for matrices will change
    in a future release of SymPy to return a tuple of the transformed
    Matrix and the convergence conditions for the matrix as a whole. Use
    ``legacy_matrix=False`` to enable the new behavior.

Examples
========

>>> from sympy import DiracDelta, exp, laplace_transform
>>> from sympy.abc import t, s, a
>>> laplace_transform(t**4, t, s)
(24/s**5, 0, True)
>>> laplace_transform(t**a, t, s)
(gamma(a + 1)/(s*s**a), 0, re(a) > -1)
>>> laplace_transform(DiracDelta(t)-a*exp(-a*t), t, s, simplify=True)
(s/(a + s), -re(a), True)

There are also helper functions that make it easy to solve differential
equations by Laplace transform. For example, to solve

.. math :: m x''(t) + d x'(t) + k x(t) = 0

with initial value `0` and initial derivative `v`:

>>> from sympy import Function, laplace_correspondence, diff, solve
>>> from sympy import laplace_initial_conds, inverse_laplace_transform
>>> from sympy.abc import d, k, m, v
>>> x = Function('x')
>>> X = Function('X')
>>> f = m*diff(x(t), t, 2) + d*diff(x(t), t) + k*x(t)
>>> F = laplace_transform(f, t, s, noconds=True)
>>> F = laplace_correspondence(F, {x: X})
>>> F = laplace_initial_conds(F, t, {x: [0, v]})
>>> F
d*s*X(s) + k*X(s) + m*(s**2*X(s) - v)
>>> Xs = solve(F, X(s))[0]
>>> Xs
m*v/(d*s + k + m*s**2)
>>> inverse_laplace_transform(Xs, s, t)
2*v*exp(-d*t/(2*m))*sin(t*sqrt((-d**2 + 4*k*m)/m**2)/2)*Heaviside(t)/sqrt((-d**2 + 4*k*m)/m**2)

References
==========

.. [1] Erdelyi, A. (ed.), Tables of Integral Transforms, Volume 1,
       Bateman Manuscript Prooject, McGraw-Hill (1954), available:
       https://resolver.caltech.edu/CaltechAUTHORS:20140123-101456353

See Also
========

inverse_laplace_transform, mellin_transform, fourier_transform
hankel_transform, inverse_hankel_transform

r  Fr   	applyfuncz#deprecated-laplace-transform-matrixz
Calling laplace_transform() on a Matrix with noconds=False (the default) is
deprecated. Either noconds=True or use legacy_matrix=False to get the new
behavior.
                z1.9)deprecated_since_versionactive_deprecations_targetc                     < \        V SS3/ SB # r   )laplace_transform)fijr  r|   r   s   &rm   r   #laplace_transform.<locals>.<lambda>  s     1#q! Eu Erp   Nr  r   )r  r   rM   hasattrrT   rV   rU   r  r  r=  typeshaper,   rL   rt  r  )r   r   r|   legacy_matrixr  r  rE   r   adtr  elements_transelementsavalsr  	f_laplacer  r   r   s   &ff&l             rm   r  r  +  sv   N yyE*H		*e,I!Z  WQ%<%<IIi//]7C%
 */+. !!899{{EG :9
 012/0 0Q$"$/0  2.1>.B+ G7QWW7h7	 #u+sJ/???Aw88881a(--e7@ . BHB1 1ax	' :92s   E2F2F	c                 aaa ^ RI HpHo ^ RIHp \        RRR7      oVV3R lpV P                  V4      '       d   V P                  V4      p V P                  '       dM   \        V P                   Uu. uF  p\        WSW44      NK  	  up!  p	\        V	P                  SV4      V4      R3#  V! W\        S) 4      R\        P                   3RRR	7      w  rV	f{   V! WS4      p	V	f   R# V	P$                  '       d4   V	P                  ^ ,          w  rV	P'                  \(        4      '       d   R# M\        P*                  p
V	P-                  \.        V4      p	V	P$                  '       d   V	P                  SV4      X
3# \        R
4      o\        P0                  3VV3R llpV	P-                  \2        V4      p	R pV	P-                  \        V4      p	\        V	P                  SV4      V4      X
3# u upi   \"         d    Rp	 EL)i ; i)z5The backend function for inverse Laplace transforms. )meijerint_inversion_get_coeff_exp)inverse_mellin_transformr   Tre  c                   < \        V 4      ^8w  d
   \        V !  # V ^,          P                  ^ ,          P                  pS! VS4      w  r#V ^ ,          P                  ^ ,          pV ^,          P                  ^ ,          p\	        ^\        V4      ,          SV,          ,
          4      V,          \	        SV,          ^\        V4      ,          ,
          4      V,          ,           # )z2Simplify a piecewise expression from hyperexpand. )r5  r/   ri   argumentr:   r#   )ri   r"   coeffexponente1e2r  r   s   *     rm   pw_simp7_inverse_laplace_transform_integration.<locals>.pw_simp  s    t9>d##1gll1o&&(a0!W\\!_!W\\!_aE
lQ[01"4akAc%jL01"45	6rp   NF)needevalr  uc                 j  < V P                   ! \        S) 4      S4      pVP                  S4      '       d   \        W4      # ^ RIHp V! V^ 8  S4      pVP                  S8X  d)   \        VP                  4      p\        SV,           V4      # \        VP                  4      p\        SV,           ) V4      # )rZ   r   )	r   r&   r   r:   r   r   r   r'   r  )r"   H0r   r   relr*  r   r  s   &&    rm   simp_heaviside>_inverse_laplace_transform_integration.<locals>.simp_heaviside  s    HHS!Wa 5588S%%@Aq)77a<CGGAQUB''CGGAq1uXr**rp   c                 *    \        \        V 4      4      # r   )r   r&   )r"   s   &rm   simp_exp8_inverse_laplace_transform_integration.<locals>.simp_exp  s    c#h''rp   )sympy.integrals.meijerintr  r  sympy.integrals.transformsr  r   is_rational_functionapartr  r   ri   rb   rE   r   r&   r   r   rG   r   r   rD   r   r   r/   r   r:   )r   r|   rg  r  r   r  r  r  Xr   r   r  r  r  r   r  s   &&&&$        @@@rm   rb   rb     s    NC 	cA
6 	a  GGAJxxxvv! 5Q1eN  21477*1aR4:L48%I
 	ya(9>>>ffQiGAuuX  66DIIi)~~~ vva}d""c
A vv + + 	
		)^,A( 	
		#x AQVVAr]H-t33c " s   3G*-)G/ /H ?H c                 b   ^ RI Hp V! V 4      w  r4VP                  V4      '       d   VP                  V4      P	                  4       p\        V4      ^8X  dS   Vw  rgpWaV^V,          ,          ,           ^,          W,          ,           V^V,          ,          ^,          ,
          ,          pW4,          # )rZ   )fraction)r   r  r  r   rr  r5  )	r   r|   r  r   r   cfr   r   r   s	   &&       rm   _complete_the_square_in_denomr    s    /a[FQqYYq\$$&r7a<GA!a1gI>!#%q!A#wl23A3Jrp   c            
        \        R4      p \        R4      p\        RV .R7      p\        RV .R7      p\        RV .R7      p\        R4       R pR	 pW ,          V\        P                  V^3W0V,           V) ,          ,          W^,
          ,          \        V) V,          4      ,          \        V4      ,          \        P                  V^3^V ^,          V^,          ,           ^,          ,          \        W!,          4      W!,          \        W!,          4      ,          ,
          ^V^,          ,          ,          \        P                  V^3^W,          ,          W^,
          ,          \        V4      ,          \        P                  V^3^W V,           V,          ,          ,          \        W2V,          4      W#,          \        V4      ,          ,          \        P                  V^3.pWpV3# )
z
This is an internal helper function that returns the table of inverse
Laplace transform rules in terms of the time variable `t` and the
frequency variable `s`.  It is used by `_inverse_laplace_apply_rules`.
r|   r   r   r   r   r   z._inverse_laplace_build_rules is building rulesc                 L     V P                  V4      #   \         d    T u # i ; ir   )factorrO   )r   r|   s   &&rm   _frac+_inverse_laplace_build_rules.<locals>._frac(  s)    	88A; 	H	s    ##c                     V # r   rq   )r   s   &rm   same*_inverse_laplace_build_rules.<locals>.same.  s    rp   )
r   r   ru   r   r   r&   r?   r2   r1   r@   )r|   r   r   r   r   r  r  
_ILT_ruless           rm   _inverse_laplace_build_rulesr    sp    	c
Ac
AS1#AS1#AS1#A
;<  
aq!sqbkM1s8C1I-eAh6FFD!	 
AqDAI>	CHqs3qs8|3a1f=	
q	 
AD11u:eAh&a8	
AsQhJAs+QT%(];	
q	J !rp   c                r   V ^8X  d'   \        R4       \        V4      \        P                  3# \	        4       w  r4pRpV P                  W/4      pV F  w  rrpWkV38w  d   V! W|,          4      pW3pXP                  V4      pV'       g   K;  T
pV\        P                  Jd5   V^ ,           Uu. uF  pVP                  V4      NK  	  ppV^,          ! V!  pV\        P                  8X  g   K  \        V4      V	P                  V4      P                  WR/4      ,          \        P                  3u # 	  R# u upi )8
Helper function for the class InverseLaplaceTransform.
z     rule: 1 o---o DiracDelta()r  N)	ru   r9   r   r   r  r   r   r  r:   )r   r|   r   r  r   rg  _prepfsubsr  r  r  r  rw  _Fr  r   r   ri   s   &&&               rm   #_inverse_laplace_apply_simple_rulesr  B  s   
 	Av01!}aff$$57JBEFFA7OE*4&e33KeiBKEXXe_2A01!51

25aD$KAFF{ |ENN2$6$;$;RG$DDaffLL +5  6s   -D4c           	     R   \        RV.R7      p\        RV.R7      p\        R4      pV P                  V\        WaV34      ,          4      pV'       dU   Wu,          P                  '       d=   \	        R4       \        Wv,          WVRRR7      w  rV) Wu,          ,          V,          V	3# R# )	r  r   r   r   r  z3     rule: t**n*f(t) o---o (-1)**n*diff(F(s), s, n)Fr   
dorationalN)r   r   r	   rm  ru   _inverse_laplace_transform)
r   r|   r   r  r   r   r  r  r   r   s
   &&&&      rm   _inverse_laplace_diffr$  _  s    
 	S1#AS1#AS	A	
:aQ((	)B	beDE)E15BRU{1}arp   c           	     $   \        RV.R7      p\        R4      pV P                  V4      '       g#   V \        V4      ,          \        P                  3# V P                  \
        4      '       g   R# V P                  \        WA,          4      4      pV'       dh   Wd,          P                  '       d4   \        R4       \        W&V,          ,           4      \        P                  3# \        WW#4      \        P                  3# V P                  \        WA,          4      V,          4      pV'       dc   Wd,          P                  '       d/   \        R4       \        We,          WWd,          ,           VRRR	7      # \        WW#4      \        P                  3# R# )
r  r   r   r  Nz*     rule: exp(-a*s) o---o DiracDelta(t-a)z5     rule: exp(-a*s)*F(s) o---o Heaviside(t-a)*f(t-a)FTr!  )r   r   r9   r   r   r&   r   r  ru   r  r#  )r   r|   r   r  r   r  r  s   &&&&   rm   _inverse_laplace_time_shiftr&  p  s   
 	S1#AS	A5588A&&55::
''#ac(
C
6?@aAh'//*1:AFFBB
''#ac(1*
C
6JK-SV8UUtM M +1:AFFBBrp   c                   V P                  V4      '       g#   V \        V4      ,          \        P                  3# \	        V P
                  ;p4      ^8X  d   \        RV.R7      pV^ ,          P                  W,
          4      ;p'       dw   \        We,          4      P                  '       dV   \        R4       \        We,          ) V,          4      \        V P                  V4      WV4      ,          \        P                  3# R# )r  r   r   z&     rule: F(s-a) o---o exp(-a*t)*f(t)N)r   r9   r   r   r5  ri   r   r   r    r   ru   r&   r  rl   )r   r|   r   r  ri   r   r  s   &&&&   rm   _inverse_laplace_freq_shiftr(    s    
 5588A&&
166>4aqc"q'--$$B$"RU)*?*?*?;<RUF1H'q	1?@ABI I rp   c           	        \        RV.R7      p\        R4      pV P                  W,          V,          4      pV'       d   Wd,          P                  '       d   Wd,          P                  '       d   \	        R4       \        We,          WVRRR7      w  rxVP                  \        V4      ^4      pVP                  \        4      '       d   \        WrWd,          4      V3# \        V4      \        WrWd,          4      ,          V3# R# )	r  r   r   r  z+     rule: s**n*F(s) o---o diff(f(t), t, n)FTr!  N)r   r   rm  r   ru   r#  r   r:   r   r  r   )	r   r|   r   r  r   r  r  r   r   s	   &&&&     rm   _inverse_laplace_time_diffr*    s    
 	S1#AS	A
''!$q&/C
sv   SV%7%7%7<=)FA%%DBIIilA&55())cf%q((Q<Q36 22A55rp   c           	     4G  aa \        RV.R7      p\        RV.R7      o\        RV.R7      p\        RV.R7      oRp\        P                  pV P                  4       pV U	u. uF.  qP	                  WAV,          ,          S,           S,          4      NK0  	  p
p	RV
9   d   R# \        P
                  p. p. p. pV
 F  pW,          ^ 8X  d   W,          pK  VS,          P                  '       d   VP                  V4       KF  VS,          P                  '       d   VP                  V4       Kr  VP                  V4       K  	  \        VVV3R lR7      p\        VVV3R	 lR7      p\        V4      ^ 8w  d   R# \        V4      ^8X  Ed#   \        V4      ^ 8X  Ed   V^ ,          S,          R8X  d   V^ ,          V,          \        P                  8X  d   V^ ,          S,          V^ ,          V,          ,          p^V^ ,          V,          ,          V,          pVP                  '       d~   V\        \        4      ,          \        V4      ,          VV,          \        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ,
          p\!        R
4       E MV^ ,          S,          R 8X  Ed>   V^ ,          V,          \        P                  8X  Ed   V^ ,          S,          V^ ,          V,          ,          pV^,          p^V^ ,          V,          ^,          ,          V,          pVP                  '       d   V^^\        \        4      ,          \        V4      ,          \        V4      ,          ,
          ^^V,          V,          ,
          \        VV,          4      ,          \#        \        V4      \        V4      ,          4      ^,
          ,          ,           ,          p\!        R4       EMV^ ,          S,          R!8X  EdF   V^ ,          V,          \        P                  8X  Ed"   V^ ,          S,          V^ ,          V,          ,          p^V^ ,          V,          ^,          ,          V,          pVP                  '       d   V^\        \        4      ,          V^,          V,          ^,           ,          \        V4      ,          VV,          \        V^,          V,          4      ,          ^V^,          ,          V,          ^,           ,          \        V\        V4      ,          4      ,          ,
          ,          p\!        R4       EM*V^ ,          S,          R"8X  Ed   V^ ,          V,          \        P                  8X  Edi   V^ ,          S,          V^ ,          V,          ,          p^V^ ,          V,          ^,          ,          V,          ^,          pVP                  '       Ed   VV^V^,          ,          V^,          ,          ^V^,          ,          V,          ,           ^,           ,          \        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ^\        \        4      ,          V^,          ,          V\        ^4      ^,          ,          ,          ^V^,          ,          V,          ^,           ,          ,
          ,          p\!        R4       EMV^ ,          S,          \        P                  ) 8X  d   V^ ,          V,          ^8X  d{   \        V^ ,          S,          V^ ,          V,          ,          4      p^\        V^ ,          V,          4      ,          V,          pV\%        ^ VV,          4      ,          p\!        R4       EM\        V4      ^8X  Ed9   \        V4      ^8X  Ed(   V^ ,          S,          R!8X  Ed   V^ ,          V,          \        P                  8X  Ed_   V^ ,          S,          \        P                  8X  Ed;   V^ ,          S,          ^ 8X  Ed%   V^ ,          S,          p\        V^ ,          V,          4      V^ ,          V,          ,          V,          pV^V^,          ,          V^,          ,          ^V^,          ,          V,          ,           ^,           ,          \        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ^\        \        4      ,          V,          V^,          V,          ^,           ,          \        V4      ,          ,
          p\!        R4       V^ ,          S,          R8X  Edx   V^ ,          V,          ^8X  Edb   V^ ,          S,          \        P                  8X  Ed>   V^ ,          V,          ^8X  Ed(   V^ ,          S,          V^ ,          V,          ,          pV^ ,          S,          V^ ,          V,          ,          p\        V^ ,          V,          4      V^ ,          V,          ,          V,          pV\        V) V,          4      \        V4      ,          \        \        4      ,          \        VV,
          4      \        V) V,          4      ,          \#        \        VV,
          4      \        V4      ,          4      ,          ,           ,          p\!        R4       EM\        V4      ^8X  Ed   \        V4      ^ 8X  Ed   V^ ,          S,          R8X  Ed8   V^ ,          V,          ^8X  Ed"   V^,          S,          \        P                  ) 8X  d   V^,          V,          ^8X  d   V^,          S,          ^ 8X  d   V^ ,          S,          ) V^ ,          V,          ,          p^\        V^,          V,          4      ,          V^ ,          V,          ,          V,          pVP                  '       d^   V\        V4      ,          \        VV,          4      ,          \#        \        V4      \        V4      ,          4      ,          p\!        R4       EMV^ ,          S,          R8X  Ed)   V^ ,          V,          ^8X  Ed   V^ ,          S,          ^ 8X  d   V^,          S,          R8X  d   V^,          V,          \        P                  8X  d   V^,          S,          V^,          V,          ,          p^V^ ,          V,          ,          V^,          V,          ,          V,          V,          pVP                  '       dS   V^\        V^,          V,          4      \        V\        V4      ,          4      ,          ,
          ,          p\!        R4       EMV^ ,          S,          R8X  Ed3   V^ ,          V,          \        P                  8X  Ed   V^,          S,          \        P                  ) 8X  d   V^,          V,          ^8X  d   V^,          S,          ^ 8X  d   V^ ,          S,          V^ ,          V,          ,          p^V^ ,          V,          \        V^,          V,          4      ,          ,          V,          pVP                  '       dL   V\        V^,          V,          4      ,          \        V\        V4      ,          4      ,          p\!        R4       EMV^ ,          S,          \        ^4      ) ^,          8X  Ed|   V^ ,          V,          ^8X  Edf   V^ ,          S,          ^ 8X  EdP   V^,          S,          R8X  Ed:   V^,          V,          \        P                  8X  Ed   V^,          S,          V^,          V,          ,          p^V^ ,          V,          \        ^4      ^,          ,          V^,          V,          ,          ,          V^,          ,          V,          pVP                  '       d   V^\        \        4      ,          V,          \        V4      ,          \        V^,          V,          4      \        V\        V4      ,          4      ,          ,           ^,
          ,          p\!        R4       EMV^ ,          S,          R 8X  Ed   V^ ,          V,          \        P                  8X  Edq   V^,          S,          R8X  Ed[   V^,          V,          ^8X  EdE   V^,          S,          ^ 8X  Ed/   V^ ,          S,          V^ ,          V,          ,          pV^,          p^V^ ,          V,          ^,          ,          V^,          V,          ,          V,          pVP                  '       d   V^V,          ^V,          ^V,          ,
          \        VV,          4      ,          \        \        V4      \        V4      ,          4      ,          ,           ^\        \        4      ,          \        V4      ,          \        V4      ,          ,
          ,          p\!        R4       EMIV^ ,          S,          R 8X  Ed}   V^ ,          V,          \        P                  8X  EdY   V^,          S,          \        P                  ) 8X  Ed4   V^,          V,          ^8X  Ed   V^,          S,          ^ 8X  Ed   V^ ,          S,          V^ ,          V,          ,          p^V^ ,          V,          ^,          ,          \        V^,          V,          4      ,          V,          pVP                  '       d   V^\        \        4      ,          \        V4      ,          ^V,          V,          \        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ,
          ,          p\!        R4       EMV^ ,          S,          R!8X  Edq   V^ ,          V,          \        P                  8X  EdM   V^,          S,          \        P                  ) 8X  Ed(   V^,          V,          ^8X  Ed   V^,          S,          ^ 8X  d   V^ ,          S,          pV\        V^,          V,          4      ,          V^ ,          V,          ,          pV^V^,          ,          V,          ^,           V,          \        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ^\        \        4      ,          V,          V\        ^4      ^,          ,          ,          ,
          ,          p\!        R4       EM1V^ ,          S,          R8X  EdC   V^ ,          V,          ^8X  Ed-   V^,          S,          \        P                  ) 8X  Ed   V^,          V,          ^8X  d   V^ ,          S,          V^ ,          V,          ,          pV^,          S,          V^,          V,          ,          pV\        V^,          V,          4      ,          V^ ,          V,          ,          pV^\        VV,
          4      ,          \        V) V,          4      ,          \#        \        VV,
          4      \        V4      ,          4      ,          ,          p\!        R4       EM\        V4      ^8X  Edh   \        V4      ^8X  EdW   V^ ,          S,          R8X  EdE   V^ ,          V,          ^8X  Ed/   V^,          S,          R8X  Ed   V^,          V,          \        P                  8X  Ed   V^ ,          S,          \        P                  8X  Ed   V^ ,          V,          ^8X  Ed   V^ ,          S,          ^ 8X  Ed   V^,          S,          V^,          V,          ,          pV^,          pV^ ,          S,          ) V^ ,          V,          ,          p\        V^ ,          V,          4      V^ ,          V,          ,          V^,          V,          ,          VV,
          ,          V,          pVP                  '       d   VP                  '       d   VV\        VV,          4      ,          \        \        V4      \        V4      ,          4      ,          \        V4      \        V4      ,          \        VV,          4      ,          \        \        V4      \        V4      ,          4      ,          ,           V\        VV,          4      ,          ,
          ,          p\!        R4       E
M[V^ ,          S,          R8X  Ed   V^ ,          V,          ^8X  Ed~   V^ ,          S,          ^ 8X  Edh   V^,          S,          R8X  EdR   V^,          V,          \        P                  8X  Ed.   V^ ,          S,          ^8X  Ed   V^ ,          V,          \        P                  8X  d   V^ ,          S,          V^ ,          V,          ,          pV^,          S,          V^,          V,          ,          pVV,           ^ 8X  d   V^ ,          V,          V^ ,          V,          ,          V^,          V,          ,          V,          pV^\        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ^,
          ,          p\!        R4       EMV^,          S,          R8X  Ed   V^,          V,          ^8X  Ed   V^,          S,          ^ 8X  Ed   V^ ,          S,          R 8X  Ed   V^ ,          V,          \        P                  8X  Ed   V^ ,          S,          ^8X  Edn   V^ ,          V,          \        P                  8X  EdJ   V^ ,          S,          V^ ,          V,          ,          pV^ ,          S,          V^ ,          V,          ,          pVV,           ^ 8X  d   V^ ,          V,          ^,          V^,          V,          ,          V^ ,          V,          ^,          ,          V,          pV^^V^,          ,          V,          \        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ,           ^\        \        4      ,          V,          \        V4      ,          ,
          ,          p\!        R4       EMV^,          S,          R8X  Ed=   V^,          V,          ^8X  Ed'   V^,          S,          ^ 8X  Ed   V^ ,          S,          R!8X  Ed   V^ ,          V,          \        P                  8X  Ed   V^ ,          S,          ^8X  Ed   V^ ,          V,          \        P                  8X  Ed   V^ ,          S,          V^ ,          V,          ,          pV^ ,          S,          V^ ,          V,          ,          pVV,           ^ 8X  EdD   V^ ,          V,          ^,          V^,          V,          ,          V^ ,          V,          ^,          ,          V,          pV^^V^,          ,          V^,          ,          ^V^,          ,          V,          ,           ^,           ,          \        V^,          V,          4      ,          \        V\        V4      ,          4      ,          ^\        \        4      ,          V,          \        V4      ,          ^V^,          ,          V,          ^,           ,          ,
          ^,
          ,          p\!        R4       EM_\        V4      ^8X  EdO   \        V4      ^ 8X  Ed>   V^ ,          S,          R8X  Ed   V^ ,          S,          ^ 8X  Ed   V^ ,          V,          ^8X  Ed   V^,          S,          R8X  Ed{   V^,          V,          ^8X  Ede   V^,          S,          \        P                  ) 8X  Ed@   V^,          V,          ^8X  Ed*   V^,          S,          ) V^,          V,          ,          p^V^ ,          V,          ,          V^,          V,          ,          \        V^,          V,          4      ,          V,          pVP                  '       d   VV\        ^4      ) ^,          ,          \        VV,          4      ,          \#        \        V4      \        V4      ,          4      ,          ^V,          \        \        4      ,          \        V4      ,          ,
          ,          p\!        R4       EMkV^ ,          S,          R8X  EdV   V^ ,          V,          ^8X  Ed@   V^,          S,          R8X  Ed*   V^,          V,          \        P                  8X  Ed   V^,          S,          \        P                  ) 8X  Ed   V^,          V,          ^8X  Ed   V^,          S,          ^ 8X  Ed   V^,          S,          V^,          V,          ,          pV^,          pV^ ,          S,          ) V^ ,          V,          ,          p^V^ ,          V,          ,          V^,          V,          ,          \        V^,          V,          4      ,          \        V4      VV,
          ,          ,          pVP                  '       d   VP                  '       d   V\        V4      \        VV,          4      ,          \        \        V4      \        V4      ,          4      ,          \        V4      \        VV,          4      ,          \#        \        V4      \        V4      ,          4      ,          ,           \        V4      \        VV,          4      ,          ,
          ,          p\!        R4       Vf   R# \'        V4      V,          V3# u up	i )#r  r   r   r   r   r   Nc                 >   < V S,          V S,          ^ 8g  V S,          3# r   rq   r   r   r   s   &rm   r   -_inverse_laplace_irrational.<locals>.<lambda>      1qtqy!A$(?rp   r   c                 >   < V S,          V S,          ^ 8g  V S,          3# r   rq   r-  s   &rm   r   r.    r/  rp   z     rule 5.3.4z     rule 5.3.10z     rule 5.3.13z     rule 5.3.16z     rule 5.3.35/44z     rule 5.3.14z     rule 5.3.22z     rule 5.3.1z     rule 5.3.5z     rule 5.3.7z     rule 5.3.8z     rule 5.3.11z     rule 5.3.12z     rule 5.3.15z     rule 5.3.23z     rule 5.3.6z     rule 5.3.17z     rule 5.3.18z     rule 5.3.19z     rule 5.3.2z     rule 5.3.9r   r   )r   r   r   as_ordered_factorsr   r   r   r"  r  sortedr5  r   r.   r   r&   r<   ru   r;   r6   r:   )r  r|   r   r  r   r   rk   r  far   r  	constantszerospolesrestr%  r   k_a_sqb_a_numr   r   s   &&&&                 @@rm   _inverse_laplace_irrationalr>    s    	S1#AS1#AS1#AS1#AFI				 B*,	-"Q''1T6!8a-
 "B	-rzIEED7a<!I!W   LL!W   LLKK  5?@E5?@E
4yA~
5zQ3u:?8A;"q!!6q!U1Xa[(B58A;y(B~~~tBxKQ'rE#b!eAg,&tBtAwJ'778  ()1Xa[B58A;!&&#88A;uQx{*DqB58A;>!)+BAd2hJtBx/Q771R463r!t9,c$r(472B.CA.EFG H  )*1Xa[B58A;!&&#8q!U1Xa[(B58A;>!)+B~~~$r(
BE!GAI.tAw61SQq\)1RU719Q;7RQZ8HHI J  )*1Xa[B58A;!&&#8q!U1Xa[(B58A;>!)+A-B~~~1RU71a4<2q5
2145c"a%'lBRQZ()$r(
2q5(QqT!V4aAgaikBC D  )*1Xa[QVVG#aq(8eAhqk%(1+-.B4a$$Y.B'!RT*+F()	UqSZ1_ar!eAhqkQVV&;aqvv%%(1+*: q!BeAhqk"58A;.y8BAb!eGAqDL2q5*1,-c"a%'l:RQZ !#$T"X:b="a%'!)#<T!W#DE  %&ar!eAhqkQ&6aqvv%%(1+*: q!U1Xa[(Bq!U1Xa[(BeAhqk"58A;.y8BCAJtAw&tBx/RUAJ1"42;tAw#6718 8 9  %&	UqSZ1_ar!eAhqkQ&6aw&58A;!+;aq  (1+eAhqk)B4a$$U1Xa[0:B~~~T"X+c"Q$i/DHT!W4D0EE()ar!eAhqkQ&658A;!;Kar!eAhqkQVV&; q!U1Xa[(B58A;uQx{*2-i7B~~~Qs2q57|DDG,<<<=()ar!eAhqkQVV&;aw&58A;!+;aq  q!U1Xa[(BE!HQKU1Xa[ 1129<B~~~CAaLbaj)99()a!uQw&58A;!+;aq U1Xa[B%6aqvv%
 q!U1Xa[(BE!HQK!A$q&)%(1+56r1u<YFB~~~$r(
2d1g-c"a%'l447
;K.KKAMN ()ar!eAhqkQVV&;ar!eAhqkQ&6aq  8A;uQx{*DqB58A;>!%(1+-i7B"!AbD#bd)3Db$q'9I4JJJ$r(
48+DG34 5  )*ar!eAhqkQVV&;aw&58A;!+;aq  q!U1Xa[(B58A;>!$uQx{"33I=B~~~$r(
47*"Qs2q57|+DDG,<<= >  )*ar!eAhqkQVV&;aw&58A;!+;aq  q!B4a,,U1Xa[8B2q51aBE!G,T"T!W*-==$r(
2a!A$q&k)*+F %&ar!eAhqkQ&6aw&58A;!+; q!U1Xa[(Bq!U1Xa[(B4a,,U1Xa[8B$r"u+c2#a%j(T"R%[a-@)AACF%&	UqSZ1_ar!eAhqkQ&6ar!eAhqkQVV&;aqvv%%(1+*:aq  8A;uQx{*DqB(1+eAhqk)BeAhqk"58A;.uQx{:BrEB9LBBNNNs2a4yLd2htAw&6!77HT"X%c"Q$i/T"Xd1g5E0FFGs2a4yL!" ()ar!eAhqkQ&6aq U1Xa[B%6aqvv%%(1+*:aqvv% !HQKa+Eq!U1Xa[(B%x1}1Xa[q!,U1Xa[8Bc"a%'lN447
#33A57)*ar!eAhqkQ&6aq U1Xa[B%6aqvv%%(1+*:aqvv% !HQKa+Eq!U1Xa[(B%x1}1Xa[!^E!HQK/aQ>yH"a%	#b!eAg,.tBtAwJ/???d2hJrM$q')*+ )*ar!eAhqkQ&6aq U1Xa[B%6aqvv%%(1+*:aqvv% !HQKa+Eq!U1Xa[(B%x1}1Xa[!^E!HQK/aQ>yHqQwq!t|Ab!eGAI-a/0RU1W=DG$%%&tBxZ]47%:Ab!eGAIaK%HIIJKL )*	UqSZ1_ar!eAhqkQ&658A;!;Kar!eAhqkQ&6aw&58A;!+; (1+eAhqk)B58A;uQx{*4a+<<YFB~~~!A$qMC1I-DHT!W4D0EEbDbM$q')*+ ()ar!eAhqkQ&6ar!eAhqkQVV&;aw&58A;!+;aq  8A;uQx{*DqB(1+eAhqk)B%(1+eAhqk)$uQx{*;;b2b5!#  BNNNHSAY&tDHT!W,<'==HSAY&s48DG+;'<<=HSAY&'( ()~|F"I--Q	 
.s   !4BNc                H    \         .pV F  pV! WW#4      ;pf   K  Vu # 	  R# r  N)r>  r   r|   r   r  r  r  r   s   &&&&   rm   !_inverse_laplace_early_prog_rulesrB    s2    
 ..Ja''A4H  rp   c                p    \         \        \        \        \        .pV F  pV! WW#4      ;pf   K  Vu # 	  R# r@  )r&  r(  r*  r$  r>  rA  s   &&&&   rm   !_inverse_laplace_apply_prog_rulesrD    sB    
 ./J,.C-/J a''A4H  rp   c           	        V P                   '       d   R# \        V RR7      pVP                   '       d   \        WAW#RRR7      # \        V 4      pVP                   '       d   \        WAW#RRR7      # \        V 4      pVP                   '       d   \        WAW#RRR7      # V P	                  V4      '       d    V P                  V4      P                  4       pVP                   '       d   \        WAW#RRR7      # R# )r  NFr  Tr!  )r  r
   r#  r   r	  r
  r  )r  r|   r   r  r   s   &&&& rm   _inverse_laplace_expandrF    s    
 
yyyrAxxx)!Ut= 	=2Axxx)!Ut= 	=r
Axxx)!Ut= 	=	q!!HHQKxxx)!Ut= 	=rp   c          
        \        R4      pV P                  V4      p\        P                  ! V4      p. p\        P
                  .p	V EF  p
V
P                  4       w  rVP                  V4      P                  4       pV^ ,          pV Uu. uF  qV,          NK  	  ppVP                  V4      P                  4        Uu. uF  qV,          NK  	  pp\        V4      ^8X  d`   \        V4      ^,
          p\        V4       F<  pV^,          \        VVV^ ,          ,
          4      ,          pVP                  V4       K>  	  K  \        V4      ^8X  dM   V^ ,          \        V^,          ) V,          4      ,          pVP                  \        V4      V,          4       EKT  \        V4      ^8X  EdA   V^,          ^,          pV^,          V^,          ,
          P                  4       p\        V4      ^8X  d   \        P                   .V,           p\#        V4      w  ppV^ 8X  d@   VV,          V^VV,          ,
          ,          ,           \        V) V,          4      ,          pEMkRpVP$                  '       d   V) pRp\'        \)        V^,          V,
          V4      P+                  4       4      ^ ,          p\-        V4      P/                  4       pV'       d~   V\        V) V,          4      ,          \1        VV,          4      ,          VVV,          ,
          V,          \        V) V,          4      ,          \3        VV,          4      ,          ,           pM|V\        V) V,          4      ,          \5        VV,          4      ,          VVV,          ,
          V,          \        V) V,          4      ,          \7        VV,          4      ,          ,           pVP                  \        V4      V,          4       EK  \9        WW#VRR7      w  ppVP                  V4       V	P                  V4       EK  	  \        V!  pV'       d   VP/                  RR7      pV\;        V	!  3# u upi u upi )r  x_FTr!  r  )r   r
  r   r!  r   r   r  r   rr  r5  	enumerater9   r"  r&   r:   r  r   tupler  r   rP   r  r.   r   r(   r*   r1   r2   r#  rL   )r  r|   r   r  r   rH  r   r  r  r  r%  r   r   rE  dc_leadr   r7  rz  r   r   r   r   lr   hypb2bsr  r   rk   s   &&&&$                         rm   _inverse_laplace_rationalrP  (  sH   
 
B
AMM!EG&&J$$&YYq\$$&Q%!#$Aii$!"1!8!8!:;!:Aii!:;r7a<B	Ar]aDAq1v..q! # W\1c2a5&(m#ANN9Q<>*W\1aAAq!t##%A2w!|ffX]9DAqAvqSAacE]C1I-===AC%Aa,1134Q7!W%%'#qbd)DAJ.!AaC%2r!t92%%)"Q$Z20 0  #qbd)C1I-1Q3
3r!t90DSAY0NNANN9Q<>*1HHHBNN2d#Q T ']Fe,3
###S %;s   
Q>Qc          	     .  a \         P                  ! V 4      p. p. pV EF  p	V	P                  \        4      '       d3   V	P	                  SS) 4      P                  4       P	                  SS) 4      p	V	P                  SRR7      w  rV'       d,   V	P                  S4      '       d   \        VSW#VR7      ;p fI   \        VSV4      ;p f7   \        VSW#4      ;p f%   \        VSW#4      ;p f   \        VSW#4      ;p e   M\        ;QJ d2    V3R lVP                  \        4       4       F  '       g   K   RM'	  RM#! V3R lVP                  \        4       4       4      '       d   \!        VSW#4      \"        P$                  3pM2\'        VSW#VR7      ;p e   M\!        VSW#4      \"        P$                  3pVw  rVP)                  W,          4       VP)                  V4       EK  	  \        V!  pV'       d   VP+                  RR7      p\-        V!  pVV3# )z
Front-end function of the inverse Laplace transform. It tries to apply all
known rules recursively.  If everything else fails, it tries to integrate.
Fr  r  c              3   D   <"   T F  qP                  S4      x  K  	  R # 5ir   r  )r   r  r   s   & rm   r   -_inverse_laplace_transform.<locals>.<genexpr>  s     B,A52,Ar  Tr  )r   r!  r   r&   r   rR   r  r	  rP  r  rB  rF  rD  r  r   r   r  r   r   rb   r"  r   rL   )r  r   rg  r  r   r"  r  r  r  r%  r*  r   r   r  r  rk   r  s   &f&&$$           rm   r#  r#  b  s    MM"EGJ88C== 99R"%..055b2#>D""2e"4t88<</r2x9 9 :!RDD72rII-aR??72rIISBAGGL,ABSSSBAGGL,ABBB )B:AFFCA;r2x9 9AEF (B:AFFCA
qu#K N ']Fe,Z I9rp   c                   p   a  ] tR tRt o RtRt]! R4      t]! R4      tR t	]
R 4       tR tR	 tR
 tRtV tR# )r  i  z
Class representing unevaluated inverse Laplace transforms.

For usage of this class, see the :class:`IntegralTransform` docstring.

For how to compute inverse Laplace transforms, see the
:func:`inverse_laplace_transform` docstring.
zInverse LaplaceNoner   c                \    Vf   \         P                  p\        P                  ! WW#V3/ VB # r   )r  _none_sentinelrF   __new__)r   r   r|   r   r  optss   &&&&&,rm   rX  InverseLaplaceTransform.__new__  s,    =+::E ((uEEErp   c                X    V P                   ^,          pV\        P                  J d   RpV# )   N)ri   r  rW  )r  r  s   & rm   fundamental_plane)InverseLaplaceTransform.fundamental_plane  s(    		!+:::Erp   c                0    \        WW0P                  3/ VB # r   )rb   r]  )r  r   r|   r   r  s   &&&&,rm   r  *InverseLaplaceTransform._compute_transform  s"    5!++6/46 	6rp   c                   V P                   P                  p\        \        W#,          4      V,          W$\        P
                  \        P                  ,          ,
          V\        P
                  \        P                  ,          ,           34      ^\        P                  ,          \        P
                  ,          ,          # )   )	__class___crD   r&   r   ImaginaryUnitr   Pi)r  r   r|   r   r   s   &&&& rm   r  $InverseLaplaceTransform._as_integral  ss    NNSXaZ!)C%C"#aooajj&@"@"B CqttVAOO#%	&rp   c           	     H   VP                  RR4      pVP                  RR4      p\        RV P                  V P                  V P                  34       V P                  pV P                  pV P                  pV P
                  p\        WdWWVRR7      pV'       d
   V^ ,          # V# )r  r  Tr   Fz[ILT doit] (%s, %s, %s)r!  )r  rW   r  r  r  r]  r#  )	r  r  r  rE   r   rg  r  r  r   s	   &,       rm   r  InverseLaplaceTransform.doit  s     99Y-IIj%0	(4==+/+A+A+/+B+B+D 	E ##$$]]&&&B	dD Q4KHrp   rq   N)rh   r  r  r  r  r  r   rW  rd  rX  propertyr]  r  r  r  r  r  r  s   @rm   r  r    sQ      E6]N	sBF
  6& rp   r  c                .  aaaa SP                  RR4      pSP                  RR4      p\        V \        4      '       d+   \        V R4      '       d   V P	                  VVVV3R l4      # \        V SSS4      P                  RVR7      w  rxV'       d   V# Wx3# )a  
Compute the inverse Laplace transform of `F(s)`, defined as

.. math ::
    f(t) = \frac{1}{2\pi i} \int_{c-i\infty}^{c+i\infty} e^{st}
    F(s) \mathrm{d}s,

for `c` so large that `F(s)` has no singularites in the
half-plane `\operatorname{Re}(s) > c-\epsilon`.

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

The plane can be specified by
argument ``plane``, but will be inferred if passed as None.

Under certain regularity conditions, this recovers `f(t)` from its
Laplace Transform `F(s)`, for non-negative `t`, and vice
versa.

If the integral cannot be computed in closed form, this function returns
an unevaluated :class:`InverseLaplaceTransform` object.

Note that this function will always assume `t` to be real,
regardless of the SymPy assumption on `t`.

For a description of possible hints, refer to the docstring of
:func:`sympy.integrals.transforms.IntegralTransform.doit`.

Examples
========

>>> from sympy import inverse_laplace_transform, exp, Symbol
>>> from sympy.abc import s, t
>>> a = Symbol('a', positive=True)
>>> inverse_laplace_transform(exp(-a*s)/s, s, t)
Heaviside(-a + t)

See Also
========

laplace_transform
hankel_transform, inverse_hankel_transform
r  Tr   Fr  c                 "   < \        V SSS3/ SB # r   )inverse_laplace_transform)Fijr  r  r|   r   s   &rm   r   +inverse_laplace_transform.<locals>.<lambda>	  s    1#q!ULeLrp   r  )r  r   rM   r  r  r  r  )	r   r|   r   r  r  r  rE   r   r   s	   &fffl    rm   rm  rm    s    Z yyD)H		*e,I!Z  WQ%<%<{{LN 	N #1aE277	 8 +DA trp   c                   aaaaaaaaa	a
 \        R\        S.R7      w  oo	o
VVVVV3R loV3R loVV3R loVV	V
VV3R loV3R loS! V 4      # )zEFast inverse Laplace transform of rational function including RootSumza, b, nr   c                   < V P                  S4      '       g   V # V P                  '       d	   S! V 4      # V P                  '       d	   S! V 4      # V P                  '       d	   S! V 4      # \	        V \
        4      '       d	   S! V 4      # \        hr   )r   r  rq  ry   r   rS   NotImplementedError)e_ilt_add_ilt_mul_ilt_pow_ilt_rootsumr|   s   &rm   _ilt#_fast_inverse_laplace.<locals>._ilt#	  sk    uuQxxHXXXA;XXXA;XXXA;7##?"%%rp   c                 L   < V P                   ! \        SV P                  4      !  # r   )rl   mapri   )rs  rx  s   &rm   rt  '_fast_inverse_laplace.<locals>._ilt_add1	  s    vvs4())rp   c                 x   < V P                  S4      w  rVP                  '       d   \        hVS! V4      ,          # r   )r  rq  rr  )rs  r  r   rx  r|   s   &  rm   ru  '_fast_inverse_laplace.<locals>._ilt_mul4	  s3    &&q);;;%%tDz!!rp   c                   < V P                  SS,          S,           S,          4      pVe   VS,          VS,          VS,          rCpVP                  '       dV   V^ 8  dO   S	V) ^,
          ,          \        WC,          ) S	,          4      ,          W2) ,          \        V) 4      ,          ,          # V^8X  d!   \        WC,          ) S	,          4      V,          # \        hr   )r   
is_Integerr&   r?   rr  )
rs  r   nmambmr   r   r   r|   r   s
   &    rm   rv  '_fast_inverse_laplace.<locals>._ilt_pow:	  s    1q1%q58U1XBB}}}aB3q5z#hqj/12s75":3EFFQwRU8A:++!!rp   c                    < V P                   P                  pV P                   P                  w  p\        V P                  \        V\        S! V4      4      4      4      # r   )funr   	variablesrS   polyr   rR   )rs  r   variablerx  s   &  rm   rw  +_fast_inverse_laplace.<locals>._ilt_rootsumD	  s@    uuzzUU__
qvvvhd0DEFFrp   )r   r   )rs  r|   r   rx  rt  ru  rv  rw  r   r   r   s   &ff@@@@@@@@rm   _fast_inverse_laplacer  	  sI    iTA37GAq!& &*"" "G
 7Nrp   )Tr   )r  rf   rc   
sympy.corer   r   r   sympy.core.addr   sympy.core.cacher   sympy.core.exprr   sympy.core.functionr   r	   r
   r   r   r   r   r   r   r   sympy.core.mulr   r   sympy.core.relationalr   r   r   r   r   r   r   r   sympy.core.sortingr   sympy.core.symbolr   r   r   $sympy.functions.elementary.complexesr    r!   r"   r#   r$   r%   &sympy.functions.elementary.exponentialr&   r'   %sympy.functions.elementary.hyperbolicr(   r)   r*   r+   (sympy.functions.elementary.miscellaneousr,   r-   r.   $sympy.functions.elementary.piecewiser/   r0   (sympy.functions.elementary.trigonometricr1   r2   r3   r4   sympy.functions.special.besselr5   r6   r7   r8   'sympy.functions.special.delta_functionsr9   r:   'sympy.functions.special.error_functionsr;   r<   r=   'sympy.functions.special.gamma_functionsr>   r?   r@   rA   -sympy.functions.special.singularity_functionsrB   sympy.integralsrC   rD   r  rE   rF   rG   sympy.logic.boolalgrH   rI   rJ   rK   rL   sympy.matrices.matrixbaserM   sympy.polys.matrices.linsolverN   sympy.polys.polyerrorsrO   sympy.polys.polyrootsrP   sympy.polys.polytoolsrQ   sympy.polys.rationaltoolsrR   sympy.polys.rootoftoolsrS   sympy.utilities.exceptionsrT   rU   rV   sympy.utilities.miscrW   rd   rr   ru   r   r   ra   r   r   r  r  r  r  r&  r0  rc  rk  ro  r  r  r  r  r  r  r  r  rt  r  rb   r  r  r  r$  r&  r(  r*  r>  rB  rD  rF  rP  r#  r  rm  r  rq   rp   rm   <module>r     s    
     $  & & & %< < < & 2 25 5 ; I I C C$ I I M M I A A, , M /: : E E 0 6 2 ' & . +I I '	<EXv 6 6 lL lL^    	X) 	X)v  * & &R  , ) )X  $  @ I' I'X ; ;@  8 / /d  8  "  4 , ,^9x*Z @$ @$F5( 5pNb M4 M4`   	% 	%P  8     >     ( w. w.t	 	 	    4 6$ 6$r 5 5pD/ DN:z*rp   