Chapter 17 : The Laplace Transform Method

Example 17.2 Page No : 327

In [1]:
from sympy.abc import t,s
import math

x = 3*math.e**(2*t)
print  " X(s) = " ,x
 X(s) =  3*2.71828182845905**(2*t)

Example 17.4 Page No : 330

In [3]:
import math 
from sympy.abc import t,s

#Factorizing the denominator
I = (s-10)/((s**2)*(s-1j)*(s+1j));
print "I(s) = ",I
#The principal part at s = 0 is
#B1/s+B2/s**2
#Taking the limit s->0 to (s-10)/((s-1j)*(s+1j))

B2 = -10

#Taking the limit s->0 to (s*(s-10))/(s**2)*(s**2+1)+(10/s)

B1 = 1

#The principal part at s = 1j is
#A/(s-1j)
#Taking the limit s->1j to (s-10)/((s**2)*(s+1j))

A = (-0.5-1j*5)

#As the other co-efficient is conjugate of the above we can write the partial fraction expansion  of I(s)
I = (1/s)-(10/s**2)-(0.5+1j*5)/(s-1j)-(0.5-1j*5)/(s+1j);
#Taking inverse of each term
I1 = 1/s
I2 = 10/s**2
I3 = (0.5+1j*5)/(s-1j)
I4 = (0.5-1j*5)/(s+1j)
I = I1-I2-I3-I4
print "i(t) = ",I
I(s) =  (s - 10)/(s**2*(s - 1.0*I)*(s + 1.0*I))
i(t) =  -(0.5 - 5.0*I)/(s + 1.0*I) - (0.5 + 5.0*I)/(s - 1.0*I) + 1/s - 10/s**2