from lcapy import Vdc, R, L, C, I, pprint L1 = L(10) L2 = L(20) print('Series inductors') L3 = L1 + L2 pprint(L3) pprint(L3.simplify()) pprint(L3.norton().simplify()) print('Parallel inductors') L4 = L1 | L2 pprint(L4) pprint(L4.simplify()) pprint(L4.norton().simplify()) C1 = C(10) C2 = C(20) C3 = C1 + C2 print('Series capacitors') pprint(C3) pprint(C3.simplify()) pprint(C3.norton().simplify()) C4 = C1 | C2
from lcapy import Vdc, R, L, C, pprint L1 = L(10) L2 = L(20) L3 = L1 + L2 pprint(L3)
from lcapy import Vstep, R, L, C, pprint C1 = C(10) C2 = C(20) C3 = C1 + C2 pprint(C3)
from lcapy import R, L, C, LSection, pprint, ZPK C1 = C('C_1') L1 = L('L_1') R1 = R('R_1') a = LSection(R1, C1 | L1) Av = a.Vtransfer pprint(Av.canonical()) pprint(Av.ZPK()) pprint(Av.poles()) pprint(Av.zeros())
from lcapy import R, L, C, Xtal, pprint import numpy as np from matplotlib.pyplot import figure, savefig, show C_0 = 4e-12 f_1 = 10e6 C_1 = 8e-15 L_1 = 1 / ((2 * np.pi * f_1)**2 * C_1) R_1 = 20 xtal = Xtal(C_0, R_1, L_1, C_1) pprint(xtal) pprint(xtal.expand()) pprint(xtal.Z) f = np.logspace(6, 8, 1000) fig = figure() ax = fig.add_subplot(111) Zf = xtal.Z.frequency_response(f) ax.loglog(f, abs(Zf)) ax.grid(True) show()
from lcapy import Vdc, R, L, C, pprint C1 = C(10) C2 = C(20) C3 = C1 + C2 pprint(C3)