Some questions about Laplace transforms #24454
Replies: 2 comments
-
Can you try with the latest master branch from github? I get different results with master: In [1]: import sympy
In [2]: s = sympy.Symbol('s')
...: t = sympy.Symbol('t', real=True, positive=True)
...: w = sympy.Symbol('w', real=True, positive=True)
...:
...: # Calculate the following Laplace transforms ...
...: F1 = sympy.laplace_transform(sympy.sin(w*t)-w*t*sympy.cos(w*t), t, s)[0] # Shouldn't be 2*w**
...: 3 / ((s**2+w**2)**2) ???
...: F2 = sympy.laplace_transform(t*sympy.sin(w*t)/(2.0*w), t, s)[0] # is it correct that
...: F2 == F3,
...: F3 = sympy.laplace_transform(t*sympy.sin(w*t), t, s)[0] # and inverse tr
...: ansforms IF2 and IF3 are 0?
...: F4 = sympy.laplace_transform(t*sympy.cos(w*t), t, s)[0] # F4 is correct, but
...: what about inverse transform IF4?
...: # ... and use results as input for the following inverse transformations.
...: IF1 = sympy.inverse_laplace_transform(F1, s, t)
...: IF2 = sympy.inverse_laplace_transform(F2, s, t)
...: IF3 = sympy.inverse_laplace_transform(F3, s, t)
...: IF4 = sympy.inverse_laplace_transform(F4, s, t)
In [3]: for F in F1,F2,F3,F4: print(F)
2*w**3/(s**4 + 2*s**2*w**2 + w**4)
1.0*s/(s**4 + 2*s**2*w**2 + w**4)
2*s*w/(s**4 + 2*s**2*w**2 + w**4)
(s**2 - w**2)/(s**4 + 2*s**2*w**2 + w**4)
In [4]: for IF in IF1,IF2,IF3,IF4: print(IF)
-t*w*cos(t*w) + sin(t*w)
0.5*t*sin(t*w)/w
t*sin(t*w)
t*cos(t*w) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Nothing happens here anymore ;) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Gents,
I'm quite new to Sympy, so I may do something wrong in the following code.
I'm doing some tests with Laplace transforms (version 1.11.1), but I cannot understand some results commented in the following code.
At the bottom of the code section I pasted the output.
Any comments on this results?
Best Regards
Ettore
Code:
`
import sympy
def check_sympy_laplace_transform():
check_sympy_laplace_transform()
-----------------------------------------------------------------
OUTPUT:
F1 => (s2*w + s2 + w3 - w2)/(s4 + 2*s2*w2 + w4)
F2 => 2sw/(s4 + 2*s2*w2 + w4)
F3 => 2sw/(s4 + 2*s2*w2 + w4)
F4 => (s2 - w2)/(s4 + 2*s2*w2 + w4)
-----------------------------------------------------------------
IF1 => (w + 1)sin(tw)/w
IF2 => 0
IF3 => 0
IF4 => sin(t*w)/w
`
Beta Was this translation helpful? Give feedback.
All reactions