Perhaps we just need to add some cases to manualintegrate to handle this. Aaron Meurer
On Mon, Jul 20, 2015 at 11:52 AM, Andrés Prieto <prieto.anei...@gmail.com> wrote: > Some weeks ago, we were working on a (dirty) patch to be able to compute > inverse Laplace transforms of exponentials in Octsympy ( > https://github.com/cbm755/octsympy/pull/261#issuecomment-122077921). The > trick is based on the linearity of the inverse Laplace transform and on the > expansion of all terms to be transformed in terms of exponentials. In what > follows, a code snippet is attached to illustrate its feasibility: > > import sympy as sp > > from sympy.abc import t, s, c > > > > F=5*sp.exp(-3*s)+2*sp.exp(c*s)-2*sp.exp(-2*s)/s > > > > f=0; a_ = sp.Wild("a_"); b_ = sp.Wild("b_") > > Fr=F.rewrite(sp.exp) > > if type(Fr)==sp.Add: > > terms=Fr.expand().args > > else: > > terms=(Fr,) > > for term in terms: > > #compute the Laplace transform for each term > > r=sp.simplify(term).match(a_*sp.exp(b_)) > > if r!=None and sp.diff(term,s)!=0: > > rlist=list(r.values()) > > modulus=rlist[0] > > phase=rlist[1]/s > > # if a is constant and b/s is constant > > if sp.diff(modulus,s)==0 and sp.diff(phase,s)==0: > > f = f + modulus*sp.DiracDelta(t+phase) > > else: > > f = f + sp.Subs(sp.inverse_laplace_transform(term, s, t),sp. > Heaviside(t),1).doit() > > elif sp.diff(term,s)==0: > > f = f + term*sp.DiracDelta(t) > > else: > > f = f + sp.Subs(sp.inverse_laplace_transform(term, s, t),sp. > Heaviside(t),1).doit() > > I hope that this approach could be helpful to handle Dirac deltas in > the context of (i)Laplace transforms. > > > > On Wednesday, 8 July 2015 09:19:56 UTC+2, Kalevi Suominen wrote: >> >> >> >> On Tuesday, July 7, 2015 at 9:31:41 PM UTC+3, Aaron Meurer wrote: >>> >>> More generally, SymPy's integrator doesn't know how to return delta >>> functions. It only knows how to deal with delta functions as arguments >>> to integrals. >> >> >> It would not be too hard to extend SymPy's integrator to return delta >> functions, >> their derivatives and even other tempered distributions. They can be >> represented >> as boundary values of analytic functions provided a suitable interface is >> defined. >> I have discussed this in a slightly different connection in #9483. >> >> There are more details in the attachment. >> >> -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/4c84d52b-894e-4bc8-bb0f-e187d69213ec%40googlegroups.com > <https://groups.google.com/d/msgid/sympy/4c84d52b-894e-4bc8-bb0f-e187d69213ec%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bx5UqcBt8cH6vtz6_w7SNQ_ZYFwodjMGROzFArOL36iA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.