ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 17 Apr 2018 19:29:21 +0200I want convert laplace function into partial fractions like k1/(s+s1) + k2/(s+s2)https://ask.sagemath.org/question/42063/i-want-convert-laplace-function-into-partial-fractions-like-k1ss1-k2ss2/ I have a expression in 's' domain: I(s)= Ip.(s-A)/(s^2+Bs+C)
I want to convert to partial fractions like: I(s)= k1/(s-s1) + k2/(s-s2)
and finally use in time domain as: i(t)=k1.exp(s1.t-t0) + k2.exp(s2t-t0)
thank you for your attentionTue, 17 Apr 2018 17:17:39 +0200https://ask.sagemath.org/question/42063/i-want-convert-laplace-function-into-partial-fractions-like-k1ss1-k2ss2/Comment by slelievre for <p>I have a expression in 's' domain: I(s)= Ip.(s-A)/(s^2+Bs+C)
I want to convert to partial fractions like: I(s)= k1/(s-s1) + k2/(s-s2)
and finally use in time domain as: i(t)=k1.exp(s1.t-t0) + k2.exp(s2t-t0)
thank you for your attention</p>
https://ask.sagemath.org/question/42063/i-want-convert-laplace-function-into-partial-fractions-like-k1ss1-k2ss2/?comment=42073#post-id-42073Welcome to Ask Sage! Thank you for your question!Tue, 17 Apr 2018 17:56:29 +0200https://ask.sagemath.org/question/42063/i-want-convert-laplace-function-into-partial-fractions-like-k1ss1-k2ss2/?comment=42073#post-id-42073Answer by John Palmieri for <p>I have a expression in 's' domain: I(s)= Ip.(s-A)/(s^2+Bs+C)
I want to convert to partial fractions like: I(s)= k1/(s-s1) + k2/(s-s2)
and finally use in time domain as: i(t)=k1.exp(s1.t-t0) + k2.exp(s2t-t0)
thank you for your attention</p>
https://ask.sagemath.org/question/42063/i-want-convert-laplace-function-into-partial-fractions-like-k1ss1-k2ss2/?answer=42082#post-id-42082Is this what you want?
sage: var('s')
s
sage: var('t')
t
sage: L = (s-3)/(s^2-3*s+2)
sage: L.partial_fraction()
2/(s - 1) - 1/(s - 2)
sage: L.inverse_laplace(s,t)
-e^(2*t) + 2*e^t
sage: L.partial_fraction().inverse_laplace(s,t)
-e^(2*t) + 2*e^t
Once you have an expression like `L = (s-3)/(s^2-3*s+2)`, if you type `L.<TAB>`, it will produce a list of all of the available methods. In this case there are a lot of possibilities, but `inverse_laplace` and `partial_fraction` are two of them. (If you can guess that something like `partial_fraction` might be there, you can also type `L.p<TAB>` or `L.pa<TAB>` to get a much shorter list.) You can also evaluate `L.inverse_laplace?` to get documentation.Tue, 17 Apr 2018 19:29:21 +0200https://ask.sagemath.org/question/42063/i-want-convert-laplace-function-into-partial-fractions-like-k1ss1-k2ss2/?answer=42082#post-id-42082