GithubHelp home page GithubHelp logo

Comments (4)

oscarbenjamin avatar oscarbenjamin commented on June 8, 2024

CC @hanspi42

from sympy.

crgfn avatar crgfn commented on June 8, 2024

Another example:

from sympy import symbols, inverse_laplace_transform, expand
s, t = symbols('s t')
Fs = (20000.0*s**2 + 1600.0*s + 30.0)/(100000.0*s**4 + 48000.0*s**3 + 6930.0*s**2 + 281.0*s + 3.0)
Ft = inverse_laplace_transform(Fs, s, t)
print(expand(Ft))

Sympy output:
-7.52218450407113*exp(-0.223493475978327*t)*Heaviside(t) + 22.1739130434783*exp(-0.2*t)*Heaviside(t) + 0.0299800831746754*exp(-0.0395265172332464*t)*Heaviside(t) + 0.100900073070386*exp(-0.016980006788427*t)*Heaviside(t)

WolframAlpha (difference is in coefficient of 2nd exponential):

InverseLaplaceTransform[(20000.0 s^2 + 1600.0 s + 30.)/(100000.0 s^4 + 48000.0 s^3 + 6930.0 s^2 + 281. s + 3.), s, t]

-7.52218/E^(0.223493 t) + 7.3913/E^(0.2 t) + 0.0299801/E^(0.0395265 t) + 0.1009/E^(0.01698 t)

from sympy.

oscarbenjamin avatar oscarbenjamin commented on June 8, 2024

WolframAlpha produces 10 (instead of ~30) for first term.

Yes, that seems correct:

In [8]: apart(nsimplify(Fs), s)
Out[8]: 
      ⎛       220⋅⎝10000s  + 1800s + 5310
- ────────────────────────────── + ──
         3         2               s 
  20000s  + 5600s  + 266s + 3  

from sympy.

hanspi42 avatar hanspi42 commented on June 8, 2024

Thanks for reporting this!

This is the same as #25352, it has already been fixed in PR #25642, so it will be correct in SymPy 1.12.1.

from sympy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.