Please see the following (if you replace the '1' in hs with 'k', the
resulted form will be different).
from sympy import *
init_printing()
var('k p1 p2 t', real=True, positive=True)
var('s')
hs = 1 / ( (s + p1) * (s + p2) )
ht = inverse_laplace_transform(hs, s, t)
On Friday, January 1, 2016 at 6:58:43 PM UTC-5, Christophe Bal wrote:
>
> Can you give your code ?
> Le 1 janv. 2016 22:44, "Ken" <[email protected] <javascript:>> a écrit :
>
>> Hi thanks for your reply, but I am not sure what exactly do you mean by
>> expand "then to factorize".
>>
>> I found that if I set the transfer function to be H = k / ( (s+p1) *
>> (s+p2) ), then the inverse laplace transform becomes:
>>
>> k*e^(-p1*t) / (p1-p2) + k*e^(-p2*t) / (p1-p2)
>>
>> *which is what I prefer.* It is weird to me that adding a constant 'k'
>> change the form that Sympy chooses to show the result.
>>
>> On Friday, January 1, 2016 at 2:46:19 AM UTC-5, Christophe Bal wrote:
>>>
>>> Hello.
>>>
>>> Have you triez to expand 1nd then to factorize the formula ?
>>> Le 1 janv. 2016 03:42, "Ken" <[email protected]> a écrit :
>>>
>>>> I've just started learning Sympy. I wrote a few lines of code to
>>>> perform a inverse laplace transform on a simple 2nd order transfunction:
>>>>
>>>> H(s) = 1 / ((s+p1) * (s+p2)).
>>>>
>>>> The result I got from Sympy is
>>>>
>>>> (e^(p1*t) - e^(p2*t))*e^-t*(p1+p2) / (p1 - p2)
>>>>
>>>> Is there a way to simplify this result to the one like in Maxima
>>>> (e^-t*p1 + e^-t*p2) / (p1-p2) ?
>>>>
>>>> --
>>>> 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 [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/sympy.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/sympy/0b4a638b-b9d8-426d-99c3-12fdaf1cc973%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/sympy/0b4a638b-b9d8-426d-99c3-12fdaf1cc973%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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] <javascript:>
>> .
>> Visit this group at https://groups.google.com/group/sympy.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/f730ca86-6a64-4224-b039-2b7197fb68c7%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/sympy/f730ca86-6a64-4224-b039-2b7197fb68c7%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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/d100d452-3123-4c22-b54d-521a5b5c6ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.