In [4]:
import numpy as np
import sympy as sy
import control.matlab as cm
sy.init_printing()
In [9]:
h, lam = sy.symbols('h, lambda', real=True, positive=True)
s, z = sy.symbols('s, z', real=False)
In [10]:
G = 1/(s-lam)
Y = G/s
Yp = sy.apart(Y, s)
Yp
Out[10]:
In [11]:
from sympy.integrals.transforms import inverse_laplace_transform
from sympy.abc import t
In [12]:
inverse_laplace_transform(Yp, s, t)
Out[12]:
In [13]:
lam = -0.5
h = 0.1
G = cm.tf([1], [1, -lam])
Gd = cm.c2d(G, h)
Hd = 1/lam * cm.tf([np.exp(lam*h)-1],[1, np.exp(lam*h)])
In [14]:
print(Gd)
print(Hd)
In [ ]: