1from lcapy import Vdc, R, L, C
2from matplotlib.pyplot import figure, savefig, show
3import numpy as np
4
5a = R(0.1) + C(0.4) + L(0.2)
6
7a.Z.pprint()
8
9f = np.linspace(0, 1000, 1000)
10
11fig = figure()
12ax = fig.add_subplot(111)
13ax.plot(f, abs(a.Z.frequency_response(f)), linewidth=2)
14ax.set_xlabel('Frequency (Hz)')
15ax.set_ylabel('Impedance (ohms)')
16ax.grid(True)
17
18
19show()
20