In [3]:
import numpy as np
import sympy as sy
#import control.matlab as cm
sy.init_printing()
In [4]:
h, b, a,K = sy.symbols('h, b, a, K', real=True, positive=True)
s, z = sy.symbols('s, z', real=False)
In [5]:
F = K*(s+b)/(s+a)
U = F/s/s
Up = sy.apart(U, s)
Up
Out[5]:
In [6]:
from sympy.integrals.transforms import inverse_laplace_transform
from sympy.abc import t
In [7]:
u = sy.simplify(inverse_laplace_transform(Up, s, t))
u
Out[7]:
In [9]:
import control.matlab as cm
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 [10]:
print(Gd)
print(Hd)
In [ ]: