目录

RCL电路拉普拉斯变换使用Python-SymPy表达

目录

RCL电路拉普拉斯变换(使用Python SymPy表达)

RCL电路是一个典型的二阶滞后系统,电路方程如下:

L C y ¨ ( t ) + R C y ˙ ( t ) + y ( t )

u ( t ) LC \ddot{y}(t) + RC \dot{y}(t) + y(t) = u(t)

L

C

y

¨

(

t

)

RC

y

˙

(

t

)

y

(

t

)

=

u

(

t

)

对上式进行拉普拉斯变换:

from sympy import symbols, laplace_transform, Function

t, s, R, C, L = symbols('t s R C L')
y = Function('y')(t)

Y = laplace_transform(y, t, s, noconds=True)
print(Y)
Y

结果为:

https://i-blog.csdnimg.cn/direct/455cd8de5a3847318d0fcda1bdf35848.png


u = L * C * y.diff(t, 2) + R * C * y.diff(t) + y
U = laplace_transform(u, t, s, noconds=True)
print(U)
U

https://i-blog.csdnimg.cn/direct/ef579fc2c2854223a207a886fd907a1a.png

H = Y / U
print(H)
H

https://i-blog.csdnimg.cn/direct/da6233a963394cb091751799cc4f860b.png