CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download
Project: test
Views: 91872
Kernel: Unknown Kernel

Complementary Filter

Convert continuous transfer function into discrete

import scipy.signal as sig from math import sqrt dt = 0.01 ki = 0.1**2 kp = sqrt(2)*0.1 num = [kp, ki] den = [1, 0.] sig.cont2discrete(sys=(num,den), dt=0.1)
(array([[ 0.14142136, -0.14042136]]), array([ 1., -1.]), 0.1)
a = 5 num = [a, 0] den = [a, 1] sig.cont2discrete(sys=(num,den), dt=0.1)
(array([[ 1., -1.]]), array([ 1. , -0.98019867]), 0.1)
from sympy import * from sympy.abc import * a = Symbol('a', positive=True) foo = (s/(s+a)).rewrite() print(foo) inverse_laplace_transform(1/((s+a)), s, t)
s/(a + s)
exp(-a*t)*Heaviside(t)