Код: Выделить всё
import lcapy
import sympy as sp
from IPython.display import display, Math
# Define the symbolic variable s
s = sp.symbols('s')
# Define a simple RC circuit netlist
netlist = """
R1 1 2
C1 2 0
"""
# Create a Circuit object from the netlist
circuit = lcapy.Circuit(netlist)
# Find the transfer function from node (0) to node (2)
h = circuit.transfer(0, 1, 0, 2).simplify()
display(Math(f"H(s) = {h.latex()}"))
# Check if h has 's'
if not h.has(s):
raise ValueError("Transfer function h does not contain 's'.")
Подробнее здесь: https://stackoverflow.com/questions/790 ... ognizing-s