Oct-26-2020, 10:31 AM
Hello,
The question is related to the use of the Lcapy library (circuit analysis).
The 1st version of the Vin declaration (which is commented out) does not work: freq and pi are not visible in the Circuit function.
Thanks.
Sancho.
The question is related to the use of the Lcapy library (circuit analysis).
The 1st version of the Vin declaration (which is commented out) does not work: freq and pi are not visible in the Circuit function.
from lcapy import Circuit import numpy as np from matplotlib.pyplot import subplots, savefig from math import pi freq = 130e6 cct = Circuit(''' ##... Vin 1 0 {1*sin(2*pi*freq*t)} ... Vin 1 0 {sin(130e6*2*3.14159*t)} ... Rin 1 2 50 ... Cs 2 4 1e-12 ... L 2 3 0.32e-6 ... Rs 3 4 5 ... Cl 4 0 3e-12''') t = np.linspace(0, 2e-7, 1000) vcl = cct.Cl.v.evaluate(t) fig, ax = subplots(1) ax.plot(t, vcl, linewidth=2) ax.set_xlabel('Time (s)') ax.set_ylabel('Output voltage (V)') ax.grid(True) savefig('antenna_output.png')How to make them visible inside function?
Thanks.
Sancho.