Laplace transforms are something that SymPy doesn't do as well with as
it should. I tried to get a closed form version with exponentials by
using apart(full=True) and finding the transform of the individual
terms, but I ran into a bug
https://github.com/sympy/sympy/issues/19773.
I was able to workaround the bugs to get an answer with
>>> Add(*[inverse_laplace_transform(nsimplify(i), s, t) for i in Add.make_args(apart((equ_laplace), s, full=True).doit())])
(1398726960911182419102898085651241253403000977950623455914670 -
24878179654951949422367214210629217423593456535413826921554823*I)*exp(-482231200549273*t/1000000000000000
- 283089619304889*I*t/10000000000000000)/100000000000000000000000000000000000000000000000000000000000
+ (1398726960911182419102898085651241253403000977950623455914670 +
24878179654951949422367214210629217423593456535413826921554823*I)*exp(-482231200549273*t/1000000000000000
+ 283089619304889*I*t/10000000000000000)/100000000000000000000000000000000000000000000000000000000000
- 281057785843441*exp(-177038273656911*t/10000000000000)/10000000000000
+ 65620080368859*exp(-317102332103131*t/10000000000000000)/500000000000000
Aaron Meurer
On Tue, Jul 14, 2020 at 5:37 AM Javier Perez Rodriguez
<
jprgu...@gmail.com> wrote:
>
> Hello Aaron,
>
> First of all, thanks for your answer. As you suggested, here I bring a piece of code with one of the problematic equations (see Section PIECE OF CODE). As a result of certain computation, I get "equ_laplace" in the Laplace domain, then, when I try to move it to the Time domain the output is not a conventional equation (see Section OUTPUT). I have try either force " sym.inverse_laplace_transform()" not to use Meijerg to compute the solution or, reshape the Meijerg output to a conventional equation but with not success yet, unfortunately.
>
> ##### PIECE OF CODE ############
> import sympy as sym
>
> s = sym.Symbol('s')
> t = sym.Symbol('t', positive=True)
>
> # Equation in the Laplace domain
> equ_laplace = 470.0*s**2/(1.0*s**4 + 18.7*s**3 + 17.9*s**2 + 4.68*s + 0.131)
>
> # Moving to the Time domain
> equ_time = sym.inverse_laplace_transform(equ_laplace, s, t)
>
> print("equ_time =", equ_time)
> ##############################
>
> #### OUTPUT #################
> equ_time = 470.0*meijerg(((-16.7038273656911, 0, 0, 0.968289766789687, 0.517768799450727 - 0.0283089619304889*I, 0.517768799450727 + 0.0283089619304889*I), ()), ((), (-17.7038273656911, -0.031710233210313, 1, 1, -0.482231200549273 - 0.0283089619304889*I, -0.482231200549273 + 0.0283089619304889*I)), exp(t))
> ##############################
>
> Thank you for your time,
> Javier
>
> --
> 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+un...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/9f0eee0b-4fb6-4303-ba04-17266719fd13o%40googlegroups.com.